Skip to main content

MutableSourcePlan

Struct MutableSourcePlan 

Source
pub struct MutableSourcePlan { /* private fields */ }
Expand description

A source whose child and scalar constructor records follow consuming edits.

Implementations§

Source§

impl MutableSourcePlan

Source

pub fn unit(control: &ProductionControl<'_>) -> Result<Self, SQLError>

Construct the one-row zero-column relation used by a scalar projection.

Source

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

Source

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

Source

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.

Source

pub fn captured_values( values: impl ExactSizeIterator<Item = OwnedScalarExpr>, relation: InternalRelationId, control: &ProductionControl<'_>, ) -> Result<Self, SQLError>

Source

pub fn cross_join( left: Self, right: Self, lateral: bool, control: &ProductionControl<'_>, ) -> Result<Self, SQLError>

Source§

impl MutableSourcePlan

Source

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

Source

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.

Source

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

Source

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

Source

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.

Source

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

Source

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.

Source

pub fn replace_table_reference( self, name: Option<Produced<String>>, qualifier: Option<Produced<String>>, control: &ProductionControl<'_>, ) -> Result<Self, SQLError>

Source

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

Source

pub fn reserved_bytes(&self) -> usize

Source

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.

Source

pub fn map_scalar( self, slot: SourceScalarSlot, control: &ProductionControl<'_>, map: impl FnOnce(OwnedScalarExpr) -> Result<OwnedScalarExpr, SQLError>, ) -> Result<Self, SQLError>

Source

pub fn map_child( self, slot: SourceChildSlot, control: &ProductionControl<'_>, map: impl FnOnce(Self) -> Result<Self, SQLError>, ) -> Result<Self, SQLError>

Source

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>§

Source

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.

Source

pub fn copy_for_rewrite( &self, control: &ProductionControl<'_>, ) -> Result<MutableSourcePlan, SQLError>

Source

pub fn copy_function_group_member_for_rewrite( &self, index: usize, control: &ProductionControl<'_>, ) -> Result<MutableSourcePlan, SQLError>

Source

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.

Source

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.

Source

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.

Source

pub fn collect_tables(&self, output: &mut Vec<(String, Option<String>)>)

Source

pub fn is_explicitly_lateral(&self) -> bool

Explicit LATERAL permission retained by a range item independently of its parent join.

Source

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.

Source

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.

Source

pub fn internal_values_schema_with_control( &self, inferred: Option<&RowSchema>, control: &ProductionControl<'_>, ) -> Result<Option<RowSchema>, SQLError>

Source

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.

Source

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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Deref for MutableSourcePlan

Source§

type Target = SourcePlan

The resulting type after dereferencing.
Source§

fn deref(&self) -> &SourcePlan

Dereferences the value.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.