httk.store.db.layout¶
Versioned physical layout for httk.store.db.store.SqlStore.
Attributes¶
The persisted SqlStore layout protocol implemented by this package. |
|
Reserved key/value table holding the store protocol and entry declaration. |
|
Exceptions¶
A database does not exactly implement the current persisted store layout. |
|
A new open found an interrupted empty-store bulk ingest. |
Classes¶
One immutable configured entry family and its concrete records. |
|
The immutable normalized entry declaration of an initialized store. |
|
Dialect capabilities used by the SQL storage protocol. |
Functions¶
|
Serialize a normalized declaration in its exact deterministic persisted form. |
|
Resolve the hardcoded protocol facts for one supported dialect. |
|
Normalize a declaration and apply SQL physical-name validation. |
|
Return SQLAlchemy metadata for all protocol-owned tables of |
|
Return the reserved protocol key/value table in |
|
Return application schema-object names mapped to their stable object kinds. |
|
Return application base-table names without SQLAlchemy reflection. |
|
Read the marker values, or return |
Module Contents¶
- class httk.store.db.layout.EntryFamilyLayout[source]¶
One immutable configured entry family and its concrete records.
- class httk.store.db.layout.StorageLayout[source]¶
The immutable normalized entry declaration of an initialized store.
- families: tuple[EntryFamilyLayout, Ellipsis]¶
- property entry_records: collections.abc.Mapping[type, tuple[type, Ellipsis]]¶
Configured family classes mapped to their ordered concrete record classes.
- property declaration: collections.abc.Mapping[str, tuple[str, Ellipsis]]¶
Configured stable family names mapped to their ordered stable record names.
- exception httk.store.db.layout.StorageLayoutUpgradeRequiredError(diff)[source]¶
Bases:
RuntimeErrorA database does not exactly implement the current persisted store layout.
diffis immutable and JSON-shaped. Its top-level keys are stable categories (currentlyprotocol,declarationandschema), so a caller can present a precise upgrade diagnostic without parsing the human-readable exception message.- diff: collections.abc.Mapping[str, object]¶
- httk.store.db.layout.declaration_json(layout)[source]¶
Serialize a normalized declaration in its exact deterministic persisted form.
- httk.store.db.layout.STORAGE_PROTOCOL_VERSION: Final = 'v2.4.0'[source]¶
The persisted SqlStore layout protocol implemented by this package.
- httk.store.db.layout.METADATA_TABLE_NAME: Final = '_httk_store_metadata'[source]¶
Reserved key/value table holding the store protocol and entry declaration.
- exception httk.store.db.layout.StoreUnderConstructionError[source]¶
Bases:
RuntimeErrorA new open found an interrupted empty-store bulk ingest.
Crash window for new SQLite/DuckDB opens: before the marker commits the old clean state remains accepted; after the marker and through ingest, finalize, or before marker clear the store is rejected; after clear it is accepted again. The marker is intentionally not a resume protocol.
ClickHouse marker residue is fail-closed: the default recovery is to drop the database and re-ingest. Clearing the marker is valid only after an operator has restored and verified the declared empty-store invariant.
- class httk.store.db.layout.BackendFacts[source]¶
Dialect capabilities used by the SQL storage protocol.
- httk.store.db.layout.backend_facts_for_dialect(dialect_name)[source]¶
Resolve the hardcoded protocol facts for one supported dialect.
- httk.store.db.layout.normalize_entry_records(entry_records)[source]¶
Normalize a declaration and apply SQL physical-name validation.
- httk.store.db.layout.expected_metadata(layout)[source]¶
Return SQLAlchemy metadata for all protocol-owned tables of
layout.
- httk.store.db.layout.metadata_table_for(metadata)[source]¶
Return the reserved protocol key/value table in
metadata.
- httk.store.db.layout.actual_schema_objects(connection)[source]¶
Return application schema-object names mapped to their stable object kinds.
The DuckDB SQLAlchemy inspector presently routes column inspection through a PostgreSQL catalogue relation DuckDB does not expose, so the whole layout path intentionally uses the dialect catalogues directly.