Skip to main content

zero_client/ivm/
mod.rs

1//! Incremental view maintenance (`packages/zql/src/ivm`): the operators a
2//! query's pipeline is built from, the memory source they read, and the view
3//! that materializes their output.
4//!
5//! A pipeline is a graph of reference-counted operators on one thread. Each
6//! operator holds its inputs strongly and its outputs weakly, so the view at
7//! the end of a pipeline owns it; a push that reaches a released output is
8//! dropped. Operators take `&self` and keep their state in cells, borrowed
9//! only between calls to other operators: a push can fetch back through the
10//! operator that pushed it.
11//!
12//! Fetches are lazy streams, like JS's generators: a fetch reads operator and
13//! source state when its first row is pulled, not when it is created.
14
15mod aggregate;
16mod change;
17mod constraint;
18mod data;
19mod deferred_input;
20mod failure;
21mod filter;
22mod filter_push;
23mod flipped_join;
24mod group_by;
25mod join;
26mod join_utils;
27mod lift_field;
28mod memory_source;
29mod operator;
30mod predicate;
31mod stream;
32mod take;
33mod union_fan;
34mod view;
35
36pub use aggregate::*;
37pub use change::*;
38pub use constraint::*;
39pub use data::*;
40pub use deferred_input::*;
41pub use failure::*;
42pub use filter::*;
43pub use filter_push::*;
44pub use flipped_join::*;
45pub use group_by::*;
46pub use join::*;
47pub use join_utils::*;
48pub use lift_field::*;
49pub use memory_source::*;
50pub use operator::*;
51pub use predicate::*;
52pub use stream::*;
53pub use take::*;
54pub use union_fan::*;
55pub use view::*;
56
57use crate::json::Object;
58use std::rc::Rc;
59
60/// A row: column name to value. A missing column reads as absent, as an
61/// `undefined` property does in JS. Rows are shared, not copied, as they
62/// flow through a pipeline.
63pub type Row = Rc<Object>;