Skip to main content

ScopeEntry

Trait ScopeEntry 

Source
pub trait ScopeEntry {
    type Key;
    type Nullable: Nullability;
    type Sources;
}
Expand description

Something that can be listed in FROM or JOIN: a table, view, alias, derived table, CTE, or raw SQL.

Table, view, and alias macros implement this for you. A column’s Sources names its source as Src<T>, and the scope check looks up T::Key in the query’s scope.

Tables and views are keyed by their SQL name (TableKey). Aliased sources (Table::alias::<Tag>(), derived tables, CTEs) are keyed by AliasKey<Tag>, because SQL resolves their columns by alias name.

Required Associated Types§

Source

type Key

How columns refer to this source: a TableKey or an AliasKey.

Source

type Nullable: Nullability

Null when an outer join can leave this source NULL.

Source

type Sources

Sources this source reads itself, such as the tables a derived table’s subquery reads from an outer query. They resolve against the enclosing query (or, for a LATERAL join, the sources joined before it). Tables and views read nothing (()).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T: ScopeEntry + ?Sized> ScopeEntry for &T

Implementors§

Source§

impl<T: ScopeEntry> ScopeEntry for OuterJoined<T>

Source§

impl<Tag> ScopeEntry for AliasKey<Tag>

Source§

impl<V: SQLParam, Name, Projection, Query: ExprSources> ScopeEntry for Derived<'_, V, Name, Projection, Query>

Source§

impl<V: SQLParam, Table: ScopeEntry, Query> ScopeEntry for CTEView<'_, V, Table, Query>

Source§

type Key = <Table as ScopeEntry>::Key

Source§

type Nullable = <Table as ScopeEntry>::Nullable

Source§

type Sources = ()

Source§

impl<V: SQLParam> ScopeEntry for SQL<'_, V>