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§

AlterRoleStmt
AlterRoutineOwnerStmt
AlterRoutineStmt
ALTER FUNCTION | PROCEDURE | ROUTINE name[(input_types)] ... with an optional exact declared input identity.
AlterSequence
AlterTableStmt
AlterViewOptionsStmt
AutoIncrement
Durable sequence provenance for a SERIAL or identity column.
AutoIncrementOwner
Durable owner of an implicit sequence. Inherited SERIAL defaults and declarative partitions copy this owner unchanged, so truncating a child cannot reset a sequence owned by its parent.
CTE
ColumnDef
CreateForeignServer
CreateForeignTable
CreateFunction
CREATE [OR REPLACE] FUNCTION | PROCEDURE.
CreateIndex
CreateRoleStmt
CreateRule
CreateSequence
CreateTable
CreateTrigger
CteCycleClause
PostgreSQL recursive-CTE cycle detection metadata.
CteSearchClause
PostgreSQL recursive-CTE traversal-order metadata.
DeleteStmt
DetachedPartitionConstraint
DropFunctionItem
One DROP FUNCTION / DROP PROCEDURE target.
DropFunctionStmt
DROP FUNCTION [IF EXISTS] name[(argtypes)] [, ...] and the DROP PROCEDURE equivalent.
DropRoleStmt
DropRule
DropStmt
DropTrigger
ForeignKey
Table-level foreign key. Compilation preserves an omitted referenced column list as empty; validation fills it from the primary key before publication.
ForeignKeyRef
REFERENCES table[(column)] reference target.
FunctionBinding
FunctionParam
One declared parameter of a user-defined function or procedure.
GeneratedColumn
GrantRoutineItem
GrantRoutineStmt
InsertStmt
JoinUsing
LockingClause
One PostgreSQL row-locking clause, including optional OF targets and the NOWAIT / SKIP LOCKED wait policy.
MergeStmt
OnConflict
OrderBy
PartitionIdentityOverride
PartitionSpec
Projection
ReturningAliases
RoutineAclEntry
One explicit EXECUTE ACL entry. None on CreateFunction::execute_acl retains PostgreSQL’s default public execution privilege.
RoutineColumnTypeReference
Structured relation-column identity carried by a routine %TYPE declaration until catalog binding resolves it to a concrete SQL type.
RoutineInvocationBinding
Concrete parameter and result types selected for one routine invocation.
RoutineSecurityAttributes
Execution identity and planner leakproofness attached to a routine definition.
SelectStmt
SetConstraintName
SetOp
TableCheck
CHECK (expr) constraint with an optional name (CONSTRAINT <name> CHECK (...)).
TableConstraintSet
Durable table-level constraints that do not fit in ColumnDef.
TableFunction
One function inside a FromClause::FunctionGroup.
TableHierarchy
Metadata shared by ordinary inheritance and declarative partitioning.
TableKeyConstraint
A table key whose columns are compared as one tuple.
TruncateTarget
UpdateStmt
WindowFrame
WindowReference
WindowSpec

Enums§

AlterRoutineKind
Routine namespace selected by ALTER FUNCTION, ALTER PROCEDURE, or ALTER ROUTINE.
AlterTableAction
AlterViewKind
AlterViewOptionsAction
AutoIncrementKind
PostgreSQL syntax that supplies an omitted column value from an implicit sequence. SERIAL is a sequence-backed default, while identity columns retain a separate generation attribute and do not have a column default.
BinaryOp
ColumnType
CteMaterialization
The planning fence requested for one common-table expression.
DiscardTarget
DISCARD target. Mirrors PostgreSQL’s DiscardMode.
DropKind
EventEnableMode
Expr
Scalar expression nodes the compiler handles.
ForeignKeyAction
ForeignKeyMatch
FrameBound
FrameMode
FromClause
FunctionBody
Body of a user-defined routine.
FunctionDispatch
Structural identity for parser-owned expressions and overload-specific built-in implementations. These variants occupy no SQL function-name namespace.
FunctionParallel
PARALLEL UNSAFE, PARALLEL RESTRICTED, or PARALLEL SAFE routine metadata.
FunctionParamMode
Parameter mode of a CREATE FUNCTION / CREATE PROCEDURE argument. Mirrors PostgreSQL’s FunctionParameterMode.
FunctionResolutionError
Static function-call failure discovered while binding declared argument types.
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
OnCommitAction
ON COMMIT behavior retained with a temporary table definition.
OnConflictAction
PartitionBound
PartitionRangeDatum
PartitionStrategy
RangeFunctionOperation
Operation selected for one typed range or multirange call.
RangeSubtype
RelationPersistence
PostgreSQL’s pg_class.relpersistence contract.
RoleAttribute
RoutineConfigAction
RoutineVariadicMode
Call syntax selected for a routine’s variadic parameter.
RuleEvent
SequenceRestart
Physical restart action carried by ALTER SEQUENCE.
SetOpKind
Statement
TableKeyConstraintKind
TransactionStmt
TriggerEvent
TriggerTiming
WindowReferenceKind

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.