pub struct ViewDef {
pub name: String,
pub columns: Vec<String>,
pub body: String,
pub check_option: u8,
}Expand description
v7.17.0 Phase 1.2 — catalogued VIEW. The body is stored as the
raw source text the parser saw between AS and the statement
terminator; the engine re-parses on each invocation. Same
pattern as FunctionDef — keeps spg-storage free of
spg-sql dependency.
Fields§
§name: String§columns: Vec<String>Optional (col, col, …) rename list. Empty when the body’s
projected names are used directly.
body: StringRaw SELECT source. Display-rendered at storage time so the catalog round-trips a deterministic form regardless of whitespace / comments in the original input. Re-parsed at SELECT-from-view time to materialise as a synthetic CTE.
check_option: u8v7.39 (round 132) — WITH CHECK OPTION: 0 = none, 1 = LOCAL,
2 = CASCADED. A storage-local u8 (no dependency on the SQL AST).
Persisted from FILE_VERSION 69; older catalogs read back as 0.