Enum sqlparser::ast::TableFactor
source · 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
Fields
alias: Option<TableAlias>
SELECT * FROM UNNEST ([10,20,30]) as numbers WITH OFFSET; +———+––––+ | numbers | offset | +———+––––+ | 10 | 0 | | 20 | 1 | | 30 | 2 | +———+––––+
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
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for TableFactor
impl Debug for TableFactor
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,
source§impl PartialEq<TableFactor> for TableFactor
impl PartialEq<TableFactor> for TableFactor
source§fn eq(&self, other: &TableFactor) -> bool
fn eq(&self, other: &TableFactor) -> bool
source§impl PartialOrd<TableFactor> for TableFactor
impl PartialOrd<TableFactor> for TableFactor
source§fn partial_cmp(&self, other: &TableFactor) -> Option<Ordering>
fn partial_cmp(&self, other: &TableFactor) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more