httk.store.backend.sql.stores¶
Per-dialect stores that build and own their Backend.
These are thin SqlStore subclasses whose
name selects the database engine and whose first argument is only the location:
SqliteStore("results.sqlite") instead of
SqlStore(Backend.sqlite("results.sqlite")). Each builds the matching
Backend, owns it, and disposes it on close()
or when leaving a with block.
For a custom SQLAlchemy engine, one Backend shared across several stores or
a with Backend.sqlite(...) as db: block, or degraded=True recovery, use
the two-object form Backend +
SqlStore directly.
Classes¶
Module Contents¶
- class httk.store.backend.sql.stores.SqliteStore(path=None, *, degraded=False, **store_options)¶
Bases:
httk.store.backend.sql.store.SqlStoreAn SQLite store that builds and owns its
Backend.The store owns the backend it builds and disposes it on
close()or when leaving awithblock. For a custom SQLAlchemy engine or aBackendshared across awithblock, useBackendandSqlStoredirectly.- Parameters:
path (str | os.PathLike[str] | None) – The database file path, or
Nonefor an in-memory database.degraded (bool) – Open with autocommit isolation for degraded-mode access (recovery and inspection) instead of the default transactional isolation.
**store_options (Any) – Keyword options of
SqlStore(records,entry_records,entry_ids,upgrade, …).
- class httk.store.backend.sql.stores.DuckdbStore(path=None, *, read_only=False, memory_limit=None, **store_options)¶
Bases:
httk.store.backend.sql.store.SqlStoreA DuckDB store that builds and owns its
Backend.The store owns the backend it builds and disposes it on
close()or when leaving awithblock. For a custom SQLAlchemy engine or aBackendshared across awithblock, useBackendandSqlStoredirectly.- Parameters:
path (str | os.PathLike[str] | None) – The database file path, or
Nonefor an in-memory database.read_only (bool) – Open the file in DuckDB
READ_ONLYaccess mode, so several processes may open it concurrently for reading; writes then fail. Ignored for the in-memory database.memory_limit (str | None) – An optional DuckDB
memory_limitsetting such as"1GB";Nonefalls back to theHTTK_DUCKDB_MEMORY_LIMITenvironment variable.**store_options (Any) – Keyword options of
SqlStore(records,entry_records,entry_ids,upgrade, …).
- class httk.store.backend.sql.stores.PostgresqlStore(url, *, database=None, **store_options)¶
Bases:
httk.store.backend.sql.store.SqlStoreA PostgreSQL store that builds and owns its
Backend.The store owns the backend it builds and disposes it on
close()or when leaving awithblock. For a custom SQLAlchemy engine or aBackendshared across awithblock, useBackendandSqlStoredirectly.
- class httk.store.backend.sql.stores.ClickhouseStore(url, *, database=None, **store_options)¶
Bases:
httk.store.backend.sql.store.SqlStoreA ClickHouse store that builds and owns its
Backend.The store owns the backend it builds and disposes it on
close()or when leaving awithblock. For a custom SQLAlchemy engine or aBackendshared across awithblock, useBackendandSqlStoredirectly.