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

SqliteStore

An SQLite store that builds and owns its Backend.

DuckdbStore

A DuckDB store that builds and owns its Backend.

PostgresqlStore

A PostgreSQL store that builds and owns its Backend.

ClickhouseStore

A ClickHouse store that builds and owns its Backend.

Module Contents

class httk.store.backend.sql.stores.SqliteStore(path=None, *, degraded=False, **store_options)

Bases: httk.store.backend.sql.store.SqlStore

An SQLite store that builds and owns its Backend.

The store owns the backend it builds and disposes it on close() or when leaving a with block. For a custom SQLAlchemy engine or a Backend shared across a with block, use Backend and SqlStore directly.

Parameters:
  • 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.

  • **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.SqlStore

A DuckDB store that builds and owns its Backend.

The store owns the backend it builds and disposes it on close() or when leaving a with block. For a custom SQLAlchemy engine or a Backend shared across a with block, use Backend and SqlStore directly.

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

  • read_only (bool) – Open the file in DuckDB READ_ONLY access 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_limit setting such as "1GB"; None falls back to the HTTK_DUCKDB_MEMORY_LIMIT environment 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.SqlStore

A PostgreSQL store that builds and owns its Backend.

The store owns the backend it builds and disposes it on close() or when leaving a with block. For a custom SQLAlchemy engine or a Backend shared across a with block, use Backend and SqlStore directly.

Parameters:
  • url (str | sqlalchemy.URL) – PostgreSQL SQLAlchemy URL or URL string.

  • database (str | None) – The database name overriding the URL path, if supplied.

  • **store_options (Any) – Keyword options of SqlStore (records, entry_records, entry_ids, upgrade, …).

class httk.store.backend.sql.stores.ClickhouseStore(url, *, database=None, **store_options)

Bases: httk.store.backend.sql.store.SqlStore

A ClickHouse store that builds and owns its Backend.

The store owns the backend it builds and disposes it on close() or when leaving a with block. For a custom SQLAlchemy engine or a Backend shared across a with block, use Backend and SqlStore directly.

Parameters:
  • url (str | sqlalchemy.URL) – ClickHouse SQLAlchemy URL or URL string.

  • database (str | None) – The database name overriding the URL path, if supplied.

  • **store_options (Any) – Keyword options of SqlStore (records, entry_records, entry_ids, upgrade, …).