pub struct TableInfo {
pub app_id: String,
pub name: String,
pub database: String,
pub storage: BackendType,
pub consistency: Option<ConsistencyMode>,
pub crdt_fields: HashMap<String, String>,
pub residency: Option<String>,
pub expiration_secs: Option<u64>,
pub audit_capture_state: bool,
pub durability: Option<DurabilityTier>,
pub def: Option<Arc<TableDefinition>>,
}Expand description
Table information for backend initialization.
Fields§
§app_id: StringOwning application id. Stamped onto every transaction-log
entry’s table.app field so audit / replication observers
can attribute writes to the right app even when multiple apps
share a database (@table(database: "...") declares cross-
app sharing). Empty string is the default for test fixtures
that don’t care about app attribution; in production every
TableInfo is built from an AppMetadata with a populated
id.
name: StringTable name (used as column family name)
database: StringDatabase name (default: “data”)
storage: BackendTypeStorage backend type
consistency: Option<ConsistencyMode>Per-table consistency mode override
crdt_fields: HashMap<String, String>Per-field CRDT type declarations
residency: Option<String>Residency mode
expiration_secs: Option<u64>Per-record TTL expiration from @table(expiration: N) — Some(secs)
activates the 9-byte record header + RocksDB ExpirationFilter.
None means the column family is written without a header.
audit_capture_state: boolTrue when the schema declared @audit(capture_state: true)
on this table. The LoggingBackend wrapper uses this flag to
decide whether to read the existing value before each write
and stamp it onto LogEntry::prev_value for AuditEntry.before.
Costs one extra storage read per write — hence per-table
opt-in.
durability: Option<DurabilityTier>Per-table durability from @store(durability:). None inherits the
database-level default (the WAL setting the BackendManager was
opened with). Some(tier) overrides this table’s WriteOptions:
Lossy skips the WAL (throughput), Soft/Strong write through it,
Strong additionally fsyncs each write. RocksDB applies disableWAL
and sync per write, so column families in one database can differ.
def: Option<Arc<TableDefinition>>The full source TableDefinition
this TableInfo was projected from. Carried so downstream consumers
(replication’s @distribute, the router’s @export/transport flags)
read one source of truth instead of side-channel maps or re-parsing
the schema. None for hand-built test fixtures, which only exercise
the flattened backend fields.