Skip to main content

Module ast

Module ast 

Source
Expand description

Internal SQL AST. Lifts the relevant subset of the libpg_query protobuf tree into a Rust enum the compiler walks. Statements not yet supported parse cleanly but compile to crate::SQLError::Unsupported.

Structs§

AlterSequence
AlterTableStmt
CTE
ColumnDef
CreateForeignServer
CreateForeignTable
CreateFunction
CREATE [OR REPLACE] FUNCTION | PROCEDURE.
CreateIndex
CreateSequence
CreateTable
DeleteStmt
DropFunctionItem
One DROP FUNCTION / DROP PROCEDURE target.
DropFunctionStmt
DROP FUNCTION [IF EXISTS] name[(argtypes)] [, ...] and the DROP PROCEDURE equivalent.
DropStmt
ForeignKey
Table-level foreign key. local_columns.len() matches ref_columns.len(); the engine joins on the position-aligned pairs.
ForeignKeyRef
REFERENCES table(column) reference target.
FunctionBinding
FunctionParam
One declared parameter of a user-defined function or procedure.
GeneratedColumn
InsertStmt
JoinUsing
LockingClause
One PostgreSQL row-locking clause, including optional OF targets and the NOWAIT / SKIP LOCKED wait policy.
MergeStmt
OnConflict
OrderBy
Projection
ReturningAliases
RoutineColumnTypeReference
Structured relation-column identity carried by a routine %TYPE declaration until catalog binding resolves it to a concrete SQL type.
SelectStmt
SetOp
TableCheck
CHECK (expr) constraint with an optional name (CONSTRAINT <name> CHECK (...)).
TableConstraintSet
Durable table-level constraints that do not fit in ColumnDef.
TableKeyConstraint
A table key whose columns are compared as one tuple.
UpdateStmt
WindowFrame
WindowSpec

Enums§

AlterTableAction
BinaryOp
ColumnType
DiscardTarget
DISCARD target. Mirrors PostgreSQL’s DiscardMode.
DropKind
Expr
Scalar expression nodes the compiler handles.
ForeignKeyAction
ForeignKeyMatch
FrameBound
FrameMode
FromClause
FunctionBody
Body of a user-defined routine.
FunctionParamMode
Parameter mode of a CREATE FUNCTION / CREATE PROCEDURE argument. Mirrors PostgreSQL’s FunctionParameterMode.
FunctionReturns
Declared result shape of a user-defined function.
FunctionVolatility
IMMUTABLE / STABLE / VOLATILE marker.
GeneratedColumnKind
JoinKind
LockStrength
PostgreSQL row-lock strength, strongest last.
LockWait
Wait policy for a row-locking clause.
MergeWhen
NullsOrder
OnConflictAction
SequenceRestart
Physical restart action carried by ALTER SEQUENCE.
SetOpKind
Statement
TableKeyConstraintKind
TransactionStmt

Functions§

is_builtin_aggregate_function
Return whether name is a built-in aggregate understood by the planner.

Type Aliases§

GeneratedFunctionDependency
ValueExpr
Expr restricted to value-producing forms used by INSERT rows.