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§
- Authorized
Read Snapshot - One optimistic authorization snapshot for a complete scored read.
- Authorized
Read Stamp - Exact table/security generation used by one successful authorized read.
- CdcBatch
- Change
Event - A durable data-change event reconstructed from committed WAL records, or an
ephemeral SQL
NOTIFYevent whenidisNone. - Check
Issue - An integrity issue found by
Database::check(spec §16). - Database
- The exclusive public owner of one
DatabaseCore(spec §10.1, S1A-001). - Database
Core - The shared storage core (spec §10.1, S1A-001): one catalog, one epoch
clock, shared caches, a shared WAL, and a live map of name →
Arc<Table>. - Database
Open Metrics - External
Trigger Write Result - Open
Options - Knobs for
Database::open_with_options. - Read
Authorization - RlsCache
Stats - Runtime statistics for the byte-bounded RLS candidate cache.
- Table
Generation Stats - Table
Handle - Mounted table with immutable, structurally shared scored-read generations.
- Table
Pins Report - Per-table version-retention pin diagnostics (S1C-004): one mounted table’s
active pin sources as reported by
crate::engine::Table::version_pins_report. - Table
Read Generation - Immutable, structurally shared snapshot used by scored readers.
Enums§
- External
Trigger Base Write - External
Trigger Write - Staged
TxnWrite - Two-pass,
flushed_epoch-gated recovery of the shared WAL (spec §15). - Table
Guard
Constants§
- CTAS_
BUILD_ TABLE_ PREFIX - DEFAULT_
MEMORY_ BUDGET_ BYTES - Default node-level memory budget (S1E-003): 1 GiB. Comfortably covers the two 64 MiB caches with headroom for query execution, result buffering, and maintenance reservations.
- DEFAULT_
TEMP_ DISK_ BUDGET_ BYTES - Default node-level temporary-disk (spill) budget (S1E-004): 4 GiB of live spill files across every query on the core.
- EXTERNAL_
TABLE_ ID - Sentinel
table_idforCheckIssues 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_idforCheckIssues that concern the shared WAL rather than any table.u64::MAXis never allocated to a real table (the catalog mints ids from 0 upward), soDatabase::doctorcan safely skip them.
Traits§
Functions§
- lock_
table_ with_ context - translate_
records_ for_ replication - Leader-side spill translation for the replicated write path (spec section 11.3 step 3, “leader constructs transaction command”; review finding M2).