Expand description
The dataflow value types: Node, the lazy relationship stream, Change,
SourceChange, Constraint, FetchRequest, and the overlay snapshots.
Primitive #6: the 'yield' sentinel is dropped. In the JS engine every
stream element is Node | 'yield' (a cooperative-responsiveness hack for the
single JS event loop, stripped before the view by skipYields). The port
drops it entirely: NodeStream’s item is just Node. Responsiveness, if
ever needed, is an explicit budget threaded in — never unioned into the item.
Structs§
- Fetch
Request - What
Input::fetchreceives.multi_constraints(from FlippedJoin) is a disjunction-of-conjunctions IN-batch; empty ⇒ the single-constraint path. - Node
- A row plus its lazily-produced relationships.
- OutEdge
- A downstream edge: who to push to, and on which of their input ports.
- Relationship
- Start
Enums§
- Basis
- Change
- A downstream incremental change. Mirrors
zql/src/ivm/change.tsbut as a real tagged union (the JS uses a tuple where slot 2 aliases OLD_NODE / CHILD_DATA — the enum removes that aliasing footgun). - Change
Type - The kind of a
Change, independent of its payload. Used by the OR fan-in collapse (push_accumulated_changes,06§3.5): the dedup decision keys off the fan-out’s original change type (was it an Add/Remove/Edit/ Child that entered the fan), so we need to name the type without owning aChange. Mirrors the JSchange.typestring discriminant. - Port
- Marker for which join port a change arrived on (replaces JS’s two distinct
setOutput({push: ...})closures). - Source
Change - A change applied at the source (before fan-out to connections). Mirrors the
SourceChangetagged tuple (source.ts): Add/Remove carry one row, Edit carries the newrowand theoldrow it replaces.
Functions§
- constraint_
matches - True if
rowsatisfies every(col, value)pair. Usesvalues_equal(null ≠ null — SQL/join semantics), matching the JSconstraintMatchesRow(constraint.ts:17). Notcompare_values(which treats null == null): a constraint value of null can never match (and joins never produce one —build_join_constraintreturnsNoneon null, §3.8).
Type Aliases§
- Constraint
(column, value)equality constraints, ANDed. Index-addressed. Owned values (Vec<(ColId, OwnedValue)>) because a constraint outlives the fetch that produced its source row (foundations §3.3). Insertion order is significant: it determines the index sort the source builds to seek the constraint (mirrors the JSObject.keys(constraint)order —memory-source.ts:289).- Multi
Constraint - A disjunction of
Constraints — a row matches the multiConstraint iff it matches some entry. FlippedJoin lowers an IN-batch to these (operator.tsMultiConstraint). The memory leaf drives a sub-fetch per entry and k-way-merges (#fetchMulti); the SQLite leaf lowers to nativeIN. - RowFlow
- A lazy stream of owned rows — the currency of the source read pipeline.