Expand description
SQL abstract syntax tree.
Modules§
- Transformation of an owned AST.
- Provides a publicly available interface to transform our SQL ASTs.
- Traversal of an immutable AST.
- Traversal of a mutable AST.
Structs§
ALTER CLUSTER .. SET ...
- An option in an
ALTER CONNECTION...
statement. ALTER CONNECTION
ALTER DEFAULT PRIVILEGES ...
ALTER INDEX ... {RESET, SET}
- AN
ALTER NETWORK POLICY
statement. ALTER <OBJECT> ... RENAME TO
ALTER <OBJECT> SWAP ...
ALTER <OBJECT> ... OWNER TO
ALTER <OBJECT> ... [RE]SET (RETAIN HISTORY [FOR ...])
ALTER ROLE
ALTER SECRET ... AS
ALTER SET CLUSTER
- An option in an
ALTER SOURCE...ADD SUBSOURCE
statement. ALTER SYSTEM RESET ALL
ALTER SYSTEM RESET ...
ALTER SYSTEM SET ...
ALTER TABLE ... ADD COLUMN ...
- SQL assignment
foo = expr
as used in SQLUpdate CLOSE ...
- An option in a
ALTER CLUSTER... WITH
statement. - An option in a
CREATE CLUSTER
statement. - SQL column definition
- An optionally-named
ColumnOption
:[ CONSTRAINT <name> ] <column-option>
. COMMENT ON ...
COMMIT [ TRANSACTION | WORK ] [ AND [ NO ] CHAIN ]
- An option in a
CREATE CONNECTION
. - A visitor that determines if a node is constant (does not contain references to external objects).
COPY
CREATE CLUSTER REPLICA ..
CREATE CLUSTER ..
- An option in a
CREATE CONNECTION...
statement. CREATE CONNECTION
refactor WIPCREATE CONTINUAL TASK
CREATE DATABASE
CREATE INDEX
CREATE MATERIALIZED VIEW
- A
CREATE NETWORK POLICY
statement. - A
CREATE ROLE
statement. CREATE SCHEMA
- A
CREATE SECRET
statement. CREATE SINK
- An option in a
CREATE SOURCE...
statement. CREATE SOURCE
CREATE SUBSOURCE
CREATE TABLE .. FROM SOURCE
CREATE TABLE
CREATE TYPE ..
CREATE VIEW
BODY [AS ...] [BYTES]
CHECK ( ... )
CHECK ( WITH ( ... ) )
HEADER [AS ...] [BYTES]
INCLUDE [HEADER | HEADERS]
INCLUDE HEADER <name> [AS <alias>] [BYTES]
SECRET ... [AS ...] [BYTES]
CREATE (SOURCE | TABLE) <name> FROM WEBHOOK
- An option in a
{FROM|INTO} CONNECTION ...
statement. - 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. - A column definition in a
CteMutRec
. DEALLOCATE ...
DECLARE ...
DELETE
DROP
DROP OWNED BY ...
EXECUTE ...
- A selected external reference in a FOR TABLES (..) statement
FETCH ...
- A function call
GRANT ...
GRANT ...
- An identifier.
INSERT
INSPECT SHARD <id>
- An intermediate value for Intervals, which tracks all data from the user, as well as the computed ParsedDateTime.
- An option in a
CREATE CONNECTION...SSH
. - An option in a
{FROM|INTO} CONNECTION ...
statement. - A reference to an operator.
- SQL ORDER BY expression
- An option in a
{FROM|INTO} CONNECTION ...
statement. PREPARE ...
- The most complete variant of a
SELECT
query expression, optionally includingWITH
,UNION
/ other set operations, andORDER BY
. RAISE ...
REASSIGN OWNED ...
- An option in a
CREATE CLUSTER REPLICA
statement. RESET <variable>
REVOKE ...
REVOKE ...
ROLLBACK [ TRANSACTION | WORK ] [ AND [ NO ] CHAIN ]
- 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
. SELECT
SET TRANSACTION ...
SET <variable>
SHOW COLUMNS
SHOW CREATE INDEX <index>
SHOW CREATE MATERIALIZED VIEW <name>
SHOW CREATE SINK <sink>
SHOW CREATE SOURCE <source>
SHOW CREATE TABLE <table>
SHOW CREATE VIEW <view>
SHOW <object>S
SHOW <variable>
{ BEGIN [ TRANSACTION | WORK ] | START TRANSACTION } ...
SUBSCRIBE
- A name of a database
- A name of a table, view, custom type, etc. that lives in a schema, possibly multi-part, i.e. db.schema.obj
- A name of a schema
UPDATE
VALIDATE CONNECTION
- Specifies the data processed by a window function, e.g.
RANGE UNBOUNDED PRECEDING
orROWS BETWEEN 5 PRECEDING AND CURRENT ROW
. - A window specification (i.e.
OVER (PARTITION BY .. ORDER BY .. etc.)
) Includes potential IGNORE NULLS or RESPECT NULLS from before the OVER clause.
Enums§
ALTER ROLE ... [ WITH | SET ] ...
ColumnOption
s are modifiers that follow a column definition in aCREATE TABLE
statement.- An option in a
CREATE SINK
statement. - An option in a
CREATE SUBSOURCE
statement. CREATE TYPE .. AS <TYPE>
- A block of common table expressions (CTEs).
- Specifies what Statement::ExplainPlan is actually explained.
- What is being explained. The bools mean whether this is an EXPLAIN BROKEN.
- An SQL expression of any type.
- Specifies which set of external references to generate a source export for in a
CREATE SOURCE
statement. - Arguments for a function call.
- An option in a
CREATE CLUSTER
statement. - A key constraint, specified in a
CREATE SOURCE
. - An enum of named plans that identifies specific stages in an optimizer trace where these plans can be found.
- SQL data types
- Attributes that can be attached to roles.
- 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 ...]
ALTER ROLE role_name [SET | RESET] ...
- A top-level statement (SELECT, INSERT, CREATE, etc.)
- A table-level constraint, specified in a
CREATE TABLE
or anALTER TABLE ADD <constraint>
statement. - A table name or a parenthesized subquery with an optional alias
CREATE TABLE .. FROM SOURCE
columns specification can have 3 states: Before purification they can beNotSpecified
orNamed
by the user to specify the column names to use. After purification they can be in any of the 3 states. For some source types we define the columns during purification and for others the columns are defined during planning based on the encoding option of the source.- Primitive SQL values.
Traits§
- This represents the metadata that lives next to an AST, as we take it through various stages in the planning process.
Functions§
- A static str for each statement kind