Expand description
AST for the PG-dialect subset SPG accepts in v0.2.
Display is implemented so that for any AST a produced by crate::parser,
re-parsing format!("{a}") yields a structurally equal AST. Binary and
unary operators always emit parentheses to remove any precedence
ambiguity — round-trip safety wins over prettiness.
Structs§
- Alter
Index Statement - Alter
Table Statement - v6.7.2 —
ALTER TABLE t SET <setting> = <value>. v6.7.2 ships the singlehot_tier_bytessetting; later v6.7.x sub-versions can add more SET subjects without changing the dispatch shape. - Column
Def - Column
Name - Create
Index Statement - Create
Publication Statement - v6.1.2 —
CREATE PUBLICATIONAST node. Thescopefield uses thePublicationScopeshape. v6.1.2 only acceptedAllTables; v6.1.3 unlocks theForTables/AllTablesExceptvariants by flipping the parser gate (no AST migration). - Create
Subscription Statement - v6.1.4 —
CREATE SUBSCRIPTIONAST node. v6.1.4 ships a single fixed-shape DDL; the WITH-clause options PG supports (enabled,slot_name,streaming,binary) are out of scope for v6.1.4 —enableddefaults to true and there are no other knobs to set in v6.1.x. - Create
Table Statement - Create
User Statement - Cte
- Delete
Statement DELETE FROM <table> [WHERE cond]. v4.4 — removes matched rows from the active catalog and prunes them from every index.- Explain
Statement - Foreign
KeyConstraint - v7.6.0 — A single FOREIGN KEY constraint. Both column-level
REFERENCESand table-levelFOREIGN KEY (...) REFERENCES ...parse into this shape — the column-level form has a single-entrycolumns/parent_columns. - From
Clause - FROM clause shape. v1.10 accepts a primary table plus a flat list of
joined peers —
FROM a [, b]* [INNER|LEFT] JOIN c ON expr .... The joins evaluate left-associatively in nested-loop order. - From
Join - Insert
Statement - OnConflict
Clause - v7.9.7 — INSERT upsert clause:
ON CONFLICT (target) DO action. - OrderBy
- Select
Statement - Table
Ref - Update
Statement UPDATE <table> SET col = expr [, ...] [WHERE cond]. v4.4 — the engine evaluatesexprper matched row in the table’s row order and rewrites cells in place. Indexed columns are dropped + re- inserted into the affected B-tree on each row change.- Window
Frame - v4.20 explicit window frame:
ROWS|RANGE BETWEEN <bound> AND <bound>.endisNonefor the shorthand “ROWS” where end implicitly = CURRENT ROW.
Enums§
- Alter
Index Target - Alter
Table Target - BinOp
- Cast
Target - Column
Type Name - SQL-level type names. The mapping to the storage runtime’s
DataTypehappens inspg-engine— keepingspg-sqlfree of storage deps. - Expr
- Extract
Field - FkAction
- v7.6.0 — Referential action for
ON DELETE/ON UPDATE. - Frame
Bound - Frame
Kind - Index
Method - Join
Kind - Limit
Expr - v7.9.24 — LIMIT / OFFSET value. Integer literal at parse
time or a placeholder
$Nresolved during extended-query Bind. mailrs migration follow-up H2. - Literal
- Null
Treatment - v6.4.2 — null treatment on
LAG/LEAD/FIRST_VALUE/LAST_VALUE. PG / ANSI default isRespect— NULLs participate in the offset walk.Ignorecauses the function to skip NULL values in the argument expression, returning the next non-NULL. - OnConflict
Action - v7.9.7 — action on conflict.
- Publication
Scope - v6.1.2 — Which tables a publication covers. v6.1.3 (this commit)
flips the parser gate for the
ForTables/AllTablesExceptvariants — the on-disk shape, snapshot serialisation, and the AST round-trip Display path were already in place in v6.1.2 so this is a parser-only widening. - Select
Item - Statement
- Table
Constraint - v7.9.18 — table-level constraint at the end of a CREATE TABLE column list. Either a composite PRIMARY KEY or a UNIQUE (single- or multi-column).
- UnOp
- Union
Kind - VecEncoding
- In-cell encoding for a
VECTOR(N)column. v6.0.1 added the optionalUSING <encoding>clause; omitting it keeps the pre-v6F32default.Sq8quantises each cell to a per-vector affine(min, max, [u8; dim])triple (4× compression).F16(v6.0.3, DDL keywordHALF) stores each element as IEEE-754 binary16 (2× compression, ~3 decimal digits of precision).