mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-23 01:14:31 +02:00
Support Database(memory=True) for in-memory databases
This commit is contained in:
parent
58db40d67c
commit
034d498b31
4 changed files with 25 additions and 6 deletions
|
|
@ -27,7 +27,7 @@ If you want to create an in-memory database, you can do so like this:
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
db = Database(sqlite3.connect(":memory:"))
|
||||
db = Database(sqlite3.connect(memory=True))
|
||||
|
||||
Tables are accessed using the indexing operator, like so:
|
||||
|
||||
|
|
@ -37,6 +37,14 @@ Tables are accessed using the indexing operator, like so:
|
|||
|
||||
If the table does not yet exist, it will be created the first time you attempt to insert or upsert data into it.
|
||||
|
||||
You can also access tables using the ``.table()`` method like so:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
table = db.table("my_table")
|
||||
|
||||
Using this factory function allows you to set :ref:`python_api_table_configuration`.
|
||||
|
||||
Listing tables
|
||||
==============
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue