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 btree;
17mod change;
18mod constraint;
19mod data;
20mod deferred_input;
21mod failure;
22mod filter;
23mod filter_push;
24mod flipped_join;
25mod group_by;
26mod join;
27mod join_utils;
28mod lift_field;
29mod memory_source;
30mod operator;
31mod predicate;
32mod stream;
33mod take;
34mod union_fan;
35mod view;
36
37pub use aggregate::*;
38pub use change::*;
39pub use constraint::*;
40pub use data::*;
41pub use deferred_input::*;
42pub use failure::*;
43pub use filter::*;
44pub use filter_push::*;
45pub use flipped_join::*;
46pub use group_by::*;
47pub use join::*;
48pub use join_utils::*;
49pub use lift_field::*;
50pub use memory_source::*;
51pub use operator::*;
52pub use predicate::*;
53pub use stream::*;
54pub use take::*;
55pub use union_fan::*;
56pub use view::*;
57
58use crate::json::Object;
59use std::rc::Rc;
60
61/// A row: column name to value. A missing column reads as absent, as an
62/// `undefined` property does in JS. Rows are shared, not copied, as they
63/// flow through a pipeline.
64pub type Row = Rc<Object>;