Module ast

Source
Expand description

SQL Abstract Syntax Tree (AST) types

Structs§

Assignment
SQL assignment foo = expr as used in SQLUpdate
ColumnDef
SQL column definition
ColumnOptionDef
An optionally-named ColumnOption: [ CONSTRAINT <name> ] <column-option>.
Cte
A single CTE (used after WITH): alias [(col1, col2, ...)] AS ( query ) The names in the column list before AS, when specified, replace the names of the columns returned by the query. The parser does not validate that the number of columns in the query matches the number of columns in the query.
Fetch
Function
A function call
Ident
An identifier, decomposed into its value or character data and the quote style.
Join
ObjectName
A name of a table, view, custom type, etc., possibly multi-part, i.e. db.schema.obj
OrderByExpr
SQL ORDER BY expression
Query
The most complete variant of a SELECT query expression, optionally including WITH, UNION / other set operations, and ORDER BY.
Select
A restricted variant of SELECT (without CTEs/ORDER BY), which may appear either as the only body item of an SQLQuery, or as an operand to a set operation like UNION.
SqlOption
TableAlias
TableWithJoins
Values
WindowFrame
Specifies the data processed by a window function, e.g. RANGE UNBOUNDED PRECEDING or ROWS BETWEEN 5 PRECEDING AND CURRENT ROW.
WindowSpec
A window specification (i.e. OVER (PARTITION BY .. ORDER BY .. etc.))

Enums§

AlterTableOperation
An ALTER TABLE (Statement::AlterTable) operation
BinaryOperator
Binary operators
ColumnOption
ColumnOptions are modifiers that follow a column definition in a CREATE TABLE statement.
DataType
SQL data types
DateTimeField
Expr
An SQL expression of any type.
FileFormat
External table’s available file format
JoinConstraint
JoinOperator
ObjectType
SelectItem
One item of the comma-separated list following SELECT
SetExpr
A node in a tree, representing a “query body” expression, roughly: SELECT ... [ {UNION|EXCEPT|INTERSECT} SELECT ...]
SetOperator
Statement
A top-level statement (SELECT, INSERT, CREATE, etc.)
TableConstraint
A table-level constraint, specified in a CREATE TABLE or an ALTER TABLE ADD <constraint> statement.
TableFactor
A table name or a parenthesized subquery with an optional alias
UnaryOperator
Unary operators
Value
Primitive SQL values such as number and string
WindowFrameBound
Specifies WindowFrame’s start_bound and end_bound
WindowFrameUnits