table.exists() now a documented method, closes #83

This commit is contained in:
Simon Willison 2020-02-08 15:56:03 -08:00
commit 0eda638d81
3 changed files with 30 additions and 20 deletions

View file

@ -920,6 +920,13 @@ If you have loaded an existing table or view, you can use introspection to find
>>> db["PlantType"]
<Table PlantType (id, value)>
The ``.exists()`` method can be used to find out if a table exists or not::
>>> db["PlantType"].exists()
True
>>> db["PlantType2"].exists()
False
The ``.count`` property shows the current number of rows (``select count(*) from table``)::
>>> db["PlantType"].count