Enum TableRef
pub enum TableRef {
Cte {
nesting: usize,
index: usize,
},
Derived(TableDerived),
Table(TableId),
Arg(ExprArg),
}Expand description
A reference to a table within a SourceTable.
Each entry in SourceTable::tables is a TableRef
that identifies where data comes from: a schema table, a CTE, a derived
subquery, or a placeholder argument.
§Examples
ⓘ
use toasty_core::stmt::TableRef;
use toasty_core::schema::db::TableId;
let table_ref = TableRef::Table(TableId(0));
assert!(table_ref.references(TableId(0)));
assert!(!table_ref.is_cte());Variants§
Cte
A reference to a CTE defined in a WITH clause.
Fields
§
index: usizeThe index of the CTE within the With::ctes vector.
Derived(TableDerived)
A derived table (inline subquery).
Table(TableId)
A schema-defined table.
Arg(ExprArg)
A placeholder that will be replaced with a derived table at a later compilation stage.
Implementations§
Trait Implementations§
impl StructuralPartialEq for TableRef
Auto Trait Implementations§
impl Freeze for TableRef
impl RefUnwindSafe for TableRef
impl Send for TableRef
impl Sync for TableRef
impl Unpin for TableRef
impl UnwindSafe for TableRef
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