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<Located<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
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
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<TableFactor> for TableFactor
impl PartialEq<TableFactor> for TableFactor
source§fn eq(&self, other: &TableFactor) -> bool
fn eq(&self, other: &TableFactor) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.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
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more