Skip to main content

Module binding

Module binding 

Source
Expand description

Static relational row-type binding.

This module derives source and query output schemas from plans, catalog declarations, and already-bound CTE schemas. It never executes a query or samples a result row, so empty, spilled, and correlated relations retain the same declared PostgreSQL type identities as non-empty relations.

Re-exports§

pub use context::BindingContext;

Modules§

catalog_sources
Engine-independent catalog source binding.
context
Immutable SQL inputs adapted from the active statement scope.
correlation
Physical-plan correlation analysis for scalar subquery initialization.
portals
Cursor binding and dependency metadata consumed before snapshot registration.
scoped_types
Catalog-backed function and scalar-subquery typing within an owned analysis scope.
snapshot
Owned catalog and CTE type inputs for analysis that rewrites nested scopes.
statements
Executable statement schemas and mutation parameter analysis.
stored_columns
Stored statement column identities, durable source shapes, and rewrite-rule binding.
stored_relations
Bind durable statement relations while preserving namespace, catalog, and error ordering.
stored_routines
Exact routine binding for catalog-owned statements.
view_dependencies
Stored-view relation and sequence binding/dependency analysis.

Functions§

analyze_expression_plan_type
Validate a command argument’s names and types without running its expressions.
analyze_prepared_command_schema
analyze_projection_output_schema
Derive and validate a projection’s exact output row type without executing it.
analyze_query_plan_schema
Analyze every catalog and scalar reference and derive the exact output row type without executing the query.
analyze_query_plan_schema_with_catalog
analyze_recursive_control_step
analyze_source_plan_schema
Derive and validate one FROM source’s exact row type without executing it.
bind_expression_plan_routines_for_storage
Bind every routine call owned by a stored scalar expression and validate its complete query-valued descendants against the expression’s row scope.
bind_expression_plan_type
Derive the declared SQL type of a standalone expression plan without executing it. The plan-owned subquery arena participates in type resolution so scalar subqueries retain their projected type at command boundaries such as CALL.
bind_projection_output_schema
Bind a projection against an already-declared input schema. star_schema identifies the relation expanded by bare *; expression_schema may also contain joined sources and hidden lookup aliases used by scalar expressions.
bind_query_plan_routines_for_storage
bind_query_plan_schema
Derive the exact output row type of a query plan without executing it.
bind_source_plan_schema
Derive the exact row type of one FROM source without executing it.
bind_source_plan_schema_for_execution
Bind every table-function source in one execution-owned source plan to its exact routine identity and return the schema derived from those same bindings.
extend_cte_generated_schema
hide_recursive_generated_schema
infer_prepared_parameter_types
overlay_outer_schema
validate_query_block_expression_types
Validate every scalar expression in a query block while the physical input still carries declared SQL types. This must precede polymorphic rewrites such as pg_typeof, because an invalid common type is an error, not an unknown result.
validate_query_block_references
Validate every query-block reference only after the caller has the authoritative source schema. This preserves registered table-function row shapes and checks recursive argument references before definitive routine namespace lookup.
values_types_in_scope
with_query_table_pseudo_columns
Add query-block pseudo columns after the complete source scope is known, so _meta is exposed only for one unambiguous local-table source and never shadows a real relation alias.