Skip to main content

Module ast

Module ast 

Source

Structs§

AlterTableStatement
ALTER TABLE statement.
ColumnDef
A column definition in CREATE TABLE.
CreateTableStatement
A CREATE TABLE statement.
CreateViewStatement
CREATE VIEW statement.
Cte
A Common Table Expression: name [(col1, col2)] AS [NOT] MATERIALIZED (query)
DeleteStatement
A DELETE statement.
DropTableStatement
A DROP TABLE statement.
DropViewStatement
DROP VIEW statement.
ExplainStatement
EXPLAIN statement.
FromClause
A FROM clause, now supporting subqueries and multiple tables.
InsertStatement
An INSERT statement, now supporting INSERT … SELECT and ON CONFLICT.
JoinClause
A JOIN clause.
OnConflict
OrderByItem
An ORDER BY item.
SelectStatement
A SELECT statement, including CTEs.
SetOperationStatement
UNION / INTERSECT / EXCEPT between two or more queries.
TableRef
A reference to a table.
TruncateStatement
TRUNCATE TABLE statement.
UpdateStatement
An UPDATE statement.
UseStatement
USE database statement.
WindowDefinition
Named WINDOW definition: window_name AS (window_spec)
WindowFrame
WindowSpec
Window specification for window functions: OVER (PARTITION BY … ORDER BY … frame)

Enums§

AlterTableAction
BinaryOperator
Binary operators.
ConflictAction
DataType
SQL data types. Significantly expanded to match sqlglot’s DataType.Type enum.
DateTimeField
Expr
An expression in SQL.
InsertSource
JoinType
The type of JOIN.
QuoteStyle
How an identifier (column, table, alias) was quoted in the source SQL.
ReferentialAction
SelectItem
An item in a SELECT list.
SetOperationType
Statement
A fully parsed SQL statement.
TableConstraint
Table-level constraints.
TableSource
A table source can be a table reference, subquery, or table function.
TransactionStatement
Transaction control statements.
UnaryOperator
Unary operators.
WindowFrameBound
WindowFrameKind

Functions§

find_columns
Helper: collect all column references from an expression.
find_tables
Helper: collect all table references from a statement.