Module sqlparser::ast[][src]

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

HiveFormat
Ident

An identifier, decomposed into its value or character data and the quote style.

Join
LateralView

A hive LATERAL VIEW with potential column aliases

ListAgg

A LISTAGG invocation LISTAGG( [ DISTINCT ] <expr>[, <separator> ] [ON OVERFLOW <on_overflow>] ) ) [ WITHIN GROUP (ORDER BY <within_group1>[, ...] ) ]

ObjectName

A name of a table, view, custom type, etc., possibly multi-part, i.e. db.schema.obj

Offset
OrderByExpr

An 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
Top
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.))

With

Enums

AddDropSync
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

FunctionArg
HiveDistributionStyle
HiveIOFormat
HiveRowFormat
JoinConstraint
JoinOperator
ListAggOnOverflow

The ON OVERFLOW clause of a LISTAGG invocation

ObjectType
OffsetRows

Stores the keyword after OFFSET <number>

ReferentialAction

<referential_action> = { RESTRICT | CASCADE | SET NULL | NO ACTION | SET DEFAULT }

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
SetVariableValue
ShowStatementFilter
SqliteOnConflict

Sqlite specific syntax

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

TransactionAccessMode
TransactionIsolationLevel
TransactionMode
UnaryOperator

Unary operators

Value

Primitive SQL values such as number and string

WindowFrameBound

Specifies WindowFrame’s start_bound and end_bound

WindowFrameUnits