Struct sql::plan::query::QueryContext [−][src]
pub struct QueryContext<'a> {
pub scx: &'a StatementContext<'a>,
pub lifetime: QueryLifetime<'a>,
pub outer_scopes: Vec<Scope>,
pub outer_relation_types: Vec<RelationType>,
pub ctes: HashMap<LocalId, CteDesc>,
pub ids: HashSet<GlobalId>,
pub recursion_guard: RecursionGuard,
}
Expand description
The state required when planning a Query
.
Fields
scx: &'a StatementContext<'a>
The context for the containing Statement
.
lifetime: QueryLifetime<'a>
The lifetime that the planned query will have.
outer_scopes: Vec<Scope>
The scopes of the outer relation expression.
outer_relation_types: Vec<RelationType>
The type of the outer relation expressions.
ctes: HashMap<LocalId, CteDesc>
CTEs for this query, mapping their assigned LocalIds to their definition.
ids: HashSet<GlobalId>
The GlobalIds of the items the Query
is dependent upon.
recursion_guard: RecursionGuard
Implementations
Generate a new QueryContext
appropriate to be used in subqueries of
self
.
Derives a QueryContext
for a scope that contains no columns.
pub fn resolve_table_name(
&self,
object: ResolvedObjectName
) -> Result<(HirRelationExpr, Scope), PlanError>
pub fn resolve_table_name(
&self,
object: ResolvedObjectName
) -> Result<(HirRelationExpr, Scope), PlanError>
Resolves object
to a table expr, i.e. creating a Get
or inlining a
CTE.
Trait Implementations
Extracts a reference to the recursion guard embedded within the type.
fn checked_recur<F, T, E>(&self, f: F) -> Result<T, E> where
F: FnOnce(&Self) -> Result<T, E>,
E: From<RecursionLimitError>,
fn checked_recur<F, T, E>(&self, f: F) -> Result<T, E> where
F: FnOnce(&Self) -> Result<T, E>,
E: From<RecursionLimitError>,
Checks whether it is safe to recur and calls f
if so. Read more
fn checked_recur_mut<F, T, E>(&mut self, f: F) -> Result<T, E> where
F: FnOnce(&mut Self) -> Result<T, E>,
E: From<RecursionLimitError>,
fn checked_recur_mut<F, T, E>(&mut self, f: F) -> Result<T, E> where
F: FnOnce(&mut Self) -> Result<T, E>,
E: From<RecursionLimitError>,
Like CheckedRecursion::checked_recur
, but operates on a mutable
reference to Self
. Read more
Auto Trait Implementations
impl<'a> !RefUnwindSafe for QueryContext<'a>
impl<'a> !Send for QueryContext<'a>
impl<'a> !Sync for QueryContext<'a>
impl<'a> Unpin for QueryContext<'a>
impl<'a> !UnwindSafe for QueryContext<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more
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