Skip to main content

Module builder

Module builder 

Source
Expand description

Builds IVM pipelines from ASTs (packages/zql/src/builder/builder.ts).

Two modes: compute, where every operator runs on the client’s own rows, and the synced client’s, which reads aggregates and groups from the rows the server streams for them (aggregates_from_source).

Structs§

OptimisticAggregate
OptimisticAggregate: how a mutation of a child row moves a synced aggregate’s row. Registered when a query with a relationship aggregate or a grouping materializes.

Constants§

EXISTS_LIMIT
The limit put on EXISTS subqueries: one row is enough, a few more keep a removal from emptying it.
MAX_PUSHED_IN_VALUES
The longest IN list copied into a child.
PERMISSIONS_EXISTS_LIMIT

Traits§

BuilderDelegate
Connects a pipeline being built to its environment (BuilderDelegate).

Functions§

aggregate_table_name
aggregateTableName: aggregate:<queryID>:<alias path>, the table of an aggregate relationship’s rows. parent_name is the parent’s pipeline name.
build_pipeline
Builds a pipeline from an AST (buildPipeline).
complete_ordering
completeOrdering: appends missing primary key columns to every ordering in the AST.
encode_uri_component
JS’s encodeURIComponent: every UTF-8 byte but the letters, digits and -_.!~*'() as %XX; with escaping_dots, . too.
group_table_name
groupTableName: aggregate:<queryID>:#group, the table of a grouped query’s rows. An escaped alias never has a #.
group_view_input
groupViewInput: the input of a grouped query’s view: its rows reduced to the group columns and, for a groupBy() with an aggregate, the value under the function’s name, by the names of the pipeline’s AST.
push_down_correlated_predicates
Copies a parent’s conditions on correlation columns into its subqueries. The result is the same; child rows that cannot join to a parent that matters are filtered out early.
top_level_aggregate_table_name
topLevelAggregateTableName: aggregate:<queryID>.