Skip to main content

Module engine

Module engine 

Source
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§

DenseIntegerKey
A dense integer key: start + step * row_index. The closed form a bare integer primary key (a database sequence) reduces to.
EngineReport
A summary of a completed engine run: rows written across every table.
GeneratedRow
A single generated row, handed to a RowSink.
GenerationEngine
Executes a compiled GenerationPlan, streaming rows to a RowSink.
SeededUuidKey
A per-row-reseeded random-access UUID key (RFC 4122 v4). Row n’s key derives from the parent table’s seed and a primary_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§

RandomAccessKeyGenerator
A random-access key generator: reproduces the key of parent row row_index in closed form, without materializing the intervening rows. Used as a component of a composite KeyDomain.
RowSink
A destination for generated rows: notified at each table boundary and given every row in order.