Skip to main content

Module journal

Module journal 

Source
Expand description

The JOURNAL declaration’s emission: the canonical record, and the row contract over it.

ⓘ
#[ingraph::journal(root = "MediaId", sqlite)]
pub struct VideoJournal;

§It emits a RECORD, and that is the whole design

What the word mounts is not a second kind of thing. columns mints the four the organ is keyed and read by, the front end hands them to the ORDINARY record pass under NodeKind::Record, and this model emits that record’s own expansion plus one impl. So a mounted journal has the *Key type, the accessor family, the per-database row, the comparison lowering, the order-by vocabulary and the cursor that every declared record has — because it IS one — and a deployment queries its run state exactly as it queries anything else it declared.

The one thing added is [JournalModel::row]: impl JournalRow<Root>, which is the same trait the HAND path implements by hand. The macro is sugar over that contract and never a replacement, so the two paths meet at one seam and a writer cannot tell them apart.

§The four columns, and why each is the one it is

columntypewhy
rootthe type root = "…" namedone journal table per ROOT FAMILY, and the root is that family
nodeStringNodeName’s storable face, which is what the hand corpus already stores
stationStringStation’s, for the same reason — the framework’s own stable word
atTimestampthe framework’s own instant: feature-free, and stored on every backend

root is the LINEAGE and node is the ID, so key = lineage ⊕ id spells (root, node) with nothing declared for it — and the keyed replace that makes an entry the LAST STATE is the ordinary write of that key. That is the organ’s semantics arriving from the record law rather than from anything written here.

root’s CITIZENSHIP is not checked here and is not left unchecked: it is a key column of an ordinary record, so a type no backend can store is the storability audit’s own refusal, at the declaration that named it.

§SystemTime → Timestamp: the crossing PANICS, and the alternative is a durable lie

JournalRow::of is handed a SystemTime and the at column is a Timestamp, whose range is jiff’s ±9999 years. The conversion is TryFrom rather than From on purpose — ingraph::Timestamp’s own note says why: a saturating From would substitute an instant for the one a caller handed over.

The signature this emission has to satisfy returns Self and cannot report a refusal, so the two available postures are to substitute an instant or to stop. It stops. A journal row is DURABLE and is read as when this node got there, so a substituted instant is a row asserting a moment that never happened — and what reaches this crossing is a system clock wrong by thousands of years rather than a value worth rounding. The panic names the fact and carries jiff’s own refusal; a deployment that would rather keep the row writes the HAND path, whose of is its own and may say whatever it likes about an instant it cannot hold.

Structs§

JournalModel
A validated journal declaration, ready to emit.

Functions§

columns
The four canonical columns, minted whole — the ONE authority for a mounted journal’s shape.