httk.store.backend.clickhouse.engine

ClickHouse database construction for Backend.

Functions

database(cls, url, *[, database])

Build a ClickHouse-backed backend from a clickhousedb:// URL.

Module Contents

httk.store.backend.clickhouse.engine.database(cls, url, *, database=None)

Build a ClickHouse-backed backend from a clickhousedb:// URL.

The URL uses the SQLAlchemy clickhouse-connect dialect, for example clickhousedb://default:@host:8123/my_database. database replaces the URL path when supplied. The constructor always merges join_use_nulls=1 into the URL query and selects the bulk-fenced storage profile before any SqlStore initialization occurs.

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

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

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

Returns:

Connected ClickHouse backend wrapper using the bulk-fenced profile.

Raises:
  • ImportError – If clickhouse-connect is not installed; install the httk-store[clickhouse] extra.

  • RuntimeError – If Keeper is unavailable, the server is too old, or join_use_nulls cannot be enforced.

Return type:

httk.store.backend.sql.engine.Backend