Expand description
SQL Abstract Syntax Tree (AST) types
Structs
Represents an Array Expression, either
ARRAY[..]
, or [..]
SQL assignment
foo = expr
as used in SQLUpdateSQL column definition
An optionally-named
ColumnOption
: [ CONSTRAINT <name> ] <column-option>
.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.A function call
An identifier, decomposed into its value or character data and the quote style.
A hive LATERAL VIEW with potential column aliases
A
LISTAGG
invocation LISTAGG( [ DISTINCT ] <expr>[, <separator> ] [ON OVERFLOW <on_overflow>] ) ) [ WITHIN GROUP (ORDER BY <within_group1>[, ...] ) ]
A name of a table, view, custom type, etc., possibly multi-part, i.e. db.schema.obj
An
ORDER BY
expressionThe most complete variant of a
SELECT
query expression, optionally
including WITH
, UNION
/ other set operations, and ORDER BY
.A restricted variant of
SELECT
(without CTEs/ORDER BY
), which may
appear either as the only body item of a Query
, or as an operand
to a set operation like UNION
.Specifies the data processed by a window function, e.g.
RANGE UNBOUNDED PRECEDING
or ROWS BETWEEN 5 PRECEDING AND CURRENT ROW
.A window specification (i.e.
OVER (PARTITION BY .. ORDER BY .. etc.)
)Enums
A privilege on a database object (table, sequence, etc.).
An
ALTER COLUMN
(Statement::AlterTable
) operationAn
ALTER TABLE
(Statement::AlterTable
) operationBinary operators
ColumnOption
s are modifiers that follow a column definition in a CREATE TABLE
statement.A
CSV
option in COPY
statement before PostgreSQL version 9.0.An option in
COPY
statement before PostgreSQL version 9.0.An option in
COPY
statement.SQL data types
An SQL expression of any type.
Specific direction for FETCH statement
External table’s available file format
Objects on which privileges are granted in a GRANT statement.
JsonOperator
The
ON OVERFLOW
clause of a LISTAGG invocationStores the keyword after
OFFSET <number>
Privileges granted in a GRANT statement or revoked in a REVOKE statement.
<referential_action> = { RESTRICT | CASCADE | SET NULL | NO ACTION | SET DEFAULT }
Schema possible naming variants (1).
One item of the comma-separated list following
SELECT
A node in a tree, representing a “query body” expression, roughly:
SELECT ... [ {UNION|EXCEPT|INTERSECT} SELECT ...]
Sqlite specific syntax
A top-level statement (SELECT, INSERT, CREATE, etc.)
A table-level constraint, specified in a
CREATE TABLE
or an
ALTER TABLE ADD <constraint>
statement.A table name or a parenthesized subquery with an optional alias
Timestamp and Time data types information about TimeZone formatting.
Unary operators
Primitive SQL values such as number and string