Struct sql::plan::statement::StatementContext [−][src]
pub struct StatementContext<'a> {
pcx: Option<&'a PlanContext>,
pub catalog: &'a dyn SessionCatalog,
pub param_types: RefCell<BTreeMap<usize, ScalarType>>,
}
Expand description
Immutable state that applies to the planning of an entire Statement
.
Fields
pcx: Option<&'a PlanContext>
The optional PlanContext, which will be present for statements that execute within the OneShot QueryLifetime and None otherwise (views). This is an awkward field and should probably be relocated to a place that fits our execution model more closely.
catalog: &'a dyn SessionCatalog
param_types: RefCell<BTreeMap<usize, ScalarType>>
The types of the parameters in the query. This is filled in as planning occurs.
Implementations
pub fn new(
pcx: Option<&'a PlanContext>,
catalog: &'a dyn SessionCatalog
) -> StatementContext<'a>
pub fn resolve_database(
&self,
name: UnresolvedObjectName
) -> Result<&dyn CatalogDatabase, PlanError>
pub fn resolve_schema(
&self,
name: UnresolvedObjectName
) -> Result<&dyn CatalogSchema, PlanError>
pub fn resolve_function(
&self,
name: UnresolvedObjectName
) -> Result<&dyn CatalogItem, PlanError>
Trait Implementations
Convert a reference to a StatementContext
to an OptimizerConfig
.
This picks up feature flag values such as qgm_optimizations
from the PlanContext
if this is present in
the StatementContext
, otherwise uses sensible defaults.
Performs the conversion.
Auto Trait Implementations
impl<'a> !RefUnwindSafe for StatementContext<'a>
impl<'a> !Send for StatementContext<'a>
impl<'a> !Sync for StatementContext<'a>
impl<'a> Unpin for StatementContext<'a>
impl<'a> !UnwindSafe for StatementContext<'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