Skip to main content

OwnedQueryPlan

Struct OwnedQueryPlan 

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

A relational executable projected from its statement owner. Retaining the original root box avoids copying its payload or releasing a charged box while its reservation is still attached to the query.

Implementations§

Source§

impl OwnedQueryPlan

Source

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

Admit the enclosing box for an existing query without retroactively charging its payload.

Source

pub fn from_produced( query: Produced<QueryPlan>, control: &ProductionControl<'_>, ) -> Result<Self, SQLError>

Preserve an admitted query body and admit its enclosing box before allocating it.

Source

pub fn from_parts( query: Box<QueryPlan>, memory: impl Into<ExecutableMemory>, ) -> Self

Transfer an existing root box together with its constructor reservations.

Source

pub fn reserved_bytes(&self) -> usize

Source

pub fn into_parts(self) -> (Box<QueryPlan>, ExecutableMemory)

Specialized query preparation must keep this pair together and admit its additional source attachments before construction.

Source

pub fn into_unboxed(self) -> (QueryPlan, ExecutableMemory)

Move the query into an enclosing owner whose representation has no root box. Release that box’s own lease only after freeing it; the caller must retain the returned storage leases with the query.

Source

pub fn into_executable(self) -> OwnedExecutablePlan

Methods from Deref<Target = QueryPlan>§

Source

pub fn copy_with_set_inputs( &self, left: OwnedQueryPlan, right: OwnedQueryPlan, control: &ProductionControl<'_>, ) -> Result<OwnedQueryPlan, SQLError>

Retain a set operation’s declarations and clauses while transferring both independently optimized query inputs.

Source

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

Copy the primary query after its WITH definitions have been installed in the lexical scope. Excluded declarations are never allocated; all primary metadata and nested query scopes retain their meaning.

Source

pub fn set_ordering_with_control( &self, control: &ProductionControl<'_>, ) -> Result<Produced<QueryBlockPlan>, SQLError>

Produce the ordering/slicing block of a set operation without copying either operand. Scalar-query slots remain in the same order as their original expressions.

Source

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

Copy a relational executable and its query/mutation CTEs, admitting destination capacities and owned payloads before allocation. Immutable analysis descriptors and retained row/literal identities remain shared.

Source

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

Copy a complete query while keeping mutable constructor ownership separate. Every destination and ownership-record buffer is admitted before allocation; published immutable schemas retain their original shared owners.

Source

pub fn visit_sources(&self, visit: &mut dyn FnMut(&SourcePlan))

Source

pub fn visit_scalar_expressions(&self, visit: &mut dyn FnMut(&ScalarExpr))

Visit every scalar expression this query owns, each root once, including those of its CTEs, relational sources and scalar subqueries.

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 AsRef<QueryPlan> for OwnedQueryPlan

Source§

fn as_ref(&self) -> &QueryPlan

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Debug for OwnedQueryPlan

Source§

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

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

impl Deref for OwnedQueryPlan

Source§

type Target = QueryPlan

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

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.