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
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
sourceimpl Clone for TableFactor
impl Clone for TableFactor
sourcefn clone(&self) -> TableFactor
fn clone(&self) -> TableFactor
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more