pub enum TableFactor {
Table {
name: ObjectName,
alias: Option<TableAlias>,
args: Option<Vec<FunctionArg>>,
with_hints: Vec<Expr>,
},
Derived {
lateral: bool,
subquery: Box<Query>,
alias: Option<TableAlias>,
},
TableFunction {
expr: Expr,
alias: Option<TableAlias>,
},
UNNEST {
alias: Option<TableAlias>,
array_expr: Box<Expr>,
with_offset: bool,
with_offset_alias: Option<Ident>,
},
NestedJoin {
table_with_joins: Box<TableWithJoins>,
alias: Option<TableAlias>,
},
}
Expand description
A table name or a parenthesized subquery with an optional alias
Variants§
Table
Fields
§
name: ObjectName
§
alias: Option<TableAlias>
§
args: Option<Vec<FunctionArg>>
Arguments of a table-valued function, as supported by Postgres
and MSSQL. Note that deprecated MSSQL FROM foo (NOLOCK)
syntax
will also be parsed as args
.
This field’s value is Some(v)
, where v
is a (possibly empty)
vector of arguments, in the case of a table-valued function call,
whereas it’s None
in the case of a regular table name.
Derived
TableFunction
TABLE(<expr>)[ AS <alias> ]
UNNEST
SELECT * FROM UNNEST ([10,20,30]) as numbers WITH OFFSET;
+---------+--------+
| numbers | offset |
+---------+--------+
| 10 | 0 |
| 20 | 1 |
| 30 | 2 |
+---------+--------+
Fields
§
alias: Option<TableAlias>
NestedJoin
Represents a parenthesized table factor. The SQL spec only allows a
join expression ((foo <JOIN> bar [ <JOIN> baz ... ])
) to be nested,
possibly several times.
The parser may also accept non-standard nesting of bare tables for some dialects, but the information about such nesting is stripped from AST.
Trait Implementations§
Source§impl Clone for TableFactor
impl Clone for TableFactor
Source§fn clone(&self) -> TableFactor
fn clone(&self) -> TableFactor
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TableFactor
impl Debug for TableFactor
Source§impl<'de> Deserialize<'de> for TableFactor
impl<'de> Deserialize<'de> for TableFactor
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for TableFactor
impl Display for TableFactor
Source§impl Hash for TableFactor
impl Hash for TableFactor
Source§impl Ord for TableFactor
impl Ord for TableFactor
Source§fn cmp(&self, other: &TableFactor) -> Ordering
fn cmp(&self, other: &TableFactor) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for TableFactor
impl PartialEq for TableFactor
Source§impl PartialOrd for TableFactor
impl PartialOrd for TableFactor
Source§impl Serialize for TableFactor
impl Serialize for TableFactor
Source§impl Visit for TableFactor
impl Visit for TableFactor
Source§impl VisitMut for TableFactor
impl VisitMut for TableFactor
fn visit<V: VisitorMut>(&mut self, visitor: &mut V) -> ControlFlow<V::Break>
impl Eq for TableFactor
impl StructuralPartialEq for TableFactor
Auto Trait Implementations§
impl Freeze for TableFactor
impl RefUnwindSafe for TableFactor
impl Send for TableFactor
impl Sync for TableFactor
impl Unpin for TableFactor
impl UnwindSafe for TableFactor
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