You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/python-api.rst
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -282,11 +282,13 @@ Using this factory function allows you to set :ref:`python_api_table_configurati
282
282
283
283
The ``db.table()`` method will always return a :ref:`reference_db_table` instance, or raise a ``sqlite_utils.db.NoTable`` exception if the table name is actually a SQL view.
284
284
285
-
You can also access tables or views using dictionary-style syntax, like this:
285
+
You can also access tables using dictionary-style syntax, like this:
286
286
287
287
.. code-block:: python
288
288
289
-
table_or_view = db["my_table_or_view_name"]
289
+
table = db["my_table_name"]
290
+
291
+
This is equivalent to calling ``db.table("my_table_name")``. It will raise a ``sqlite_utils.db.NoTable`` exception if the name refers to a view rather than a table.
290
292
291
293
If a table accessed using either of these methods does not yet exist, it will be created the first time you attempt to insert or upsert data into it.
0 commit comments