pub struct CteScope<S: Clone = ()> {
pub rows: BTreeMap<String, SharedSpill>,
pub non_returning_ctes: BTreeSet<String>,
pub scalar_subqueries: Arc<[QueryPlan]>,
pub lock_identities: LockIdentityOptions,
/* private fields */
}Fields§
§rows: BTreeMap<String, SharedSpill>§non_returning_ctes: BTreeSet<String>§scalar_subqueries: Arc<[QueryPlan]>§lock_identities: LockIdentityOptionsImplementations§
Source§impl<S: Clone> CteScope<S>
impl<S: Clone> CteScope<S>
pub fn command_cte_snapshot(&self) -> Option<Arc<S>>
pub fn set_command_cte_snapshot(&mut self, snapshot: Option<Arc<S>>)
Sourcepub fn set_statement_commands(&mut self, commands: Arc<StatementCommands>)
pub fn set_statement_commands(&mut self, commands: Arc<StatementCommands>)
Make this scope part of the statement whose commands commands holds.
Sourcepub fn statement_commands(&self) -> Option<&Arc<StatementCommands>>
pub fn statement_commands(&self) -> Option<&Arc<StatementCommands>>
The commands of the statement this scope belongs to.
Sourcepub fn statement_wrote(&self, row: &PhysicalDocumentIdentity) -> bool
pub fn statement_wrote(&self, row: &PhysicalDocumentIdentity) -> bool
Whether a command of the statement this scope belongs to wrote row. A later command finds the row’s earlier version in its snapshot, which PostgreSQL reports as TM_SelfModified because the statement’s command id already modified it.
Sourcepub fn statement_triggered_write(&self, row: &PhysicalDocumentIdentity) -> bool
pub fn statement_triggered_write(&self, row: &PhysicalDocumentIdentity) -> bool
Whether a statement that the statement this scope belongs to started wrote row, which PostgreSQL finds modified under a later command id.
pub fn inherit_cte_bindings(&mut self, parent: &Self)
Sourcepub fn enter_privilege_subject(
&mut self,
subject: RoleReference,
) -> PrivilegeSubjectScope<'_, S>
pub fn enter_privilege_subject( &mut self, subject: RoleReference, ) -> PrivilegeSubjectScope<'_, S>
Override only relation privilege checks while preserving SQL-visible current_user and the caller’s namespace.
Sourcepub fn enter_relation_lookup_mode(
&mut self,
relations_bound: bool,
) -> Result<RelationLookupScope<'_, S>, SQLError>
pub fn enter_relation_lookup_mode( &mut self, relations_bound: bool, ) -> Result<RelationLookupScope<'_, S>, SQLError>
Select the namespace semantics owned by one query plan and restore the parent plan’s mode on every exit path.
pub fn insert_deferred(&mut self, plan: CtePlan)
pub fn remove_deferred(&mut self, name: &str) -> Option<CtePlan>
Sourcepub fn deferred_for_scan(&mut self, name: &str) -> Option<CtePlan>
pub fn deferred_for_scan(&mut self, name: &str) -> Option<CtePlan>
Return one deferred CTE for a scan. NOT MATERIALIZED definitions remain available so every syntactic reference is independently folded, while the default single-reference fast path is consumed exactly once.
pub fn materialized_for_scan(&self, reference: &str) -> Option<SharedSpill>
pub fn deferred_reference(&self, reference: &str) -> Option<&CtePlan>
pub fn deferred_ctes(&self) -> &BTreeMap<String, Arc<CtePlan>>
pub fn recursive_control_width(&self, name: &str) -> Option<usize>
pub fn set_recursive_control_width( &mut self, name: String, width: usize, ) -> Option<usize>
pub fn restore_recursive_control_width( &mut self, name: &str, previous: Option<usize>, )
pub fn remove_materialized(&mut self, name: &str) -> Option<SharedSpill>
Sourcepub fn enter_scalar_subqueries(
&mut self,
subqueries: &[QueryPlan],
) -> ScalarSubqueryScope<'_, S>
pub fn enter_scalar_subqueries( &mut self, subqueries: &[QueryPlan], ) -> ScalarSubqueryScope<'_, S>
Bind the scalar-subquery arena owned by one query block. The guard restores the parent arena on success, error, or panic so nested and lateral query execution cannot resolve a child slot in its parent.
pub fn enter_visible_ctes<'a>( &'a mut self, names: impl IntoIterator<Item = &'a str>, ) -> VisibleCteScope<'a, S>
Sourcepub fn is_visible_cte(&self, name: &str) -> bool
pub fn is_visible_cte(&self, name: &str) -> bool
Whether name resolves to a CTE in this scope: a name declared by an enclosing query’s WITH list, or one whose rows or deferred plan are bound in the scope, which is how a DML statement’s own WITH list reaches the query it drives.
pub fn returning_statement_snapshot_scope(&self) -> Self
pub fn reads_command_overlay(&self) -> bool
pub fn enable_command_progress_streaming(&mut self)
pub fn streams_command_progress(&self) -> bool
pub fn enable_backwards_scanning(&mut self)
pub fn scans_backwards(&self) -> bool
Source§impl<S: Clone> CteScope<S>
impl<S: Clone> CteScope<S>
Sourcepub fn activate_row_lock_recheck(&mut self, pins: Arc<RowLockRecheckPins>)
pub fn activate_row_lock_recheck(&mut self, pins: Arc<RowLockRecheckPins>)
Enter one tuple-local recheck execution: base scans of pinned lock targets emit only the candidate’s tuples and every nested LockRows is suppressed while lock identities keep flowing.
pub fn row_lock_recheck_active(&self) -> bool
Sourcepub fn set_row_lock_outer_row(&mut self, row: OwnedPhysicalRow)
pub fn set_row_lock_outer_row(&mut self, row: OwnedPhysicalRow)
Preserve the complete correlated outer row for a tuple-local locking recheck. The rebuilt inner query must receive the same scope overlay as its original lateral execution or its correlation predicate would see NULL after a lock wait and incorrectly discard the refreshed tuple.
pub fn row_lock_outer_row(&self) -> Option<&OwnedPhysicalRow>
pub fn clear_row_lock_outer_row(&mut self)
Sourcepub fn recheck_docs_for_scan(
&self,
qualifier: &str,
storage_name: &str,
) -> Option<Arc<Vec<RecheckDoc>>>
pub fn recheck_docs_for_scan( &self, qualifier: &str, storage_name: &str, ) -> Option<Arc<Vec<RecheckDoc>>>
Pinned tuples one base scan must emit during an active recheck.
Sourcepub fn recheck_source_row(&self, path: &[u8]) -> Option<RecheckSourceRow>
pub fn recheck_source_row(&self, path: &[u8]) -> Option<RecheckSourceRow>
Exact copy-row mark for one top-level FROM leaf in the active tuple recheck. Paths use 0/1 for left/right join descent and are scoped to the original LockRows source, so nested query aliases cannot collide.
Sourcepub fn enter_recheck_storage_pins(
&mut self,
qualifier: &str,
) -> RecheckStoragePinScope<'_, S>
pub fn enter_recheck_storage_pins( &mut self, qualifier: &str, ) -> RecheckStoragePinScope<'_, S>
Enter the build of one identity-source lock target’s subtree so every base scan of its storage inside the derived table or view is pinned. Pins already active from an enclosing target stay active: the target’s base scans may sit below further derived-table boundaries.
pub fn enter_lock_identity_emission( &mut self, enabled: bool, ) -> LockIdentityEmissionScope<'_, S>
pub fn enter_source_row_locks( &mut self, locks: Vec<ResolvedRowLock>, ) -> SourceRowLockScope<'_, S>
pub fn source_row_lock_for_view( &self, qualifier: &str, storage_name: &str, ) -> Option<ResolvedRowLock>
Source§impl<S: Clone> CteScope<S>
impl<S: Clone> CteScope<S>
Sourcepub fn with_catalog(
catalog: CatalogReadView,
resolution: RelationNameResolution,
privilege_subject: Option<RoleReference>,
) -> Self
pub fn with_catalog( catalog: CatalogReadView, resolution: RelationNameResolution, privilege_subject: Option<RoleReference>, ) -> Self
Bind immutable statement metadata while keeping the snapshot payload owned by the caller.
pub fn set_reads_command_overlay(&mut self, enabled: bool)
pub fn set_relation_lookup_mode( &mut self, mode: RelationLookupMode, ) -> Result<(), SQLError>
pub fn cached_subquery(&self, slot: usize) -> Option<ScalarSubqueryCacheEntry>
pub fn cache_subquery(&self, slot: usize, entry: ScalarSubqueryCacheEntry)
pub fn new() -> Self
pub fn catalog_read_view(&self) -> Result<CatalogReadView, SQLError>
Sourcepub fn set_catalog_revision(&mut self, source: u64, revision: u64)
pub fn set_catalog_revision(&mut self, source: u64, revision: u64)
Record the caller’s source identity and invalidation revision when it captures the catalog, independently of the immutable binding view.
pub fn catalog_revision(&self) -> Option<(u64, u64)>
pub fn relation_name_resolution( &self, ) -> Result<RelationNameResolution, SQLError>
pub fn privilege_subject(&self) -> Result<&RoleReference, SQLError>
Trait Implementations§
Source§impl<S: Clone> CorrelationRelations for CteScope<S>
impl<S: Clone> CorrelationRelations for CteScope<S>
Source§impl<S: Clone> PrivilegeCteCatalog for CteScope<S>
impl<S: Clone> PrivilegeCteCatalog for CteScope<S>
fn is_visible_cte(&self, name: &str) -> bool
fn materialized_columns(&self, name: &str) -> Option<Vec<String>>
fn deferred_reference(&self, name: &str) -> Option<&CtePlan>
fn privilege_subject(&self) -> Result<&RoleReference, SQLError>
Source§impl<S: Clone> ReturningScope for CteScope<S>
impl<S: Clone> ReturningScope for CteScope<S>
fn binding_snapshot(&self) -> Result<BindingSnapshot, SQLError>
Source§impl<S: Clone> StatementBindingScope for CteScope<S>
impl<S: Clone> StatementBindingScope for CteScope<S>
fn binding_context(&self) -> Result<BindingContext<'_>, SQLError>
Auto Trait Implementations§
impl<S = ()> !RefUnwindSafe for CteScope<S>
impl<S = ()> !UnwindSafe for CteScope<S>
impl<S> Freeze for CteScope<S>
impl<S> Send for CteScope<S>
impl<S> Sync for CteScope<S>
impl<S> Unpin for CteScope<S>
impl<S> UnsafeUnpin for CteScope<S>
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> 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