sqlparser::ast - Rust

Expand description

SQL Abstract Syntax Tree (AST) types

pub use table_constraints::CheckConstraint;
pub use table_constraints::ForeignKeyConstraint;
pub use table_constraints::FullTextOrSpatialConstraint;
pub use table_constraints::IndexConstraint;
pub use table_constraints::PrimaryKeyConstraint;
pub use table_constraints::TableConstraint;
pub use table_constraints::UniqueConstraint;
comments
Provides a representation of source code comments in parsed SQL code.
helpers
Helper modules for building and manipulating AST nodes.
table_constraints
SQL Abstract Syntax Tree (AST) types for table constraints
AlterOperator
ALTER OPERATOR statement See https://www.postgresql.org/docs/current/sql-alteroperator.html
AlterOperatorClass
ALTER OPERATOR CLASS statement See https://www.postgresql.org/docs/current/sql-alteropclass.html
AlterOperatorFamily
ALTER OPERATOR FAMILY statement See https://www.postgresql.org/docs/current/sql-alteropfamily.html
AlterPolicy
ALTER POLICY statement.
AlterSchema
An ALTER SCHEMA (Statement::AlterSchema) statement.
AlterTable
ALTER TABLE statement
AlterType
An ALTER TYPE statement (Statement::AlterType)
AlterTypeAddValue
See AlterTypeOperation::AddValue
AlterTypeRename
See AlterTypeOperation::Rename
AlterTypeRenameValue
See AlterTypeOperation::RenameValue
AlterUser
Modifies the properties of a user
AlterUserAddMfaMethodOtp
AlterUserAddRoleDelegation
AlterUserModifyMfaMethod
AlterUserPassword
AlterUserRemoveRoleDelegation
AlterUserSetPolicy
Analyze
ANALYZE statement
Array
Represents an Array Expression, either ARRAY[..], or [..]
Assignment
SQL assignment foo = expr as used in SQLUpdate
BeginEndStatements
Represents a list of statements enclosed within BEGIN and END keywords. Example:
CaseStatement
A CASE statement.
CaseWhen
A WHEN clause in a CASE expression containing both the condition and its corresponding result
ClusteredBy
Hive supports CLUSTERED BY statement in CREATE TABLE. Syntax: CLUSTERED BY (col_name, ...) [SORTED BY (col_name [ASC|DESC], ...)] INTO num_buckets BUCKETS
ClusteredIndex
A clustered index column specification.
ColumnDef
SQL column definition
ColumnOptionDef
An optionally-named ColumnOption: [ CONSTRAINT <name> ] <column-option>.
ColumnPolicyProperty
Properties describing a column policy (masking or projection).
ConditionalStatementBlock
A block within a Statement::Case or Statement::If or Statement::While-like statement
ConstraintCharacteristics
<constraint_characteristics> = [ DEFERRABLE | NOT DEFERRABLE ] [ INITIALLY DEFERRED | INITIALLY IMMEDIATE ] [ ENFORCED | NOT ENFORCED ]
ContactEntry
Snowflake WITH CONTACT ( purpose = contact [ , purpose = contact ...] )
CreateConnector
CreateDomain
CreateExtension
CREATE EXTENSION statement Note: this is a PostgreSQL-specific statement
CreateFunction
CREATE FUNCTION statement
CreateIndex
CREATE INDEX statement.
CreateOperator
CREATE OPERATOR statement See https://www.postgresql.org/docs/current/sql-createoperator.html
CreateOperatorClass
CREATE OPERATOR CLASS statement See https://www.postgresql.org/docs/current/sql-createopclass.html
CreateOperatorFamily
CREATE OPERATOR FAMILY statement See https://www.postgresql.org/docs/current/sql-createopfamily.html
CreatePolicy
CREATE POLICY statement.
CreateRole
CREATE ROLE statement See PostgreSQL
CreateServerOption
A key/value option for CREATE SERVER.
CreateServerStatement
A CREATE SERVER statement.
CreateTable
CREATE TABLE statement.
CreateTableLike
Represents the LIKE clause of a CREATE TABLE statement.
CreateTrigger
CREATE TRIGGER
CreateUser
Creates a user
CreateView
CREATE VIEW statement.
CreateViewParams
MySQL CREATE VIEW additional parameters
Cte
A single CTE (used after WITH): <alias> [(col1, col2, ...)] AS <materialized> ( <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.
Declare
A DECLARE statement. PostgreSQL Snowflake BigQuery
Delete
DELETE statement.
DenyStatement
A DENY statement
DictionaryField
A dictionary field within a dictionary.
DisplaySeparated
Helper used to format a slice using a separator string (e.g., ", ").
DoUpdate
Details for DO UPDATE action of an ON CONFLICT clause.
DollarQuotedString
A dollar-quoted string literal, e.g. $$...$$ or $tag$...$tag$.
DropDomain
A Drop Domain statement
DropExtension
DROP EXTENSION statement Note: this is a PostgreSQL-specific statement
DropFunction
DROP FUNCTION statement
DropOperator
DROP OPERATOR statement See https://www.postgresql.org/docs/current/sql-dropoperator.html
DropOperatorClass
DROP OPERATOR CLASS statement See https://www.postgresql.org/docs/current/sql-dropopclass.html
DropOperatorFamily
DROP OPERATOR FAMILY statement See https://www.postgresql.org/docs/current/sql-dropopfamily.html
DropOperatorSignature
Operator signature for a DROP OPERATOR statement
DropPolicy
DROP POLICY statement.
DropTrigger
DROP TRIGGER
ExceptSelectItem
Bigquery EXCEPT information, with at least one column.
ExceptionWhen
A representation of a WHEN arm with all the identifiers catched and the statements to execute for the arm.
ExportData
Represents an EXPORT DATA statement.
ExprWithAlias
An expression optionally followed by an alias.
ExprWithAliasAndOrderBy
An expression optionally followed by an alias and order by options.
Fetch
FETCH clause options.
FileSize
Function
A function call
FunctionArgumentList
This represents everything inside the parentheses when calling a function.
FunctionDefinitionSetParam
A SET configuration_parameter clause in a CREATE FUNCTION statement.
FunctionDesc
Generic function description for DROP FUNCTION and CREATE TRIGGER.
Grant
GRANT privileges ON objects TO grantees
Grantee
The principal that receives the privileges
HavingBound
The HAVING clause in a call to ANY_VALUE on BigQuery.
HiveFormat
Hive table format and storage-related options.
HiveLoadDataFormat
Format specification for LOAD DATA Hive operations.
HiveRowDelimiter
A single row delimiter specification for Hive ROW FORMAT.
HiveSetLocation
Hive-specific SET LOCATION helper used in some LOAD DATA statements.
Ident
An identifier, decomposed into its value or character data and the quote style.
IdentWithAlias
Single aliased identifier
IdentityParameters
Parameters specifying seed and increment for identity columns.
IdentityProperty
Properties for the IDENTITY / AUTOINCREMENT column option.
IfStatement
An IF statement.
IlikeSelectItem
Snowflake ILIKE information.
IndexColumn
Index column type.
InputFormatClause
FORMAT identifier in input context, specific to ClickHouse.
Insert
INSERT statement.
InsertAliases
Optional aliases for INSERT targets: row alias and optional column aliases.
Interpolate
INTERPOLATE clause used with ClickHouse WITH FILL to compute missing values.
InterpolateExpr
ClickHouse INTERPOLATE clause for use in ORDER BY clause when using WITH FILL modifier. Supported by ClickHouse syntax
Interval
Represents an INTERVAL expression, roughly in the following format: INTERVAL '<value>' [ <leading_field> [ (<leading_precision>) ] ] [ TO <last_field> [ (<fractional_seconds_precision>) ] ], e.g. INTERVAL '123:45.67' MINUTE(3) TO SECOND(2).
Join
A single JOIN clause including relation and join operator/options.
JsonPath
A JSON path.
JsonReturningClause
PostgreSQL JSON function RETURNING clause
JsonTableNamedColumn
A single column definition in MySQL’s JSON_TABLE table valued function.
JsonTableNestedColumn
A nested column in a JSON_TABLE column list
LambdaFunction
A lambda function.
LateralView
A hive LATERAL VIEW with potential column aliases
LockClause
FOR ... locking clause.
LockTable
Represents a LOCK TABLE clause with optional alias and lock type.
MacroArg
NAME = <EXPR> arguments for DuckDB macros
Map
Represents a Map expression.
MapEntry
A map field within a map.
Measure
An item in the MEASURES subclause of a MATCH_RECOGNIZE operation.
MemberOf
Checks membership of a value in a JSON array
Merge
A MERGE statement.
MergeClause
A WHEN clause within a MERGE Statement
MergeInsertExpr
The expression used to insert rows within a MERGE statement.
MergeUpdateExpr
The expression used to update rows within a MERGE statement.
Method
A method call
Msck
An MSCK statement.
NamedParenthesizedList
Key/Value, where the value is a (optionally named) list of identifiers
NamedWindowDefinition
A named window definition: <name> AS <window specification>
ObjectName
A name of a table, view, custom type, etc., possibly multi-part, i.e. db.schema.obj
ObjectNamePartFunction
An object name part that consists of a function that dynamically constructs identifiers.
Offset
OFFSET clause consisting of a value and a rows specifier.
OnConflict
ON CONFLICT clause representation.
OneOrManyWithParensIntoIter
Owned iterator implementation of OneOrManyWithParens
OpenJsonTableColumn
A single column definition in MSSQL’s OPENJSON WITH clause.
OpenStatement
Represents an OPEN statement.
OperateFunctionArg
Function argument in CREATE OR DROP FUNCTION.
OperatorArgTypes
Operator argument types for CREATE OPERATOR CLASS
OptimizerHint
Query optimizer hints are optionally supported comments after the SELECT, INSERT, UPDATE, REPLACE, MERGE, and DELETE keywords in the corresponding statements.
OrderBy
Represents an ORDER BY clause with its kind and optional INTERPOLATE.
OrderByExpr
An ORDER BY expression
OrderByOptions
Options for an ORDER BY expression (ASC/DESC and NULLS FIRST/LAST).
PrintStatement
PRINT statement for producing debug/output messages.
ProcedureParam
A parameter of a stored procedure or function declaration.
ProjectionSelect
Query syntax for ClickHouse ADD PROJECTION statement. Its syntax is similar to SELECT statement, but it is used to add a new projection to a table. Syntax is SELECT <COLUMN LIST EXPR> [GROUP BY] [ORDER BY]
Query
The most complete variant of a SELECT query expression, optionally including WITH, UNION / other set operations, and ORDER BY.
QuoteDelimitedString
A quote delimited string literal, e.g. Q'_abc_'.
RaiseStatement
A RAISE statement.
RenameTable
rename object definition
ReplaceSelectElement
Syntax
ReplaceSelectItem
Bigquery REPLACE information.
ResetStatement
Resets a session parameter to its default value.
ReturnStatement
Represents a Return statement.
Revoke
REVOKE privileges ON objects FROM grantees
RowAccessPolicy
Snowflake WITH ROW ACCESS POLICY policy_name ON (identifier, ...)
SecretOption
A key/value identifier pair used for secret or key-based options.
Select
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.
SelectInto
SELECT INTO clause options.
SelectModifiers
MySQL-specific SELECT modifiers that appear after the SELECT keyword.
SetAssignment
Assignment for a SET statement (name [=|TO] value)
SetSessionAuthorizationParam
Represents a SET SESSION AUTHORIZATION statement
SetSessionParamGeneric
Generic SET SESSION parameter represented as name(s) and value.
SetSessionParamIdentityInsert
IDENTITY_INSERT session parameter for a specific object.
SetSessionParamOffsets
Offsets-related session parameter with keywords and a value.
SetSessionParamStatistics
Statistics-related session parameter specifying topic and value.
Setting
A single setting key-value pair.
ShowCharset
A Show Charset statement
ShowObjects
Options for a SHOW OBJECTS statement.
ShowStatementIn
Represents a SHOW ... IN clause with optional parent qualifier and name.
ShowStatementOptions
Represents the different options available for SHOW statements to filter the results. Example from Snowflake: https://docs.snowflake.com/en/sql-reference/sql/show-tables
StructField
A field definition within a struct
SymbolDefinition
A symbol defined in a MATCH_RECOGNIZE operation.
Table
A TABLE command A (possibly schema-qualified) table reference used in FROM clauses.
TableAlias
An alias for a table reference, optionally including an explicit AS and column names.
TableAliasColumnDef
SQL column definition in a table expression alias. Most of the time, the data type is not specified. But some table-valued functions do require specifying the data type.
TableFunctionArgs
Arguments to a table-valued function
TableIndexHints
MySQL-style index hints attached to a table (e.g., USE INDEX(...)).
TableSample
Represents a TABLESAMPLE clause and its options.
TableSampleBucket
Bucket-based sampling clause: BUCKET <bucket> OUT OF <total> [ON <expr>].
TableSampleQuantity
Quantity for a TABLESAMPLE clause (e.g. 10 PERCENT or (10)).
TableSampleSeed
SEED or REPEATABLE clause used with sampling.
TableWithJoins
A left table followed by zero or more joins.
TablespaceOption
MySql TableSpace option https://dev.mysql.com/doc/refman/8.4/en/create-table.html
Tag
Snowflake WITH TAG ( tag_name = '<tag_value>', ...)
TagsColumnOption
Tags option of column Syntax
Top
MSSQL TOP clause options.
TriggerExecBody
This keyword immediately precedes the declaration of one or two relation names that provide access to the transition relations of the triggering statement
TriggerReferencing
This keyword immediately precedes the declaration of one or two relation names that provide access to the transition relations of the triggering statement
Truncate
A TRUNCATE statement.
TruncateTableTarget
Target of a TRUNCATE TABLE command
TypedString
A constant of form <data_type> 'value'. This can represent ANSI SQL DATE, TIME, and TIMESTAMP literals (such as DATE '2020-01-01'), as well as constants of other types (a non-standard PostgreSQL extension).
UnionField
A field definition within a union
UnloadPartitionBy
Specifies the partition keys for the unload operation
Update
UPDATE statement.
UserDefinedTypeCompositeAttributeDef
SQL user defined type attribute definition
UtilityOption
Represents a single PostgreSQL utility option.
VacuumStatement
Re-sorts rows and reclaims space in either a specified table or all tables in the current database
ValueWithSpan
Wraps a primitive SQL Value with its Span location
Values
An explicit VALUES clause and its rows.
ViewColumnDef
Column definition specified in a CREATE VIEW statement.
WhileStatement
A WHILE statement.
WildcardAdditionalOptions
Additional options for wildcards, e.g. Snowflake EXCLUDE/RENAME and Bigquery EXCEPT.
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 ([window_name] PARTITION BY .. ORDER BY .. etc.))
With
A WITH clause, introducing common table expressions (CTEs).
WithFill
ClickHouse WITH FILL modifier for ORDER BY clause. Supported by ClickHouse syntax
XmlNamespaceDefinition
Represents a single XML namespace definition in the XMLNAMESPACES clause.
XmlPassingArgument
Argument passed in the XMLTABLE PASSING clause Argument passed in the XMLTABLE PASSING clause.
XmlPassingClause
The PASSING clause for XMLTABLE The PASSING clause for XMLTABLE.
XmlTableColumn
A single column definition in XMLTABLE
AccessExpr
An element of a Expr::CompoundFieldAccess. It can be an expression or a subscript.
Action
A privilege on a database object (table, sequence, etc.).
ActionApplyType
See https://docs.snowflake.com/en/sql-reference/sql/grant-privilege under globalPrivileges in the APPLY privilege.
ActionCreateObjectType
See https://docs.snowflake.com/en/sql-reference/sql/grant-privilege under globalPrivileges in the CREATE privilege.
ActionExecuteObjectType
See https://docs.snowflake.com/en/sql-reference/sql/grant-privilege under globalPrivileges in the EXECUTE privilege.
ActionManageType
See https://docs.snowflake.com/en/sql-reference/sql/grant-privilege under globalPrivileges in the MANAGE privilege.
ActionModifyType
See https://docs.snowflake.com/en/sql-reference/sql/grant-privilege under globalPrivileges in the MODIFY privilege.
ActionMonitorType
See https://docs.snowflake.com/en/sql-reference/sql/grant-privilege under globalPrivileges in the MONITOR privilege.
AddDropSync
Indicates partition operation type for partition management statements.
AfterMatchSkip
The after match skip option in a MATCH_RECOGNIZE operation.
Alignment
Alignment specification for PostgreSQL user-defined base types.
AlterColumnOperation
An ALTER COLUMN (Statement::AlterTable) operation
AlterConnectorOwner
New connector owner specification for ALTER CONNECTOR ... OWNER TO ...
AlterIndexOperation
Alterations that can be applied to an index.
AlterOperatorClassOperation
An AlterOperatorClass operation
AlterOperatorFamilyOperation
An AlterOperatorFamily operation
AlterOperatorOperation
An AlterOperator operation
AlterPolicyOperation
An ALTER Policy (Statement::AlterPolicy) operation
AlterRoleOperation
An ALTER ROLE (Statement::AlterRole) operation
AlterSchemaOperation
An ALTER SCHEMA (Statement::AlterSchema) operation.
AlterTableAlgorithm
MySQL ALTER TABLE algorithm.
AlterTableLock
MySQL ALTER TABLE lock.
AlterTableOperation
An ALTER TABLE (Statement::AlterTable) operation
AlterTableType
Table type for ALTER TABLE statements. Used to distinguish between regular tables, Iceberg tables, and Dynamic tables.
AlterTypeAddValuePosition
See AlterTypeAddValue
AlterTypeOperation
An AlterType operation
AnalyzeFormat
Output formats supported for ANALYZE/EXPLAIN ANALYZE.
AnalyzeFormatKind
How the ANALYZE/EXPLAIN ANALYZE format is specified.
ArgMode
The mode of an argument in CREATE FUNCTION.
ArrayElemTypeDef
Represents the data type of the elements in an array (if any) as well as the syntax used to declare the array.
AssignmentTarget
Left-hand side of an assignment in an UPDATE statement, e.g. foo in foo = 5 (ColumnName assignment) or (a, b) in (a, b) = (1, 2) (Tuple assignment).
AttachDuckDBDatabaseOption
Options supported by DuckDB for ATTACH DATABASE.
BeginTransactionKind
Transaction started with [ TRANSACTION | WORK ]
BinaryLength
Information about binary length, including length and possibly unit.
BinaryOperator
Binary operators
CascadeOption
Cascade/restrict option for Postgres TRUNCATE table, MySQL GRANT/REVOKE, etc. [ CASCADE | RESTRICT ]
CastFormat
Options for CAST / TRY_CAST BigQuery: https://cloud.google.com/bigquery/docs/reference/standard-sql/format-elements#formatting_syntax
CastKind
The syntax used for in a cast expression.
CatalogSyncNamespaceMode
Snowflake CatalogSyncNamespaceMode
CeilFloorKind
The syntax used in a CEIL or FLOOR expression.
CharLengthUnits
Possible units for characters, initially based on 2016 ANSI SQL Standard.
CharacterLength
Information about character length, including length and possibly unit.
CloseCursor
Which cursor(s) to close.
ColumnOption
ColumnOptions are modifiers that follow a column definition in a CREATE TABLE statement.
ColumnOptions
Representation of how multiple ColumnOptions are grouped for a column.
ColumnPolicy
Column policy that identify a security policy of access to a column. Syntax
CommentDef
Helper to indicate if a comment includes the = in the display form
CommentObject
Objects that can be targeted by a COMMENT statement.
ConditionalStatements
A list of statements in a ConditionalStatementBlock. Statements used inside conditional blocks (IF, WHEN, WHILE).
ConflictTarget
Target specification for an ON CONFLICT clause.
ConnectByKind
Joins a table to itself to process hierarchical data in the table.
ConstraintReferenceMatchKind
MATCH type for constraint references
ContextModifier
Optional context modifier for statements that can be or LOCAL, GLOBAL, or SESSION.
CopyIntoSnowflakeKind
Variants of the Snowflake COPY INTO statement
CopyLegacyCsvOption
A CSV option in COPY statement before PostgreSQL version 9.0.
CopyLegacyOption
An option in COPY statement before PostgreSQL version 9.0.
CopyOption
An option in COPY statement.
CopySource
Source for the COPY command: a table or a query.
CopyTarget
Target for the COPY command: STDIN, STDOUT, a file, or a program.
CreateFunctionBody
Represent the expression body of a CREATE FUNCTION statement as well as where within the statement, the body shows up.
CreateFunctionUsing
USING clause options for CREATE FUNCTION (e.g., JAR, FILE, ARCHIVE).
CreatePolicyCommand
Command that a policy can apply to (FOR clause).
CreatePolicyType
Policy type for a CREATE POLICY statement.
CreateTableLikeDefaults
Controls whether defaults are included when creating a table FROM/LILE another.
CreateTableLikeKind
Specifies how to create a new table based on an existing table’s schema. ‘’’sql CREATE TABLE new LIKE old … ‘’’
CreateTableOptions
Sql options of a CREATE TABLE statement. Options allowed within a CREATE TABLE statement.
CreateViewAlgorithm
MySQL CREATE VIEW algorithm parameter: [ALGORITHM = {UNDEFINED | MERGE | TEMPTABLE}] MySQL CREATE VIEW algorithm options.
CreateViewSecurity
MySQL CREATE VIEW security parameter: [SQL SECURITY { DEFINER | INVOKER }] MySQL CREATE VIEW SQL SECURITY options.
CteAsMaterialized
Indicates whether a CTE is materialized or not.
CurrentGrantsKind
DataType
SQL data types
DateTimeField
Represents the date/time fields used by functions like EXTRACT.
DeclareAssignment
Represents an expression assignment within a variable DECLARE statement.
DeclareType
Represents the type of a DECLARE statement.
Deduplicate
DEDUPLICATE statement used in OPTIMIZE TABLE et al. such as in ClickHouse SQL ClickHouse
DeferrableInitial
Initial setting for deferrable constraints (INITIALLY IMMEDIATE or INITIALLY DEFERRED).
DescribeAlias
Aliases accepted for describe-style commands.
DiscardObject
Objects that can be discarded with DISCARD.
Distinct
ALL, DISTINCT, or DISTINCT ON (...) modifiers for SELECT lists.
DropBehavior
<drop behavior> ::= CASCADE | RESTRICT.
DropFunctionOption
Function describe in DROP FUNCTION.
DuplicateTreatment
How duplicate values are treated inside function argument lists.
EmptyMatchesMode
The mode for handling empty matches in a MATCH_RECOGNIZE operation.
EnumMember
A member of an ENUM type.
ExactNumberInfo
Additional information for NUMERIC, DECIMAL, and DEC data types following the 2016 SQL Standard.
ExcludeSelectItem
Snowflake EXCLUDE information.
Expr
An SQL expression of any type.
ExtractSyntax
EXTRACT syntax variants.
FetchDirection
Specific direction for FETCH statement
FetchPosition
The “position” for a FETCH statement.
FileFormat
External table’s available file format
FileSizeUnit
Units for FileSize (MB or GB).
FlushLocation
Location modifier for flush commands.
FlushType
Types of flush operations supported by FLUSH.
ForClause
FOR XML or FOR JSON clause (MSSQL): formats the output of a query as XML or JSON.
ForJson
Modes for FOR JSON clause.
ForValues
PostgreSQL partition bound specification for PARTITION OF.
ForXml
Modes for FOR XML clause.
FormatClause
FORMAT identifier or FORMAT NULL clause, specific to ClickHouse.
FromTable
A FROM clause within a DELETE statement.
FunctionArg
Forms of function arguments (named, expression-named, or positional).
FunctionArgExpr
Expression forms allowed as a function argument.
FunctionArgOperator
Operator used to separate function arguments
FunctionArgumentClause
Clauses that can appear inside a function argument list.
FunctionArguments
The arguments passed to a function call.
FunctionBehavior
These attributes inform the query optimizer about the behavior of the function.
FunctionCalledOnNull
These attributes describe the behavior of the function when called with a null argument.
FunctionDeterminismSpecifier
BigQuery Determinism specifier used in a UDF definition.
FunctionParallel
If it is safe for PostgreSQL to call the function from multiple threads at once
FunctionSecurity
Security attribute for functions: SECURITY DEFINER or SECURITY INVOKER.
FunctionSetValue
Value for a SET configuration parameter in a CREATE FUNCTION statement.
GeneratedAs
GeneratedAss are modifiers that follow a column option in a generated. ‘ExpStored’ is used for a column generated from an expression and stored.
GeneratedExpressionMode
GeneratedExpressionModes are modifiers that follow an expression in a generated. No modifier is typically the same as Virtual.
GeometricTypeKind
Represents different types of geometric shapes which are commonly used in PostgreSQL/Redshift for spatial operations and geometry-related computations.
GrantObjects
Objects on which privileges are granted in a GRANT statement.
GranteeName
Users/roles designated in a GRANT/REVOKE
GranteesType
The kind of principal receiving privileges.
GroupByExpr
Represents the two syntactic forms that GROUP BY can take, including GROUP BY ALL with optional modifiers and ordinary GROUP BY <exprs>.
GroupByWithModifier
ClickHouse supports GROUP BY WITH modifiers(includes ROLLUP|CUBE|TOTALS). e.g. GROUP BY year WITH ROLLUP WITH TOTALS
HavingBoundKind
Which bound is used in a HAVING clause for ANY_VALUE on BigQuery.
HiveDelimiter
Kind of delimiter used in Hive ROW FORMAT definitions.
HiveDescribeFormat
Describe output format options for Hive DESCRIBE/EXPLAIN.
HiveDistributionStyle
Distribution style options for Hive tables.
HiveIOFormat
Hive input/output format specification used in CREATE TABLE.
HiveRowFormat
Row format specification for Hive tables (SERDE or DELIMITED).
IamRoleKind
An IAM_ROLE option in the AWS ecosystem
IdentityPropertyFormatKind
A format of parameters of identity column.
IdentityPropertyKind
Identity is a column option for defining an identity or autoincrement column in a CREATE TABLE statement. Syntax
IdentityPropertyOrder
The identity column option specifies how values are generated for the auto-incremented column, either in increasing or decreasing order. Syntax
IndexOption
MySQL index option, used in CREATE TABLE, CREATE INDEX, and ALTER TABLE.
IndexType
Indexing method used by that index.
InitializeKind
Specifies the behavior of the initial refresh of the dynamic table.
IntervalFields
Fields for Postgres INTERVAL type.
JoinConstraint
Represents how two tables are constrained in a join: ON, USING, NATURAL, or none.
JoinOperator
The operator used for joining two tables, e.g. INNER, LEFT, CROSS, ASOF, etc.
JsonNullClause
MSSQL’s json null clause
JsonPathElem
An element of a JSON path.
JsonTableColumn
A single column definition in MySQL’s JSON_TABLE table valued function.
JsonTableColumnErrorHandling
Stores the error handling clause of a JSON_TABLE table valued function: {NULL | DEFAULT json_string | ERROR} ON {ERROR | EMPTY } Error/empty-value handling for JSON_TABLE columns.
KeyOrIndexDisplay
Representation whether a definition can can contains the KEY or INDEX keywords with the same meaning.
KillType
Types supported by KILL statements.
LambdaSyntax
The syntax style for a lambda function.
LimitClause
Represents the different syntactic forms of LIMIT clauses.
ListAggOnOverflow
The ON OVERFLOW clause of a LISTAGG invocation
LockTableType
The type of lock used in LOCK TABLE statements.
LockType
The lock type used in FOR <lock> clauses (e.g. FOR SHARE, FOR UPDATE).
MacroDefinition
Definition for a DuckDB macro: either an expression or a table-producing query.
MatchRecognizePattern
The pattern in a MATCH_RECOGNIZE operation.
MatchRecognizeSymbol
A symbol in a MATCH_RECOGNIZE pattern.
MergeAction
Underlying statement of a WHEN clause within a MERGE Statement
MergeClauseKind
Variant of WHEN clause used within a MERGE Statement.
MergeInsertKind
The type of expression used to insert rows within a MERGE statement.
MfaMethodKind
Types of MFA methods
MinMaxValue
Can use to describe options in create sequence or table column type identity [ MINVALUE minvalue | NO MINVALUE ] [ MAXVALUE maxvalue | NO MAXVALUE ]
MySQLColumnPosition
MySQL ALTER TABLE only [FIRST | AFTER column_name] MySQL ALTER TABLE column position specifier: FIRST or AFTER <column>.
MysqlInsertPriority
Mysql specific syntax
NamedWindowExpr
An expression used in a named window declaration.
NonBlock
Non-blocking lock options for FOR ... clauses.
NormalizationForm
The Unicode Standard defines four normalization forms, which are intended to eliminate certain distinctions between visually or functionally identical characters.
NullInclusion
Specifies Include / Exclude NULL within UNPIVOT command. For example UNPIVOT (column1 FOR new_column IN (col3, col4, col5, col6))
NullTreatment
Specifies Ignore / Respect NULL within window functions. For example FIRST_VALUE(column2) IGNORE NULLS OVER (PARTITION BY column1) How NULL values are treated in certain window functions.
NullsDistinctOption
PostgreSQL unique index nulls handling option: [ NULLS [ NOT ] DISTINCT ]
ObjectNamePart
A single part of an ObjectName
ObjectType
Types of database objects referenced by DDL statements.
OffsetRows
Stores the keyword after OFFSET <number>
OnCommit
Action to take ON COMMIT for temporary tables.
OnConflictAction
Action to perform when an ON CONFLICT target is matched.
OnInsert
Behavior to apply for INSERT when a conflict occurs.
OneOrManyWithParens
Encapsulates the common pattern in SQL where either one unparenthesized item such as an identifier or expression is permitted, or multiple of the same item in a parenthesized list. For accessing items regardless of the form, OneOrManyWithParens implements Deref<Target = [T]> and IntoIterator, so you can call slice methods on it and iterate over items
OperatorClassItem
An item in a CREATE OPERATOR CLASS statement
OperatorFamilyDropItem
An item in an ALTER OPERATOR FAMILY DROP statement
OperatorFamilyItem
An item in an ALTER OPERATOR FAMILY ADD statement
OperatorOption
Option for ALTER OPERATOR SET operation
OperatorPurpose
Purpose of an operator in an operator class
OptimizerHintStyle
The commentary style of an optimizer hint
OrderByKind
The kind of ORDER BY clause: either ALL with modifiers or a list of expressions.
OutputClause
A OUTPUT Clause in the end of a MERGE Statement
Owner
New owner specification for ALTER TABLE ... OWNER TO ...
Partition
PARTITION statement used in ALTER TABLE et al. such as in Hive and ClickHouse SQL. For example, ClickHouse’s OPTIMIZE TABLE supports syntax like PARTITION ID ‘partition_id’ and PARTITION expr. ClickHouse
PartitionBoundValue
A value in a partition bound specification.
PartitionRangeDirection
Specifies which partition the boundary values on table partitioning belongs to.
Password
Password specification variants used in user-related statements.
PipeOperator
Pipe syntax, first introduced in Google BigQuery. Example:
PivotValueSource
The source of values in a PIVOT operation.
Privileges
Privileges granted in a GRANT statement or revoked in a REVOKE statement.
RaisErrorOption
RAISERROR options See https://learn.microsoft.com/en-us/sql/t-sql/language-elements/raiserror-transact-sql?view=sql-server-ver16#options
RaiseStatementValue
Represents the error value of a RaiseStatement.
ReferentialAction
<referential_action> = { RESTRICT | CASCADE | SET NULL | NO ACTION | SET DEFAULT }
RefreshModeKind
Specifies the refresh mode for the dynamic table.
RenameSelectItem
Snowflake RENAME information.
RenameTableNameKind
RenameTableNameKind is the kind used in an ALTER TABLE _ RENAME statement.
RepetitionQuantifier
Determines the minimum and maximum allowed occurrences of a pattern in a MATCH_RECOGNIZE operation.
ReplicaIdentity
ALTER TABLE operation REPLICA IDENTITY values See Postgres ALTER TABLE docs
Reset
Variants of the RESET statement
ResetConfig
RESET config option:
ReturnStatementValue
Variants of a RETURN statement
RoleOption
An option in ROLE statement.
RowsPerMatch
The rows per match option in a MATCH_RECOGNIZE operation.
SchemaName
Schema possible naming variants (1).
SearchModifier
Fulltext search modifiers (1).
SecondaryRoles
Snowflake SECONDARY ROLES USE variant See: https://docs.snowflake.com/en/sql-reference/sql/use-secondary-roles
SelectFlavor
What did this select look like?
SelectItem
One item of the comma-separated list following SELECT
SelectItemQualifiedWildcardKind
Represents an expression behind a wildcard expansion in a projection. `SELECT T.* FROM T;
SequenceOptions
Can use to describe options in create sequence or table column type identity
SessionParamStatsTopic
Topics available for session statistics configuration.
SessionParamValue
Value for a session boolean-like parameter (ON/OFF).
Set
Variants for the SET family of statements.
SetConfigValue
SET config value option:
SetExpr
A node in a tree, representing a “query body” expression, roughly: SELECT ... [ {UNION|EXCEPT|INTERSECT} SELECT ...]
SetOperator
A set operator for combining two SetExprs.
SetQuantifier
A quantifier for SetOperator.
SetSessionAuthorizationParamKind
Represents the parameter kind for SET SESSION AUTHORIZATION
SetSessionParamKind
Kind of session parameter being set by SET SESSION.
ShowCreateObject
Object kinds supported by SHOW CREATE statements.
ShowStatementFilter
Filter forms usable in SHOW statements.
ShowStatementFilterPosition
Where a SHOW filter appears relative to the main clause.
ShowStatementInClause
Clause types used with SHOW … IN/FROM.
ShowStatementInParentType
Parent object types usable with SHOW ... IN <parent> clauses.
SqlOption
SQL option syntax used in table and server definitions.
SqliteOnConflict
Sqlite specific syntax
Statement
A top-level statement (SELECT, INSERT, CREATE, etc.)
StorageSerializationPolicy
Snowflake StorageSerializationPolicy for Iceberg Tables
StorageType
Storage type options for a tablespace.
StructBracketKind
Type of brackets used for STRUCT literals.
Subscript
The contents inside the [ and ] in a subscript expression.
TableFactor
A table name or a parenthesized subquery with an optional alias
TableIndexHintForClause
Which clause the table index hint applies to.
TableIndexHintType
Type of index hint (e.g., USE, IGNORE, FORCE).
TableIndexType
The kind of index referenced by an index hint (e.g. USE INDEX).
TableObject
Represents the referenced table in an INSERT INTO statement
TableOptionsClustered
Clustered options used for CREATE TABLE clustered/indexed storage.
TableSampleKind
The table sample modifier options
TableSampleMethod
The table sample method names Sampling method used by TABLESAMPLE.
TableSampleModifier
Modifier specifying whether SAMPLE or TABLESAMPLE keyword was used.
TableSampleSeedModifier
Modifier specifying how the sample seed is applied.
TableSampleUnit
Unit used with a TABLESAMPLE quantity (rows or percent).
TableVersion
Specifies a table version selection, e.g. FOR SYSTEM_TIME AS OF or AT(...).
TimezoneInfo
Timestamp and Time data types information about TimeZone formatting.
TopQuantity
Quantity used in a TOP clause: either an expression or a constant.
TransactionAccessMode
Transaction access mode (READ ONLY / READ WRITE).
TransactionIsolationLevel
Transaction isolation levels.
TransactionMode
Mode for transactions: access mode or isolation level.
TransactionModifier
Modifier for the transaction in the BEGIN syntax
TriggerEvent
Used to describe trigger events
TriggerExecBodyType
Types of trigger body execution body.
TriggerObject
This specifies whether the trigger function should be fired once for every row affected by the trigger event, or just once per SQL statement.
TriggerObjectKind
Whether the syntax used for the trigger object (ROW or STATEMENT) is FOR or FOR EACH.
TriggerPeriod
Trigger period
TriggerReferencingType
This clause indicates whether the following relation name is for the before-image transition relation or the after-image transition relation
TrimWhereField
The side on which TRIM should be applied.
TruncateIdentityOption
PostgreSQL identity option for TRUNCATE table [ RESTART IDENTITY | CONTINUE IDENTITY ]
UnaryOperator
Unary operators
UpdateTableFromKind
The FROM clause of an UPDATE TABLE statement
Use
A USE (Statement::Use) operation
UserDefinedTypeInternalLength
Internal length specification for PostgreSQL user-defined base types.
UserDefinedTypeRangeOption
Options for PostgreSQL CREATE TYPE ... AS RANGE statement.
UserDefinedTypeRepresentation
SQL user defined type definition
UserDefinedTypeSqlDefinitionOption
Options for PostgreSQL CREATE TYPE ... (<options>) statement (base type definition).
UserDefinedTypeStorage
Storage specification for PostgreSQL user-defined base types.
UserPolicyKind
Types of user-based policies
Value
Primitive SQL values such as number and string
ValueTableMode
BigQuery supports ValueTables which have 2 modes: SELECT [ALL | DISTINCT] AS STRUCT SELECT [ALL | DISTINCT] AS VALUE
WindowFrameBound
Specifies WindowFrame’s start_bound and end_bound
WindowFrameUnits
Units used to describe the window frame scope.
WindowType
The type of a window used in OVER clauses.
WrappedCollection
Helper to indicate if a collection should be wrapped by a symbol in the display form
XmlTableColumnOption
Defines the options for an XmlTable column: Named or ForOrdinality
Spanned
Trait for AST nodes that have a source location information.
Visit
A type that can be visited by a Visitor. See Visitor for recursively visiting parsed SQL statements.
VisitMut
A type that can be visited by a VisitorMut. See VisitorMut for recursively visiting parsed SQL statements.
Visitor
A visitor that can be used to walk an AST tree.
VisitorMut
A visitor that can be used to mutate an AST tree.
escape_double_quote_string
Convenience wrapper for escaping strings for double-quoted literals (").
escape_quoted_string
Return a helper which formats string for inclusion inside a quoted literal that uses quote as the delimiter.
visit_expressions
Invokes the provided closure on all expressions (e.g. 1 + 2) present in v
visit_expressions_mut
Invokes the provided closure iteratively with a mutable reference to all expressions present in v.
visit_relations
Invokes the provided closure on all relations (e.g. table names) present in v
visit_relations_mut
Invokes the provided closure with a mutable reference to all relations (e.g. table names) present in v.
visit_statements
Invokes the provided closure iteratively with a mutable reference to all statements present in v (e.g. SELECT, CREATE TABLE, etc).
visit_statements_mut
Invokes the provided closure on all statements (e.g. SELECT, CREATE TABLE, etc) present in v