Expand description
The GenerationEngine: streams rows from a compiled GenerationPlan.
The engine walks the plan’s tables in dependency order (parents before
children) and, for each table, produces every row by executing its column
owners, then hands the row to a RowSink. It owns one reusable row buffer
per active table so the hot loop never reallocates the row vector.
§Foreign keys without spooling
A foreign-key column cannot be produced from a per-row seed alone: choosing a
parent row needs the parent’s key domain and row count, cross-table state
only the engine has. The engine therefore drives every FK column from its
CompiledRelationship, regardless of whether the compiler recorded the
column as ColumnOwner::Relationship (an inferred FK) or
ColumnOwner::Generator with kind relation.foreign_key (an explicit
rule). Both converge here: the compiled generator marker is never executed;
its distribution / null_rate arguments were folded into the relationship
at compile time.
§Reproducible key domains
A parent key referenced by a child is materialized as a KeyDomain. A bare
integer primary key (the database sequence a child references) compiles to a
KeyDomain::DenseInteger over 1..=count: the parent renders that id and
the child regenerates parent row n’s key in closed form, without storing
every key. Stateful or non-random-access parent keys are not materializable
yet and report GEN-KEY-DOMAIN-UNSUPPORTED (protected key spooling is a
later task).
Structs§
- Dense
Integer Key - A dense integer key:
start + step * row_index. The closed form a bare integer primary key (a database sequence) reduces to. - Engine
Report - A summary of a completed engine run: rows written across every table.
- Generated
Row - A single generated row, handed to a
RowSink. - Generation
Engine - Executes a compiled
GenerationPlan, streaming rows to aRowSink. - Seeded
Uuid Key - A per-row-reseeded random-access UUID key (RFC 4122 v4). Row
n’s key derives from the parent table’s seed and aprimary_key.row.<n>stream, so any parent row’s UUID is reproducible by index without storing every key.
Enums§
- KeyDomain
- A reproducible domain of parent keys a child references, addressable by parent row index without storing every key.
Traits§
- Random
Access KeyGenerator - A random-access key generator: reproduces the key of parent row
row_indexin closed form, without materializing the intervening rows. Used as a component of a compositeKeyDomain. - RowSink
- A destination for generated rows: notified at each table boundary and given every row in order.