pub struct MutableCommandPlan { /* private fields */ }Implementations§
Source§impl MutableCommandPlan
impl MutableCommandPlan
Sourcepub fn prune_subqueries(
self,
control: &ProductionControl<'_>,
) -> Result<Self, SQLError>
pub fn prune_subqueries( self, control: &ProductionControl<'_>, ) -> Result<Self, SQLError>
Compact a mutation’s scalar-query arena using its existing source-then-expression namespace remapping. Command CTEs and retained source queries keep their independent owners.
Source§impl MutableCommandPlan
impl MutableCommandPlan
Sourcepub fn map_insert_target(
self,
index: usize,
control: &ProductionControl<'_>,
map: impl FnMut(OwnedScalarExpr, &ProductionControl<'_>) -> Result<OwnedScalarExpr, SQLError>,
) -> Result<Self, SQLError>
pub fn map_insert_target( self, index: usize, control: &ProductionControl<'_>, map: impl FnMut(OwnedScalarExpr, &ProductionControl<'_>) -> Result<OwnedScalarExpr, SQLError>, ) -> Result<Self, SQLError>
Rewrite a selected INSERT target’s bounds without moving its column name or the other targets.
Sourcepub fn map_assignment_value(
self,
slot: CommandAssignmentSlot,
control: &ProductionControl<'_>,
map: impl FnMut(OwnedScalarExpr) -> Result<OwnedScalarExpr, SQLError>,
) -> Result<Self, SQLError>
pub fn map_assignment_value( self, slot: CommandAssignmentSlot, control: &ProductionControl<'_>, map: impl FnMut(OwnedScalarExpr) -> Result<OwnedScalarExpr, SQLError>, ) -> Result<Self, SQLError>
Rewrite only the value of a selected assignment. Target bounds remain with their original execution boundary and are never visited by this operation.
Sourcepub fn map_assignment(
self,
slot: CommandAssignmentSlot,
control: &ProductionControl<'_>,
map: impl FnMut(OwnedScalarExpr) -> Result<OwnedScalarExpr, SQLError>,
) -> Result<Self, SQLError>
pub fn map_assignment( self, slot: CommandAssignmentSlot, control: &ProductionControl<'_>, map: impl FnMut(OwnedScalarExpr) -> Result<OwnedScalarExpr, SQLError>, ) -> Result<Self, SQLError>
Rewrite every bound followed by the value of one assignment, preserving grouped-target order and admitting each replacement independently.
Source§impl MutableCommandPlan
impl MutableCommandPlan
Sourcepub fn map_assignment_columns(
self,
slot: CommandAssignmentSlot,
control: &ProductionControl<'_>,
map: impl FnMut(&str) -> Result<Produced<String>, SQLError>,
) -> Result<Self, SQLError>
pub fn map_assignment_columns( self, slot: CommandAssignmentSlot, control: &ProductionControl<'_>, map: impl FnMut(&str) -> Result<Produced<String>, SQLError>, ) -> Result<Self, SQLError>
Retarget names independently of assignment bounds and values.
Source§impl MutableCommandPlan
impl MutableCommandPlan
pub fn map_query_child( self, slot: CommandQuerySlot, control: &ProductionControl<'_>, map: impl FnOnce(MutableQueryPlan) -> Result<MutableQueryPlan, SQLError>, ) -> Result<Self, SQLError>
Sourcepub fn map_query_child_with_parent(
self,
slot: CommandQuerySlot,
control: &ProductionControl<'_>,
map: impl FnOnce(&CommandPlan, MutableQueryPlan) -> Result<MutableQueryPlan, SQLError>,
) -> Result<Self, SQLError>
pub fn map_query_child_with_parent( self, slot: CommandQuerySlot, control: &ProductionControl<'_>, map: impl FnOnce(&CommandPlan, MutableQueryPlan) -> Result<MutableQueryPlan, SQLError>, ) -> Result<Self, SQLError>
Rewrite a command-owned query while observing the command’s unchanged namespace. The selected query temporarily becomes empty in its original container.
pub fn map_source( self, control: &ProductionControl<'_>, map: impl FnOnce(MutableSourcePlan) -> Result<MutableSourcePlan, SQLError>, ) -> Result<Self, SQLError>
Sourcepub fn map_source_with_parent(
self,
control: &ProductionControl<'_>,
map: impl FnOnce(&CommandPlan, MutableSourcePlan) -> Result<MutableSourcePlan, SQLError>,
) -> Result<Self, SQLError>
pub fn map_source_with_parent( self, control: &ProductionControl<'_>, map: impl FnOnce(&CommandPlan, MutableSourcePlan) -> Result<MutableSourcePlan, SQLError>, ) -> Result<Self, SQLError>
Rewrite UPDATE/DELETE/MERGE’s source without copying its command-owned box or scalar siblings.
Source§impl MutableCommandPlan
impl MutableCommandPlan
Sourcepub fn finish_inference_columns(
self,
control: &ProductionControl<'_>,
) -> Result<Produced<CommandPlan>, SQLError>
pub fn finish_inference_columns( self, control: &ProductionControl<'_>, ) -> Result<Produced<CommandPlan>, SQLError>
Finish inference normalization after all expression edits. Existing names retain their order; newly simple columns follow in expression order, including duplicates.
Source§impl MutableCommandPlan
impl MutableCommandPlan
Sourcepub fn set_explain_parameters(
self,
parameters: Option<Produced<Vec<SQLParam>>>,
control: &ProductionControl<'_>,
) -> Result<Self, SQLError>
pub fn set_explain_parameters( self, parameters: Option<Produced<Vec<SQLParam>>>, control: &ProductionControl<'_>, ) -> Result<Self, SQLError>
Replace only EXPLAIN’s inferred parameter owner after its body analysis succeeds.
Sourcepub fn map_executable_body(
self,
control: &ProductionControl<'_>,
map: impl FnOnce(MutableExecutablePlan) -> Result<MutableExecutablePlan, SQLError>,
) -> Result<Self, SQLError>
pub fn map_executable_body( self, control: &ProductionControl<'_>, map: impl FnOnce(MutableExecutablePlan) -> Result<MutableExecutablePlan, SQLError>, ) -> Result<Self, SQLError>
Rewrite EXPLAIN or PREPARE’s complete nested statement without moving its wrapper metadata or changing the query/command variant.
Source§impl MutableCommandPlan
impl MutableCommandPlan
Sourcepub fn map_source_input(
self,
control: &ProductionControl<'_>,
map: impl FnOnce(Option<MutableSourcePlan>) -> Result<Option<MutableSourcePlan>, SQLError>,
) -> Result<Self, SQLError>
pub fn map_source_input( self, control: &ProductionControl<'_>, map: impl FnOnce(Option<MutableSourcePlan>) -> Result<Option<MutableSourcePlan>, SQLError>, ) -> Result<Self, SQLError>
Edit an UPDATE/DELETE input, including installation where no FROM/USING clause existed. A retained source reuses its original command-owned box.
Sourcepub fn map_predicate_input(
self,
control: &ProductionControl<'_>,
map: impl FnOnce(Option<OwnedScalarExpr>, &mut ScalarQueryArena) -> Result<Option<OwnedScalarExpr>, SQLError>,
) -> Result<Self, SQLError>
pub fn map_predicate_input( self, control: &ProductionControl<'_>, map: impl FnOnce(Option<OwnedScalarExpr>, &mut ScalarQueryArena) -> Result<Option<OwnedScalarExpr>, SQLError>, ) -> Result<Self, SQLError>
Edit a possibly absent qualification together with its original scalar-query namespace. The callback owns the detached scalar; new query occurrences are admitted by the arena before attachment.
Source§impl MutableCommandPlan
impl MutableCommandPlan
pub fn map_insert_source( self, control: &ProductionControl<'_>, map: impl FnOnce(&InsertPlan, Option<MutableQueryPlan>) -> Result<MutableQueryPlan, SQLError>, ) -> Result<Self, SQLError>
pub fn set_implicit_insert_columns<'a>( self, names: impl ExactSizeIterator<Item = &'a str>, control: &ProductionControl<'_>, ) -> Result<Self, SQLError>
pub fn set_rule_values_input( self, input: Produced<RuleValuesInput>, control: &ProductionControl<'_>, ) -> Result<Self, SQLError>
Sourcepub fn retain_insert_columns(
self,
control: &ProductionControl<'_>,
keep: impl FnMut(usize, &AssignmentTarget<ScalarExpr>) -> Result<bool, SQLError>,
) -> Result<Self, SQLError>
pub fn retain_insert_columns( self, control: &ProductionControl<'_>, keep: impl FnMut(usize, &AssignmentTarget<ScalarExpr>) -> Result<bool, SQLError>, ) -> Result<Self, SQLError>
Keep selected target columns in their original buffer, moving each indirection owner with its name and retiring only removed payloads.
Sourcepub fn take_insert_rows_query(
self,
control: &ProductionControl<'_>,
) -> Result<(Self, MutableQueryPlan), SQLError>
pub fn take_insert_rows_query( self, control: &ProductionControl<'_>, ) -> Result<(Self, MutableQueryPlan), SQLError>
VALUES leave the command without a payload copy. The command retains its own scalar-query namespace for RETURNING and assignment targets; the new query admits its independent namespace copy.
Source§impl MutableCommandPlan
impl MutableCommandPlan
pub fn set_target_privilege_subject( self, subject: Produced<RoleReference>, control: &ProductionControl<'_>, ) -> Result<Self, SQLError>
pub fn retarget_mutation( self, target: Produced<String>, include_descendants: bool, control: &ProductionControl<'_>, ) -> Result<Self, SQLError>
pub fn clear_mutation_ctes( self, control: &ProductionControl<'_>, ) -> Result<Self, SQLError>
pub fn record_view_rule_relation( self, relation: &str, control: &ProductionControl<'_>, ) -> Result<Self, SQLError>
pub fn preserve_view_rule_returning( self, relation: &str, control: &ProductionControl<'_>, ) -> Result<Self, SQLError>
Source§impl MutableCommandPlan
impl MutableCommandPlan
pub fn map_scalar_input( self, slot: CommandScalarSlot, control: &ProductionControl<'_>, map: impl FnOnce(OwnedScalarExpr, &mut ScalarQueryArena) -> Result<OwnedScalarExpr, SQLError>, ) -> Result<Self, SQLError>
pub fn map_assignment_input( self, slot: CommandAssignmentSlot, control: &ProductionControl<'_>, map: impl FnMut(OwnedScalarExpr, &mut ScalarQueryArena) -> Result<OwnedScalarExpr, SQLError>, ) -> Result<Self, SQLError>
pub fn map_mutation_arena( self, control: &ProductionControl<'_>, map: impl FnOnce(&CommandPlan, &mut ScalarQueryArena) -> Result<(), SQLError>, ) -> Result<Self, SQLError>
Source§impl MutableCommandPlan
impl MutableCommandPlan
pub fn replace_returning_alias( self, index: usize, alias: Option<Produced<String>>, control: &ProductionControl<'_>, ) -> Result<Self, SQLError>
Source§impl MutableCommandPlan
impl MutableCommandPlan
Sourcepub fn map_returning_inputs<I: ExactSizeIterator<Item = OwnedProjection>>(
self,
control: &ProductionControl<'_>,
map: impl FnOnce(&CommandPlan, OwnedProjectionIter, &mut ScalarQueryArena) -> Result<I, SQLError>,
) -> Result<Self, SQLError>
pub fn map_returning_inputs<I: ExactSizeIterator<Item = OwnedProjection>>( self, control: &ProductionControl<'_>, map: impl FnOnce(&CommandPlan, OwnedProjectionIter, &mut ScalarQueryArena) -> Result<I, SQLError>, ) -> Result<Self, SQLError>
Rewrite RETURNING projections and append embedded queries to the same admitted arena.
Source§impl MutableCommandPlan
impl MutableCommandPlan
Sourcepub fn discard_rule_rows(
self,
control: &ProductionControl<'_>,
) -> Result<Self, SQLError>
pub fn discard_rule_rows( self, control: &ProductionControl<'_>, ) -> Result<Self, SQLError>
Remove a suppressed mutation’s row source and query dependencies while retaining the capacities of cleared inline vectors.
Sourcepub fn prune_rule_assignments(
self,
required: &dyn Fn(&str) -> bool,
control: &ProductionControl<'_>,
) -> Result<Self, SQLError>
pub fn prune_rule_assignments( self, required: &dyn Fn(&str) -> bool, control: &ProductionControl<'_>, ) -> Result<Self, SQLError>
Split wholly unused grouped assignments into their surviving single target descriptors and replace every discarded bound/value with NULL.
Source§impl MutableCommandPlan
impl MutableCommandPlan
pub fn transform_scalar_nodes( self, control: &ProductionControl<'_>, transform: &mut ScalarNodeTransform<'_>, ) -> Result<Self, SQLError>
Source§impl MutableCommandPlan
impl MutableCommandPlan
pub fn map_insert_column( self, index: usize, control: &ProductionControl<'_>, map: impl FnMut(&str) -> Result<Produced<String>, SQLError>, ) -> Result<Self, SQLError>
pub fn map_merge_insert_column( self, clause: usize, index: usize, control: &ProductionControl<'_>, map: impl FnMut(&str) -> Result<Produced<String>, SQLError>, ) -> Result<Self, SQLError>
pub fn set_implicit_merge_columns<'a>( self, clause: usize, names: impl ExactSizeIterator<Item = &'a str>, control: &ProductionControl<'_>, ) -> Result<Self, SQLError>
pub fn map_conflict_columns( self, control: &ProductionControl<'_>, map: impl FnMut(&str) -> Result<Produced<String>, SQLError>, ) -> Result<Self, SQLError>
Source§impl MutableCommandPlan
impl MutableCommandPlan
pub fn prepend_view_check( self, view: Produced<String>, control: &ProductionControl<'_>, predicate: impl FnOnce(&mut ScalarQueryArena) -> Result<OwnedScalarExpr, SQLError>, ) -> Result<Self, SQLError>
pub fn record_view_update_inputs( self, relation: &str, control: &ProductionControl<'_>, ) -> Result<Self, SQLError>
pub fn finalize_view_update_inputs( self, control: &ProductionControl<'_>, ) -> Result<Self, SQLError>
pub fn record_view_insert_inputs( self, relation: &str, control: &ProductionControl<'_>, ) -> Result<Self, SQLError>
pub fn finalize_view_insert_inputs( self, control: &ProductionControl<'_>, ) -> Result<Self, SQLError>
Source§impl MutableCommandPlan
impl MutableCommandPlan
pub fn reserved_bytes(&self) -> usize
Sourcepub fn map_scalar(
self,
slot: CommandScalarSlot,
control: &ProductionControl<'_>,
map: impl FnOnce(OwnedScalarExpr) -> Result<OwnedScalarExpr, SQLError>,
) -> Result<Self, SQLError>
pub fn map_scalar( self, slot: CommandScalarSlot, control: &ProductionControl<'_>, map: impl FnOnce(OwnedScalarExpr) -> Result<OwnedScalarExpr, SQLError>, ) -> Result<Self, SQLError>
Rewrite one scalar root without changing the statement’s other inputs or its diagnostic order.
Sourcepub fn map_query_body(
self,
control: &ProductionControl<'_>,
map: impl FnOnce(MutableQueryPlan) -> Result<MutableQueryPlan, SQLError>,
) -> Result<Self, SQLError>
pub fn map_query_body( self, control: &ProductionControl<'_>, map: impl FnOnce(MutableQueryPlan) -> Result<MutableQueryPlan, SQLError>, ) -> Result<Self, SQLError>
Rewrite a retained query body while preserving its original enclosing box. EXPLAIN option interpretation and utility execution remain with their existing owners.
pub fn finish( self, control: &ProductionControl<'_>, ) -> Result<Produced<CommandPlan>, SQLError>
Source§impl MutableCommandPlan
impl MutableCommandPlan
Sourcepub fn map_cte(
self,
index: usize,
control: &ProductionControl<'_>,
map: impl FnOnce(MutableExecutablePlan) -> Result<MutableExecutablePlan, SQLError>,
) -> Result<Self, SQLError>
pub fn map_cte( self, index: usize, control: &ProductionControl<'_>, map: impl FnOnce(MutableExecutablePlan) -> Result<MutableExecutablePlan, SQLError>, ) -> Result<Self, SQLError>
Rewrite a data-modifying command’s CTE without copying its declaration or enclosing box.
Source§impl MutableCommandPlan
impl MutableCommandPlan
pub fn map_queries_while( self, control: &ProductionControl<'_>, visit: &mut (dyn FnMut(MutableQueryPlan) -> Result<(MutableQueryPlan, bool), SQLError> + '_), ) -> Result<Self, SQLError>
Source§impl MutableCommandPlan
impl MutableCommandPlan
pub fn normalize_window_definitions( self, control: &ProductionControl<'_>, ) -> Result<Self, SQLError>
Methods from Deref<Target = CommandPlan>§
Sourcepub fn query_inputs(&self) -> impl Iterator<Item = &QueryPlan>
pub fn query_inputs(&self) -> impl Iterator<Item = &QueryPlan>
Borrow query children evaluated in the command’s WITH scope without collecting a child list. INSERT’s source precedes the scalar-query arena. Source-plan subqueries are owned by source_input; visitors should not traverse either owner twice.
pub fn source_input(&self) -> Option<&SourcePlan>
pub fn mutation_target(&self) -> Option<&str>
pub fn returning(&self) -> Option<&[ProjectionPlan]>
pub fn scalar_subqueries(&self) -> &[QueryPlan]
pub fn target_qualifier(&self) -> Option<&str>
pub fn returning_aliases(&self) -> Option<&ReturningAliases>
Sourcepub fn expressions(&self) -> impl Iterator<Item = &ScalarExpr>
pub fn expressions(&self) -> impl Iterator<Item = &ScalarExpr>
Scalar roots owned by this mutation, excluding its relational children.
Sourcepub fn copy_for_rewrite(
&self,
control: &ProductionControl<'_>,
) -> Result<MutableCommandPlan, SQLError>
pub fn copy_for_rewrite( &self, control: &ProductionControl<'_>, ) -> Result<MutableCommandPlan, SQLError>
Copy complete command syntax while retaining independently replaceable executable fields. Utility syntax remains with this command owner and is not evaluated by copying.
pub fn name(&self) -> &'static str
Sourcepub fn visit_scalar_expressions(&self, visit: &mut dyn FnMut(&ScalarExpr))
pub fn visit_scalar_expressions(&self, visit: &mut dyn FnMut(&ScalarExpr))
Visit scalar roots without copying the plan or collecting its children. Mutations retain their analysis order: CTEs, direct expressions, query inputs, then source inputs. Query-bearing utilities share the scalar rewrite’s ownership boundary.
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 MutableCommandPlan
impl Debug for MutableCommandPlan
Source§impl Deref for MutableCommandPlan
impl Deref for MutableCommandPlan
Source§type Target = CommandPlan
type Target = CommandPlan
Source§fn deref(&self) -> &CommandPlan
fn deref(&self) -> &CommandPlan
Auto Trait Implementations§
impl !RefUnwindSafe for MutableCommandPlan
impl !UnwindSafe for MutableCommandPlan
impl Freeze for MutableCommandPlan
impl Send for MutableCommandPlan
impl Sync for MutableCommandPlan
impl Unpin for MutableCommandPlan
impl UnsafeUnpin for MutableCommandPlan
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