pub struct Scope { /* private fields */ }Expand description
A name scope for query resolution. Scopes nest for subqueries and CTEs.
Implementations§
Source§impl Scope
impl Scope
Sourcepub fn add_alias(
&mut self,
alias: &str,
table_name: &str,
columns: Option<HashSet<String>>,
)
pub fn add_alias( &mut self, alias: &str, table_name: &str, columns: Option<HashSet<String>>, )
Register a table alias with its columns.
Sourcepub fn has_alias(&self, alias: &str) -> bool
pub fn has_alias(&self, alias: &str) -> bool
Check if an alias is visible in this scope (or parent scopes).
Sourcepub fn resolve_column(
&self,
table_qualifier: Option<&str>,
column_name: &str,
) -> ResolveResult
pub fn resolve_column( &self, table_qualifier: Option<&str>, column_name: &str, ) -> ResolveResult
Resolve a column reference: find which alias provides it.
If table_qualifier is Some, checks only that alias.
If None, searches all visible aliases for the column name.
Returns the resolved (alias, column_name) or None.
Sourcepub fn alias_count(&self) -> usize
pub fn alias_count(&self) -> usize
Number of aliases registered in this scope (not counting parents).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Scope
impl RefUnwindSafe for Scope
impl Send for Scope
impl Sync for Scope
impl Unpin for Scope
impl UnsafeUnpin for Scope
impl UnwindSafe for Scope
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
Mutably borrows from an owned value. Read more