pub struct CteBinding {
pub folded: Vec<u8>,
pub name: Vec<u8>,
pub columns: Vec<Vec<u8>>,
pub select: SelectId,
pub recursive: bool,
pub materialized: Option<bool>,
pub level: usize,
}Expand description
One common table expression visible to a block.
The definition is kept as an AST id rather than a bound block because two references to the same CTE are two independent scans: each gets its own FROM-term numbers and its own materialisation. Binding once and cloning would give both references the same source ids, and the second scan would then read the first one’s cursors.
Fields§
§folded: Vec<u8>The folded name a FROM term matches against.
name: Vec<u8>The name as written, which the expansion is aliased to.
columns: Vec<Vec<u8>>The explicit column list, when the WITH wrote one.
select: SelectIdThe query the name stands for.
recursive: boolWhether the WITH said RECURSIVE.
materialized: Option<bool>Some(true) for MATERIALIZED, Some(false) for NOT MATERIALIZED.
level: usizeThe position of the WITH that defined it in the stack of WITH
levels, which is how far down the body of the definition may look.