pub struct Cte {
pub name: String,
pub body: CteBody,
pub recursive: bool,
pub column_overrides: Vec<String>,
pub search: Option<SearchClause>,
pub cycle: Option<CycleClause>,
}Fields§
§name: String§body: CteBodyv7.37.43-T4.4 — body is either a SELECT (read-only CTE, the classical case) or a data-modifying statement (INSERT / UPDATE / DELETE … RETURNING …) per PG writable CTE semantics. The modifying body’s RETURNING projection becomes the materialised CTE table the outer query can reference; the modifying statement runs once before the outer query, within the same transaction.
recursive: boolv4.22: WITH RECURSIVE — set when the WITH clause had the
RECURSIVE keyword. Applies to every CTE in the clause per
PG semantics. A non-recursive body in a RECURSIVE WITH is
allowed; the engine just runs it once.
column_overrides: Vec<String>v4.22: optional WITH name(a, b, c) column-name list. When
non-empty, these override the body’s output column names
position-by-position; the engine errors out if the count
doesn’t match the body’s projection width.
search: Option<SearchClause>v7.38 (read01 U16) — SEARCH { DEPTH | BREADTH } FIRST BY cols SET seqcol on a recursive CTE. Desugared at parse time into an
extra ordering column on the body (see rewrite_search_and_cycle).
cycle: Option<CycleClause>v7.38 (read01 U16) — CYCLE cols SET markcol [TO v DEFAULT w] USING pathcol cycle detection, desugared at parse time.