mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-23 01:14:31 +02:00
Database(..., recreate=True) option, refs #97
This commit is contained in:
parent
635c91475a
commit
7e4b9997c2
2 changed files with 16 additions and 6 deletions
|
|
@ -15,7 +15,15 @@ Database objects are constructed by passing in either a path to a file on disk o
|
|||
|
||||
db = Database("my_database.db")
|
||||
|
||||
This will create ``my_database.db`` if it does not already exist. You can also pass in an existing SQLite connection:
|
||||
This will create ``my_database.db`` if it does not already exist.
|
||||
|
||||
If you want to recreate a database from scratch (first removing the existing file from disk if it already exists) you can use the ``recreate=True`` argument:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
db = Database("my_database.db", recreate=True)
|
||||
|
||||
Instead of a file path you can pass in an existing SQLite connection:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue