Enum sqlparser::sqlast::ASTNode[][src]

pub enum ASTNode {
    SQLIdentifier(String),
    SQLWildcard,
    SQLCompoundIdentifier(Vec<String>),
    SQLAssignment(StringBox<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

Identifier e.g. table name or column name

Wildcard e.g. *

Multi part identifier e.g. myschema.dbo.mytable

Assigment e.g. name = 'Fred' in an UPDATE statement

IS NULL expression

IS NOT NULL expression

Binary expression e.g. 1 + 1 or foo > bar

Fields of SQLBinaryExpr

CAST an expression to a different data type e.g. CAST(foo AS VARCHAR(123))

Fields of SQLCast

Nested expression e.g. (foo > bar) or (1)

Unary expression

Fields of SQLUnary

Literal signed long

Literal floating point value

Literal string

Scalar function call e.g. LEFT(foo, 5)

Fields of SQLFunction

Expression with ASC/DESC attribute e.g. foo ASC or foo DESC.=

Fields of SQLOrderBy

SELECT

Fields of SQLSelect

projection expressions

FROM

WHERE

ORDER BY

GROUP BY

HAVING

LIMIT

INSERT

Fields of SQLInsert

TABLE

COLUMNS

VALUES (vector of rows to insert)

UPDATE

Fields of SQLUpdate

TABLE

Columns being assigned

Values being assigned

WHERE

DELETE

Fields of SQLDelete

FROM

WHERE

ORDER BY

CREATE TABLE

Fields of SQLCreateTable

Table name

Optional schema

Trait Implementations

impl Debug for ASTNode
[src]

Formats the value using the given formatter. Read more

impl Clone for ASTNode
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for ASTNode
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

impl Send for ASTNode

impl Sync for ASTNode