Expand description
The arena-backed abstract syntax tree.
Invariant: a node is an index into an arena, never a box, so an adversarial
nesting depth costs one vector push per node and a walker can be iterative.
Every node carries the span it was parsed from, and no node has been
normalised: NOT IN, IS NOT DISTINCT FROM and an implicit alias are all
distinct nodes rather than reconstructions, because a diagnostic that has to
guess what the user wrote points at the wrong place.
Identifiers are interned once per parse. The interned form keeps the
original spelling and an ASCII-folded lookup key, because SQL name
resolution is case-insensitive while sqlite_schema records the spelling
the user chose.
Structs§
- Ast
- The arena every node of one parse lives in.
- Column
Def - One column of a
CREATE TABLE. - Common
Table Expr - A common table expression.
- Delete
- A
DELETEstatement. - ExprId
- An expression node.
- Foreign
KeyClause - A foreign-key clause, on a column or on a table.
- From
Term - One term of a FROM clause, with the join that attached it.
- From
Term Id - A FROM term.
- Indexed
Column - One indexed column of a table constraint or an index.
- Insert
- An
INSERTstatement. - Name
- An interned identifier: what was written and what it matches.
- NameId
- An identifier, interned per parse.
- Order
Term - One term of an
ORDER BY. - Result
Column - One result column of a SELECT.
- Select
- A complete SELECT: a
WITHprefix, compound arms, and the tail clauses. - Select
Core - One arm of a compound SELECT.
- Select
Core Id - One arm of a compound SELECT.
- Select
Id - A compound SELECT.
- Update
- An
UPDATEstatement. - Upsert
- An
UPSERTclause. - Window
- A window definition, named or inline.
- Window
Id - A window definition.
- With
- A
WITHprefix.
Enums§
- Alter
Action - What an
ALTER TABLEdoes. - Binary
Op - A binary operator.
- Column
Constraint - A column constraint, in written order.
- Compound
Op - A compound operator.
- Conflict
Action - A conflict-resolution algorithm.
- Create
Table Body - The body of a
CREATE TABLE. - Expr
- An expression, in the shape it was written.
- Foreign
KeyAction - One
ON DELETE,ON UPDATEorMATCHclause. - Frame
Bound - One end of a window frame.
- Frame
Exclude - A frame’s
EXCLUDEclause. - Frame
Unit - A window frame’s unit.
- From
Source - How a FROM term names its rows.
- InRhs
- The right-hand side of
IN. - Index
Hint - An
INDEXED BYhint. - Insert
Source - What an INSERT inserts.
- Join
Constraint - The
ONorUSINGconstraint of a join. - Join
Kind - Which join was written.
- Limited
- Which of the two words a limited
DELETEorUPDATEwas written with. - Literal
- A literal value, kept as the bytes it was written as.
- Null
Order - Where NULLs sort, when written explicitly.
- Object
Kind - Which kind of object a
DROPnames. - Pattern
Op - Which pattern operator was written.
- Pragma
Value - A
PRAGMAargument. - Raise
Action - A
RAISE()action inside a trigger body. - Referential
Action - What a referential action does.
- Select
Body - The rows of one arm of a compound SELECT.
- Sort
Order - Ascending or descending.
- Statement
- A parsed statement.
- Table
Constraint - A table-level constraint.
- Transaction
Behaviour - The behaviour of a
BEGIN. - Trigger
Event - What a trigger fires on.
- Trigger
Time - When a trigger fires.
- UnaryOp
- A unary operator.