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
SELECT
INSERT
Show fields
Fields of Insert
table_name: ObjectNameTABLE
columns: Vec<Ident>COLUMNS
source: Box<Query>A SQL query that specifies what to insert
Show fields
UPDATE
Show fields
Fields of Update
table_name: ObjectNameTABLE
assignments: Vec<Assignment>Column assignments
selection: Option<Expr>WHERE
DELETE
Show fields
Fields of Delete
CREATE VIEW
Show fields
CREATE TABLE
Show fields
Fields of CreateTable
if_not_exists: boolname: ObjectNameTable name
columns: Vec<ColumnDef>Optional schema
constraints: Vec<TableConstraint>with_options: Vec<SqlOption>external: boolfile_format: Option<FileFormat>location: Option<String>ALTER TABLE
Show fields
Fields of AlterTable
DROP
Show fields
Fields of Drop
object_type: ObjectTypeThe type of the object to drop: TABLE, VIEW, etc.
if_exists: boolAn optional IF EXISTS clause. (Non-standard.)
names: Vec<ObjectName>One or more objects to drop. (ANSI SQL requires exactly one.)
cascade: boolWhether CASCADE was specified. This will be false when
RESTRICT or no drop behavior at all was specified.
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
SHOW
Note: this is a PostgreSQL-specific statement.
Show fields
Fields of ShowVariable
variable: IdentSHOW COLUMNS
Note: this is a MySQL-specific statement.
Show fields
Fields of ShowColumns
{ BEGIN [ TRANSACTION | WORK ] | START TRANSACTION } ...
Show fields
Fields of StartTransaction
modes: Vec<TransactionMode>SET TRANSACTION ...
Show fields
Fields of SetTransaction
modes: Vec<TransactionMode>COMMIT [ TRANSACTION | WORK ] [ AND [ NO ] CHAIN ]
Show fields
Fields of Commit
chain: boolROLLBACK [ TRANSACTION | WORK ] [ AND [ NO ] CHAIN ]
Show fields
Fields of Rollback
chain: boolTrait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Statementimpl UnwindSafe for StatementBlanket Implementations
Mutably borrows from an owned value. Read more