Skip to main content

Module database

Module database 

Source
Expand description

Multi-table Database container (spec §5, §6, §10).

Owns the shared services — catalog, dual-counter epoch authority, shared raw/decoded page caches, snapshot-retention registry, and the DB-wide KEK — and mounts per-table Table engines under tables/<id>/ that borrow them. P1 scope: per-table WALs remain (collapsed into one shared WAL in P2); the win here is one consistent commit clock across tables and one reopen path.

Structs§

AuthorizedReadSnapshot
One optimistic authorization snapshot for a complete scored read.
AuthorizedReadStamp
Exact table/security generation used by one successful authorized read.
CdcBatch
ChangeEvent
A durable data-change event reconstructed from committed WAL records, or an ephemeral SQL NOTIFY event when id is None.
CheckIssue
An integrity issue found by Database::check (spec §16).
Database
A multi-table database: one catalog, one epoch clock, shared caches, a shared WAL, and a live map of name → Arc<Table>.
ExternalTriggerWriteResult
OpenOptions
Knobs for Database::open_with_options.
ReadAuthorization
RlsCacheStats
Runtime statistics for the byte-bounded RLS candidate cache.
TableGenerationStats
TableHandle
Mounted table with immutable, structurally shared scored-read generations.
TableReadGeneration
Immutable, structurally shared snapshot used by scored readers.

Enums§

ExternalTriggerBaseWrite
ExternalTriggerWrite
TableGuard

Constants§

CTAS_BUILD_TABLE_PREFIX
EXTERNAL_TABLE_ID
Sentinel table_id for CheckIssues that concern external-table module state instead of an ordinary table.
HISTORY_RETENTION_FILENAME
KEYS_FILENAME
META_DIR
TABLES_DIR
VTAB_DIR
WAL_TABLE_ID
Sentinel table_id for CheckIssues that concern the shared WAL rather than any table. u64::MAX is never allocated to a real table (the catalog mints ids from 0 upward), so Database::doctor can safely skip them.

Traits§

ExternalTriggerBridge

Functions§

lock_table_with_context