Getting started

To get started with the features described in this document, you will want touse the SqliteExtDatabase class from the playhouse.sqlite_extmodule. Furthermore, some features require the playhouse._sqlite_ext Cextension – these features will be noted in the documentation.

Instantiating a SqliteExtDatabase:

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