Enum sqlparser::sqlast::ASTNode [−][src]
pub enum ASTNode { SQLIdentifier(String), SQLWildcard, SQLCompoundIdentifier(Vec<String>), SQLAssignment(String, Box<ASTNode>), SQLIsNull(Box<ASTNode>), SQLIsNotNull(Box<ASTNode>), SQLBinaryExpr { left: Box<ASTNode>, op: SQLOperator, right: Box<ASTNode>, }, SQLCast { expr: Box<ASTNode>, data_type: SQLType, }, SQLNested(Box<ASTNode>), SQLUnary { operator: SQLOperator, rex: Box<ASTNode>, }, SQLLiteralLong(i64), SQLLiteralDouble(f64), SQLLiteralString(String), SQLFunction { id: String, args: Vec<ASTNode>, }, SQLOrderBy { expr: Box<ASTNode>, asc: bool, }, SQLSelect { projection: Vec<ASTNode>, relation: Option<Box<ASTNode>>, selection: Option<Box<ASTNode>>, order_by: Option<Vec<ASTNode>>, group_by: Option<Vec<ASTNode>>, having: Option<Box<ASTNode>>, limit: Option<Box<ASTNode>>, }, SQLInsert { table_name: String, columns: Vec<String>, values: Vec<Vec<ASTNode>>, }, SQLUpdate { table_name: String, columns: Vec<String>, values: Vec<ASTNode>, selection: Option<Box<ASTNode>>, }, SQLDelete { relation: Option<Box<ASTNode>>, selection: Option<Box<ASTNode>>, order_by: Option<Vec<ASTNode>>, limit: Option<Box<ASTNode>>, }, SQLCreateTable { name: String, columns: Vec<SQLColumnDef>, }, }
SQL Abstract Syntax Tree (AST)
Variants
SQLIdentifier(String)
Identifier e.g. table name or column name
SQLWildcard
Wildcard e.g. *
SQLCompoundIdentifier(Vec<String>)
Multi part identifier e.g. myschema.dbo.mytable
SQLAssignment(String, Box<ASTNode>)
Assigment e.g. name = 'Fred'
in an UPDATE statement
SQLIsNull(Box<ASTNode>)
IS NULL
expression
SQLIsNotNull(Box<ASTNode>)
IS NOT NULL
expression
SQLBinaryExpr
Binary expression e.g. 1 + 1
or foo > bar
Fields of SQLBinaryExpr
left: Box<ASTNode> | |
op: SQLOperator | |
right: Box<ASTNode> |
SQLCast
CAST an expression to a different data type e.g. CAST(foo AS VARCHAR(123))
Fields of SQLCast
expr: Box<ASTNode> | |
data_type: SQLType |
SQLNested(Box<ASTNode>)
Nested expression e.g. (foo > bar)
or (1)
SQLUnary
Unary expression
Fields of SQLUnary
operator: SQLOperator | |
rex: Box<ASTNode> |
SQLLiteralLong(i64)
Literal signed long
SQLLiteralDouble(f64)
Literal floating point value
SQLLiteralString(String)
Literal string
SQLFunction
Scalar function call e.g. LEFT(foo, 5)
Fields of SQLFunction
id: String | |
args: Vec<ASTNode> |
SQLOrderBy
Expression with ASC/DESC attribute e.g. foo ASC
or foo DESC
.=
Fields of SQLOrderBy
expr: Box<ASTNode> | |
asc: bool |
SQLSelect
SELECT
Fields of SQLSelect
projection: Vec<ASTNode> | projection expressions |
relation: Option<Box<ASTNode>> | FROM |
selection: Option<Box<ASTNode>> | WHERE |
order_by: Option<Vec<ASTNode>> | ORDER BY |
group_by: Option<Vec<ASTNode>> | GROUP BY |
having: Option<Box<ASTNode>> | HAVING |
limit: Option<Box<ASTNode>> | LIMIT |
SQLInsert
INSERT
Fields of SQLInsert
table_name: String | TABLE |
columns: Vec<String> | COLUMNS |
values: Vec<Vec<ASTNode>> | VALUES (vector of rows to insert) |
SQLUpdate
UPDATE
Fields of SQLUpdate
table_name: String | TABLE |
columns: Vec<String> | Columns being assigned |
values: Vec<ASTNode> | Values being assigned |
selection: Option<Box<ASTNode>> | WHERE |
SQLDelete
DELETE
Fields of SQLDelete
relation: Option<Box<ASTNode>> | FROM |
selection: Option<Box<ASTNode>> | WHERE |
order_by: Option<Vec<ASTNode>> | ORDER BY |
limit: Option<Box<ASTNode>> |
SQLCreateTable
CREATE TABLE
Fields of SQLCreateTable
name: String | Table name |
columns: Vec<SQLColumnDef> | Optional schema |
Trait Implementations
impl Debug for ASTNode
[src]
impl Debug for ASTNode
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for ASTNode
[src]
impl Clone for ASTNode
fn clone(&self) -> ASTNode
[src]
fn clone(&self) -> ASTNode
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl PartialEq for ASTNode
[src]
impl PartialEq for ASTNode