Struct sql::plan::scope::Scope[][src]

pub struct Scope {
    pub items: Vec<ScopeItem>,
    pub lateral_barrier: bool,
}

Fields

items: Vec<ScopeItem>lateral_barrier: bool

Implementations

Constructs an iterator over the canonical name for each column.

Returns all items in the scope.

Items are returned in order of preference, where the innermost scope has the highest preference. For example, given scopes A(B(C)), items are presented in the order C, B, A.

Items are returned alongside the column reference that targets that item and the item’s “lateral level”. The latter bears explaining. The lateral level is the number of lateral barriers between this scope and the item. See Scope::lateral_barrier for a diagram. Roughly speaking, items from different levels but the same lateral level are items from different joins in the same subquery, while items in different lateral levels are items from different queries entirely. Rules about ambiguity apply within an entire lateral level, not just within a single scope level.

NOTE(benesch): Scopereally shows its weaknesses here. Ideally we'd have separate types likeQueryScopeandJoinScope` that more naturally encode the concept of a “lateral level”, or at least something along those lines.

Returns all items from the given table name in the closest scope.

If no tables with the given name are in scope, returns an empty iterator.

NOTE(benesch): This is wrong for zero-arity relations, because we can’t distinguish between “no such table” and a table that exists but has no columns. The current design of scope makes this difficult to fix, unfortunately.

Resolves references to a column name to a single column, or errors if multiple columns are equally valid references.

Resolves a column name in a USING clause.

Look to see if there is an already-calculated instance of this expr. Failing to find one is not an error, so this just returns Option

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Upcasts this ProgressEventTimestamp to Any. Read more

Returns the name of the concrete type of this object. Read more

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more