Getting started
To get started with the features described in this document, you will want touse the SqliteExtDatabase
class from the playhouse.sqlite_ext
module. Furthermore, some features require the playhouse._sqlite_ext
Cextension – these features will be noted in the documentation.
Instantiating a SqliteExtDatabase
:
- from playhouse.sqlite_ext import SqliteExtDatabase
- db = SqliteExtDatabase('my_app.db', pragmas=(
- ('cache_size', -1024 * 64), # 64MB page-cache.
- ('journal_mode', 'wal'), # Use WAL-mode (you should always use this!).
- ('foreign_keys', 1)) # Enforce foreign-key constraints.