Skip to main content

Crate rudb_bind

Crate rudb_bind 

Source
Expand description

Name, type and overload resolution, subquery binding, and the bound logical plan.

Rank 10 in the layer rule. See xtask/layers.toml and spec/18-package-layout.md.

The binder is the pass that turns what someone wrote into what it means. A parse tree says SELECT x FROM t, and only the binder can say which table t is, which column x is, what type it has, and therefore what the query does. Everything after this point works on the answer rather than on the question: the optimizer never resolves a name and the executor never decides a type.

There are two entry points and the difference between them is what they can return. bind takes a statement that produces rows and gives back a rudb_plan::Plan, which is what an optimizer and an executor want. bind_statement takes any statement and gives back a Bound, which is a plan for a query and a resolved catalog operation for CREATE TABLE, DROP TABLE and INSERT. DDL is not a plan node, for the reason statement.rs gives.

What it does not do yet is a table function whose arguments read a LATERAL column, and every statement outside the implemented set. Each gap is an error naming what was written rather than a silently wrong plan, which is the rule the whole front end follows.

Structs§

CreateTable
A bound CREATE TABLE.
CreateView
A bound CREATE VIEW.
DropTable
A bound DROP TABLE or DROP VIEW.
Insert
A bound INSERT.
Parameters
What a prepared statement was handed, by identifier.

Enums§

Bound
One statement, bound.

Functions§

bind
Binds a parsed statement against a catalog.
bind_sql
Parses and binds one query, which is the whole front end in one call.
bind_sql_with
Parses and binds one query, with the settings a call to current_setting() reads.
bind_statement
Binds one parsed statement against a catalog.
bind_statement_sql
Parses and binds one statement, which is the whole front end in one call.
bind_statement_with
Binds one parsed statement against a catalog, with values for its parameters and its settings.
bind_with
Binds a parsed query against a catalog, with values for its parameters and its settings.