pub enum SourcePlan {
Table {
name: String,
executable_query: Option<Box<QueryPlan>>,
qualifier: String,
alias: Option<String>,
column_aliases: Vec<String>,
bound_columns: Option<Vec<String>>,
include_descendants: bool,
},
Join {
comma: bool,
left: Box<SourcePlan>,
right: Box<SourcePlan>,
kind: JoinKind,
on: Option<ScalarExpr>,
using: Option<JoinUsing>,
natural: bool,
alias: Option<String>,
column_aliases: Vec<String>,
lateral: bool,
strategy: JoinExecutionStrategy,
},
Values {
lateral: bool,
rows: Vec<Vec<ScalarExpr>>,
alias: Option<String>,
column_aliases: Vec<String>,
internal_relation: Option<InternalRelationId>,
internal_column_types: Vec<Option<ColumnType>>,
internal_column_collations: Vec<Option<u32>>,
},
Function {
name: String,
binding: Option<FunctionBinding>,
output_name: String,
relations: Option<OperatorJoinRelations>,
args: Vec<ScalarExpr>,
alias: Option<String>,
column_aliases: Vec<String>,
ordinality: bool,
column_types: Vec<String>,
},
FunctionGroup {
functions: Vec<TableFunctionPlan>,
alias: Option<String>,
column_aliases: Vec<String>,
ordinality: bool,
},
Subquery {
captured_output: Option<InternalRelationId>,
lateral: bool,
body: Box<QueryPlan>,
alias: Option<String>,
column_aliases: Vec<String>,
},
// some variants omitted
}Expand description
The row-producing source below a query block.
Variants§
Table
Fields
Join
Fields
left: Box<SourcePlan>right: Box<SourcePlan>on: Option<ScalarExpr>strategy: JoinExecutionStrategyValues
Function
Fields
binding: Option<FunctionBinding>relations: Option<OperatorJoinRelations>args: Vec<ScalarExpr>FunctionGroup
Fields
functions: Vec<TableFunctionPlan>Subquery
Implementations§
Source§impl SourcePlan
impl 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.
Source§impl SourcePlan
impl SourcePlan
pub fn copy_for_rewrite( &self, control: &ProductionControl<'_>, ) -> Result<MutableSourcePlan, SQLError>
Source§impl SourcePlan
impl SourcePlan
pub fn copy_function_group_member_for_rewrite( &self, index: usize, control: &ProductionControl<'_>, ) -> Result<MutableSourcePlan, SQLError>
Source§impl SourcePlan
impl SourcePlan
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>)>)
Source§impl SourcePlan
impl SourcePlan
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>
Source§impl SourcePlan
impl SourcePlan
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 Clone for SourcePlan
impl Clone for SourcePlan
Source§impl Debug for SourcePlan
impl Debug for SourcePlan
Source§impl<'de> Deserialize<'de> for SourcePlan
impl<'de> Deserialize<'de> for SourcePlan
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl ObserveAllocations for SourcePlan
impl ObserveAllocations for SourcePlan
fn observe_allocations<'a>( &'a self, observer: &mut AllocationObserver<'a, '_>, ) -> Result<(), ValueRetentionError>
Auto Trait Implementations§
impl !RefUnwindSafe for SourcePlan
impl !UnwindSafe for SourcePlan
impl Freeze for SourcePlan
impl Send for SourcePlan
impl Sync for SourcePlan
impl Unpin for SourcePlan
impl UnsafeUnpin for SourcePlan
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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