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
- Hive
Format - Ident
- An identifier, decomposed into its value or character data and the quote style.
- Join
- Lateral
View - A hive LATERAL VIEW with potential column aliases
- ListAgg
- A
LISTAGG
invocationLISTAGG( [ DISTINCT ] <expr>[, <separator> ] [ON OVERFLOW <on_overflow>] ) ) [ WITHIN GROUP (ORDER BY <within_group1>[, ...] ) ]
- Object
Name - A name of a table, view, custom type, etc., possibly multi-part, i.e. db.schema.obj
- Offset
- Order
ByExpr - An
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 - Top
- 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.)
) - With
Enums§
- Action
- A privilege on a database object (table, sequence, etc.).
- AddDrop
Sync - Alter
Column Operation - An
ALTER COLUMN
(Statement::AlterTable
) operation - 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.- Comment
Object - Data
Type - SQL data types
- Date
Time Field - Expr
- An SQL expression of any type.
- File
Format - External table’s available file format
- Function
Arg - Function
ArgExpr - Grant
Objects - Objects on which privileges are granted in a GRANT statement.
- Hive
Distribution Style - HiveIO
Format - Hive
RowFormat - Join
Constraint - Join
Operator - List
AggOn Overflow - The
ON OVERFLOW
clause of a LISTAGG invocation - Lock
Type - Object
Type - Offset
Rows - Stores the keyword after
OFFSET <number>
- OnInsert
- Privileges
- Privileges granted in a GRANT statement or revoked in a REVOKE statement.
- Referential
Action <referential_action> = { RESTRICT | CASCADE | SET NULL | NO ACTION | SET DEFAULT }
- 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
- SetVariable
Value - Show
Create Object - Show
Statement Filter - Sqlite
OnConflict - Sqlite specific syntax
- 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
- Transaction
Access Mode - Transaction
Isolation Level - Transaction
Mode - Trim
Where Field - 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