httk.store.backend.sqlite.engine

SQLite database construction for Backend.

Functions

database(cls[, path, degraded])

Build an SQLite-backed backend stored in path, or in memory when path is None.

Module Contents

httk.store.backend.sqlite.engine.database(cls, path=None, *, degraded=False)

Build an SQLite-backed backend stored in path, or in memory when path is None.

The in-memory variant is configured (via a static connection pool with a shared, thread-unrestricted connection) so that every connection drawn from the engine sees the one and same database; file-backed databases use SQLAlchemy’s default pooling.

Parameters:
  • cls (type[Backend]) – The backend class to instantiate.

  • path (str | os.PathLike[str] | None) – The database file path, or None for an in-memory database.

  • degraded (bool) – Open with autocommit isolation for degraded-mode access (recovery and inspection) instead of the default transactional isolation.

Returns:

The configured backend wrapper.

Return type:

httk.store.backend.sql.engine.Backend