Getting started

To get started with the features described in this document, you will want to use the SqliteExtDatabase class from the playhouse.sqlite_ext module. Furthermore, some features require the playhouse._sqlite_ext C extension – these features will be noted in the documentation.

Instantiating a SqliteExtDatabase:

  1. from playhouse.sqlite_ext import SqliteExtDatabase
  2. db = SqliteExtDatabase('my_app.db', pragmas=(
  3. ('cache_size', -1024 * 64), # 64MB page-cache.
  4. ('journal_mode', 'wal'), # Use WAL-mode (you should always use this!).
  5. ('foreign_keys', 1)) # Enforce foreign-key constraints.