Skip to content

Commit 08be98f

Browse files
committed
Extra docs for db.view()
1 parent 72c8c88 commit 08be98f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

docs/python-api.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,6 +1394,10 @@ You can drop a table or view using the ``.drop()`` method:
13941394
.. code-block:: python
13951395
13961396
db.table("my_table").drop()
1397+
# Or for a view:
1398+
db.view("my_view").drop()
1399+
# Or for either:
1400+
db["table_or_view_name"].drop()
13971401
13981402
Pass ``ignore=True`` if you want to ignore the error caused by the table or view not existing.
13991403

@@ -1937,6 +1941,8 @@ If you have loaded an existing table or view, you can use introspection to find
19371941
19381942
>>> db.table("PlantType")
19391943
<Table PlantType (id, value)>
1944+
### db.view("NameOfView")
1945+
<View NameOfView (id, value)>
19401946
19411947
.. _python_api_introspection_exists:
19421948
@@ -1949,6 +1955,8 @@ The ``.exists()`` method can be used to find out if a table exists or not::
19491955
True
19501956
>>> db.table("PlantType2").exists()
19511957
False
1958+
>>> db["table_or_view_name"].exists()
1959+
False
19521960
19531961
.. _python_api_introspection_count:
19541962

0 commit comments

Comments
 (0)