pub enum Change<'g> {
Add(Node<'g>),
Remove(Node<'g>),
Edit {
node: Node<'g>,
old: Node<'g>,
},
Child {
node: Node<'g>,
rel: RelId,
child: Box<Change<'g>>,
},
}Expand description
A downstream incremental change. Mirrors zql/src/ivm/change.ts but as a
real tagged union (the JS uses a tuple where slot 2 aliases OLD_NODE /
CHILD_DATA — the enum removes that aliasing footgun).
Variants§
Add(Node<'g>)
Remove(Node<'g>)
Edit
An in-place edit: the row’s PK is unchanged but some columns differ. Holds
both the new node and the old node (makeEditChange — change.ts). A
connection with split-edit keys never sees this (the source decomposes it
into Remove(old)+Add(new) before fan-out, §3.6); it survives only for
connections that don’t split.
Child
Implementations§
Source§impl<'g> Change<'g>
impl<'g> Change<'g>
Sourcepub fn change_type(&self) -> ChangeType
pub fn change_type(&self) -> ChangeType
This change’s ChangeType discriminant (payload-free).
Sourcepub fn primary_row(&self) -> &Row
pub fn primary_row(&self) -> &Row
The row identifying this change’s node (the new row for an Edit; the
changed-child’s row for a Child). On a child-side join push this is the row
whose join key selects the matching parents (join.ts#pushChildChange).