Enum sql_ast::ast::Statement[][src]

pub enum Statement {
Show variants Query(Box<Query>), Insert { table_name: ObjectName, columns: Vec<Ident>, source: Box<Query>, }, Copy { table_name: ObjectName, columns: Vec<Ident>, values: Vec<Option<String>>, }, Update { table_name: ObjectName, assignments: Vec<Assignment>, selection: Option<Expr>, }, Delete { table_name: ObjectName, selection: Option<Expr>, }, CreateView { name: ObjectName, columns: Vec<Ident>, query: Box<Query>, materialized: bool, with_options: Vec<SqlOption>, }, CreateTable { if_not_exists: bool, name: ObjectName, columns: Vec<ColumnDef>, constraints: Vec<TableConstraint>, with_options: Vec<SqlOption>, external: bool, file_format: Option<FileFormat>, location: Option<String>, }, AlterTable { name: ObjectName, operation: AlterTableOperation, }, Drop { object_type: ObjectType, if_exists: bool, names: Vec<ObjectName>, cascade: bool, }, SetVariable { local: bool, variable: Ident, value: SetVariableValue, }, ShowVariable { variable: Ident, }, ShowColumns { extended: bool, full: bool, table_name: ObjectName, filter: Option<ShowStatementFilter>, }, StartTransaction { modes: Vec<TransactionMode>, }, SetTransaction { modes: Vec<TransactionMode>, }, Commit { chain: bool, }, Rollback { chain: bool, },
}
Expand description

A top-level statement (SELECT, INSERT, CREATE, etc.)

Variants

Query(Box<Query>)

SELECT

Insert

INSERT

Show fields

Fields of Insert

table_name: ObjectName

TABLE

columns: Vec<Ident>

COLUMNS

source: Box<Query>

A SQL query that specifies what to insert

Copy
Show fields

Fields of Copy

table_name: ObjectName

TABLE

columns: Vec<Ident>

COLUMNS

values: Vec<Option<String>>

VALUES a vector of values to be copied

Update

UPDATE

Show fields

Fields of Update

table_name: ObjectName

TABLE

assignments: Vec<Assignment>

Column assignments

selection: Option<Expr>

WHERE

Delete

DELETE

Show fields

Fields of Delete

table_name: ObjectName

FROM

selection: Option<Expr>

WHERE

CreateView

CREATE VIEW

Show fields

Fields of CreateView

name: ObjectName

View name

columns: Vec<Ident>query: Box<Query>materialized: boolwith_options: Vec<SqlOption>
CreateTable

CREATE TABLE

Show fields

Fields of CreateTable

if_not_exists: boolname: ObjectName

Table name

columns: Vec<ColumnDef>

Optional schema

constraints: Vec<TableConstraint>with_options: Vec<SqlOption>external: boolfile_format: Option<FileFormat>location: Option<String>
AlterTable

ALTER TABLE

Show fields

Fields of AlterTable

name: ObjectName

Table name

operation: AlterTableOperation
Drop

DROP

Show fields

Fields of Drop

object_type: ObjectType

The type of the object to drop: TABLE, VIEW, etc.

if_exists: bool

An optional IF EXISTS clause. (Non-standard.)

names: Vec<ObjectName>

One or more objects to drop. (ANSI SQL requires exactly one.)

cascade: bool

Whether CASCADE was specified. This will be false when RESTRICT or no drop behavior at all was specified.

SetVariable

SET

Note: this is not a standard SQL statement, but it is supported by at least MySQL and PostgreSQL. Not all MySQL-specific syntatic forms are supported yet.

Show fields

Fields of SetVariable

local: boolvariable: Identvalue: SetVariableValue
ShowVariable

SHOW

Note: this is a PostgreSQL-specific statement.

Show fields

Fields of ShowVariable

variable: Ident
ShowColumns

SHOW COLUMNS

Note: this is a MySQL-specific statement.

Show fields

Fields of ShowColumns

extended: boolfull: booltable_name: ObjectNamefilter: Option<ShowStatementFilter>
StartTransaction

{ BEGIN [ TRANSACTION | WORK ] | START TRANSACTION } ...

Show fields

Fields of StartTransaction

modes: Vec<TransactionMode>
SetTransaction

SET TRANSACTION ...

Show fields

Fields of SetTransaction

modes: Vec<TransactionMode>
Commit

COMMIT [ TRANSACTION | WORK ] [ AND [ NO ] CHAIN ]

Show fields

Fields of Commit

chain: bool
Rollback

ROLLBACK [ TRANSACTION | WORK ] [ AND [ NO ] CHAIN ]

Show fields

Fields of Rollback

chain: bool

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

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

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.