Expand description
SQL Abstract Syntax Tree (AST) types
Structs§
- Assignment
- SQL assignment
foo = expr
as used in SQLUpdate - Column
Def - SQL column definition
- Column
Option Def - 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 beforeAS
, 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
- Object
Name - A name of a table, view, custom type, etc., possibly multi-part, i.e. db.schema.obj
- Order
ByExpr - SQL ORDER BY expression
- Query
- The most complete variant of a
SELECT
query expression, optionally includingWITH
,UNION
/ other set operations, andORDER BY
. - Select
- A restricted variant of
SELECT
(without CTEs/ORDER BY
), which may appear either as the only body item of anSQLQuery
, or as an operand to a set operation likeUNION
. - SqlOption
- Table
Alias - Table
With Joins - Values
- Window
Frame - Specifies the data processed by a window function, e.g.
RANGE UNBOUNDED PRECEDING
orROWS BETWEEN 5 PRECEDING AND CURRENT ROW
. - Window
Spec - A window specification (i.e.
OVER (PARTITION BY .. ORDER BY .. etc.)
)
Enums§
- Alter
Table Operation - An
ALTER TABLE
(Statement::AlterTable
) operation - Binary
Operator - Binary operators
- Column
Option ColumnOption
s are modifiers that follow a column definition in aCREATE TABLE
statement.- Data
Type - SQL data types
- Date
Time Field - Expr
- An SQL expression of any type.
- File
Format - External table’s available file format
- Join
Constraint - Join
Operator - Object
Type - Select
Item - 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.)
- Table
Constraint - A table-level constraint, specified in a
CREATE TABLE
or anALTER TABLE ADD <constraint>
statement. - Table
Factor - A table name or a parenthesized subquery with an optional alias
- Unary
Operator - Unary operators
- Value
- Primitive SQL values such as number and string
- Window
Frame Bound - Specifies WindowFrame’s
start_bound
andend_bound
- Window
Frame Units