pub struct MutableSourcePlan { /* private fields */ }Expand description
A source whose child and scalar constructor records follow consuming edits.
Implementations§
Source§impl MutableSourcePlan
impl MutableSourcePlan
Sourcepub fn unit(control: &ProductionControl<'_>) -> Result<Self, SQLError>
pub fn unit(control: &ProductionControl<'_>) -> Result<Self, SQLError>
Construct the one-row zero-column relation used by a scalar projection.
Sourcepub fn subquery(
query: MutableQueryPlan,
alias: Option<Produced<String>>,
columns: Produced<Vec<String>>,
captured_output: Option<InternalRelationId>,
lateral: bool,
control: &ProductionControl<'_>,
) -> Result<Self, SQLError>
pub fn subquery( query: MutableQueryPlan, alias: Option<Produced<String>>, columns: Produced<Vec<String>>, captured_output: Option<InternalRelationId>, lateral: bool, control: &ProductionControl<'_>, ) -> Result<Self, SQLError>
Attach a query beneath a newly admitted source box, transferring the query’s own constructor records unchanged.
Source§impl MutableSourcePlan
impl MutableSourcePlan
Sourcepub fn into_query(
self,
control: &ProductionControl<'_>,
) -> Result<MutableQueryPlan, SQLError>
pub fn into_query( self, control: &ProductionControl<'_>, ) -> Result<MutableQueryPlan, SQLError>
Select the contained query and retire the former source, including its metadata and query box, before returning the unchanged query constructor owner.
Source§impl MutableSourcePlan
impl MutableSourcePlan
Sourcepub fn table(
name: &str,
qualifier: &str,
alias: Option<&str>,
include_descendants: bool,
control: &ProductionControl<'_>,
) -> Result<Self, SQLError>
pub fn table( name: &str, qualifier: &str, alias: Option<&str>, include_descendants: bool, control: &ProductionControl<'_>, ) -> Result<Self, SQLError>
Construct a relation reference from borrowed names without first materializing an ordinary source.
pub fn captured_values( values: impl ExactSizeIterator<Item = OwnedScalarExpr>, relation: InternalRelationId, control: &ProductionControl<'_>, ) -> Result<Self, SQLError>
pub fn cross_join( left: Self, right: Self, lateral: bool, control: &ProductionControl<'_>, ) -> Result<Self, SQLError>
Source§impl MutableSourcePlan
impl MutableSourcePlan
Sourcepub fn split_join(
self,
control: &ProductionControl<'_>,
) -> Result<MutableJoinParts, SQLError>
pub fn split_join( self, control: &ProductionControl<'_>, ) -> Result<MutableJoinParts, SQLError>
Split an undecorated inner/cross join into independent input owners and a shell retaining the two allocated boxes. The shell cannot be observed or published as executable syntax until assembly succeeds.
Source§impl MutableSourcePlan
impl MutableSourcePlan
Sourcepub fn set_join_lateral(
self,
lateral: bool,
control: &ProductionControl<'_>,
) -> Result<Self, SQLError>
pub fn set_join_lateral( self, lateral: bool, control: &ProductionControl<'_>, ) -> Result<Self, SQLError>
Retain the selected join’s lateral namespace when a function input expands into a derived table.
Sourcepub fn set_join_strategy(
self,
strategy: JoinExecutionStrategy,
control: &ProductionControl<'_>,
) -> Result<Self, SQLError>
pub fn set_join_strategy( self, strategy: JoinExecutionStrategy, control: &ProductionControl<'_>, ) -> Result<Self, SQLError>
Install the planner’s allocation-free join execution decision.
Source§impl MutableSourcePlan
impl MutableSourcePlan
Sourcepub fn reduce_null_rejected_outer_joins(
self,
routines: &dyn RoutineResolution,
predicate: Option<&ScalarExpr>,
params: &[SQLParam],
context: &ControlledBindingContext<'_>,
control: &ProductionControl<'_>,
) -> Result<Self, SQLError>
pub fn reduce_null_rejected_outer_joins( self, routines: &dyn RoutineResolution, predicate: Option<&ScalarExpr>, params: &[SQLParam], context: &ControlledBindingContext<'_>, control: &ProductionControl<'_>, ) -> Result<Self, SQLError>
Null-rejection changes only join-kind decisions; every source constructor and child keeps its existing owner.
Source§impl MutableSourcePlan
impl MutableSourcePlan
Sourcepub fn map_query_with_parent(
self,
control: &ProductionControl<'_>,
map: impl FnOnce(&SourcePlan, MutableQueryPlan) -> Result<MutableQueryPlan, SQLError>,
) -> Result<Self, SQLError>
pub fn map_query_with_parent( self, control: &ProductionControl<'_>, map: impl FnOnce(&SourcePlan, MutableQueryPlan) -> Result<MutableQueryPlan, SQLError>, ) -> Result<Self, SQLError>
Observe source aliases and retained descriptors while rewriting the source’s query. The original box stays in the source with an empty placeholder during the callback.
Sourcepub fn map_child_with_parent(
self,
slot: SourceChildSlot,
control: &ProductionControl<'_>,
map: impl FnOnce(&SourcePlan, Self) -> Result<Self, SQLError>,
) -> Result<Self, SQLError>
pub fn map_child_with_parent( self, slot: SourceChildSlot, control: &ProductionControl<'_>, map: impl FnOnce(&SourcePlan, Self) -> Result<Self, SQLError>, ) -> Result<Self, SQLError>
Observe the join’s metadata and other input while moving one source child through a rewrite.
Source§impl MutableSourcePlan
impl MutableSourcePlan
Sourcepub fn replace_alias(
self,
alias: Produced<String>,
control: &ProductionControl<'_>,
) -> Result<Self, SQLError>
pub fn replace_alias( self, alias: Produced<String>, control: &ProductionControl<'_>, ) -> Result<Self, SQLError>
Replace an explicit source alias without changing the source’s physical or function identity.
pub fn replace_table_reference( self, name: Option<Produced<String>>, qualifier: Option<Produced<String>>, control: &ProductionControl<'_>, ) -> Result<Self, SQLError>
pub fn replace_function_references( self, index: usize, output_name: Option<Produced<String>>, relations: Option<Produced<OperatorJoinRelations>>, control: &ProductionControl<'_>, ) -> Result<Self, SQLError>
Source§impl MutableSourcePlan
impl MutableSourcePlan
pub fn reserved_bytes(&self) -> usize
Sourcepub fn map_query(
self,
control: &ProductionControl<'_>,
map: impl FnOnce(MutableQueryPlan) -> Result<MutableQueryPlan, SQLError>,
) -> Result<Self, SQLError>
pub fn map_query( self, control: &ProductionControl<'_>, map: impl FnOnce(MutableQueryPlan) -> Result<MutableQueryPlan, SQLError>, ) -> Result<Self, SQLError>
Rewrite a derived or attached table query while keeping its original source box and namespace metadata.
pub fn map_scalar( self, slot: SourceScalarSlot, control: &ProductionControl<'_>, map: impl FnOnce(OwnedScalarExpr) -> Result<OwnedScalarExpr, SQLError>, ) -> Result<Self, SQLError>
pub fn map_child( self, slot: SourceChildSlot, control: &ProductionControl<'_>, map: impl FnOnce(Self) -> Result<Self, SQLError>, ) -> Result<Self, SQLError>
Sourcepub fn select_child(
self,
slot: SourceChildSlot,
control: &ProductionControl<'_>,
) -> Result<Self, SQLError>
pub fn select_child( self, slot: SourceChildSlot, control: &ProductionControl<'_>, ) -> Result<Self, SQLError>
Select one join child and destroy the former parent, including the child’s old enclosing box. The selected child’s own allocations retain their separate constructor records.
Methods from Deref<Target = SourcePlan>§
Sourcepub fn copy_with_query(
&self,
query: OwnedQueryPlan,
control: &ProductionControl<'_>,
) -> Result<Produced<Self>, SQLError>
pub fn copy_with_query( &self, query: OwnedQueryPlan, control: &ProductionControl<'_>, ) -> Result<Produced<Self>, SQLError>
Copy a subquery source’s declaration while transferring the selected executable body and its root allocation.
pub fn copy_for_rewrite( &self, control: &ProductionControl<'_>, ) -> Result<MutableSourcePlan, SQLError>
pub fn copy_function_group_member_for_rewrite( &self, index: usize, control: &ProductionControl<'_>, ) -> Result<MutableSourcePlan, SQLError>
Sourcepub fn visible_qualifier(&self) -> Option<&str>
pub fn visible_qualifier(&self) -> Option<&str>
SQL-visible relation qualifier for a non-join FROM item. PostgreSQL uses the local function name, not its schema-qualified lookup identity, when a table function has no explicit alias.
Sourcepub fn try_visit_expressions<'a, E>(
&'a self,
visit: &mut dyn FnMut(&'a ScalarExpr) -> Result<bool, E>,
) -> Result<bool, E>
pub fn try_visit_expressions<'a, E>( &'a self, visit: &mut dyn FnMut(&'a ScalarExpr) -> Result<bool, E>, ) -> Result<bool, E>
Visit scalar roots in this source’s expression namespace. Derived-query bodies retain their own scope. Return false on a successful callback stop; an error also stops before the next root.
Sourcepub fn push_expressions<'a>(&'a self, output: &mut Vec<&'a ScalarExpr>)
pub fn push_expressions<'a>(&'a self, output: &mut Vec<&'a ScalarExpr>)
Append scalar inputs owned by this source, including JOIN predicates; nested query bodies retain their own expression scope.
pub fn collect_tables(&self, output: &mut Vec<(String, Option<String>)>)
Sourcepub fn is_explicitly_lateral(&self) -> bool
pub fn is_explicitly_lateral(&self) -> bool
Explicit LATERAL permission retained by a range item independently of its parent join.
Sourcepub fn internal_values_schema(&self) -> Result<Option<RowSchema>, SQLError>
pub fn internal_values_schema(&self) -> Result<Option<RowSchema>, SQLError>
Recover an internal VALUES schema from its declarations without sampling a row or exposing SQL-visible attributes.
Sourcepub fn internal_values_schema_with_inference(
&self,
inferred: Option<&RowSchema>,
) -> Result<Option<RowSchema>, SQLError>
pub fn internal_values_schema_with_inference( &self, inferred: Option<&RowSchema>, ) -> Result<Option<RowSchema>, SQLError>
Fill undeclared captured attributes from their caller scope, retaining explicit declarations and collations unchanged.
pub fn internal_values_schema_with_control( &self, inferred: Option<&RowSchema>, control: &ProductionControl<'_>, ) -> Result<Option<RowSchema>, SQLError>
Sourcepub fn visit_scalar_expressions(&self, visit: &mut dyn FnMut(&ScalarExpr))
pub fn visit_scalar_expressions(&self, visit: &mut dyn FnMut(&ScalarExpr))
Visit every scalar expression this source owns, each root once: join conditions, VALUES rows, function arguments and the expressions of the query bodies nested in derived tables.
Sourcepub fn try_visit_scalar_expressions<'a, E>(
&'a self,
visit: &mut dyn FnMut(&'a ScalarExpr) -> Result<(), E>,
) -> Result<(), E>
pub fn try_visit_scalar_expressions<'a, E>( &'a self, visit: &mut dyn FnMut(&'a ScalarExpr) -> Result<(), E>, ) -> Result<(), E>
Stop at the first callback error, without copying syntax or visiting later inputs.
Trait Implementations§
Source§impl Debug for MutableSourcePlan
impl Debug for MutableSourcePlan
Source§impl Deref for MutableSourcePlan
impl Deref for MutableSourcePlan
Source§type Target = SourcePlan
type Target = SourcePlan
Source§fn deref(&self) -> &SourcePlan
fn deref(&self) -> &SourcePlan
Auto Trait Implementations§
impl !RefUnwindSafe for MutableSourcePlan
impl !UnwindSafe for MutableSourcePlan
impl Freeze for MutableSourcePlan
impl Send for MutableSourcePlan
impl Sync for MutableSourcePlan
impl Unpin for MutableSourcePlan
impl UnsafeUnpin for MutableSourcePlan
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more