Skip to main content

Statement

Enum Statement 

Source
pub enum Statement {
Show 127 variants Analyze(Analyze), Set(Set), Truncate(Truncate), Msck(Msck), Query(Box<Query>), Insert(Insert), Install { extension_name: Ident, }, Load { extension_name: Ident, }, Directory { overwrite: bool, local: bool, path: String, file_format: Option<FileFormat>, source: Box<Query>, }, Case(CaseStatement), If(IfStatement), While(WhileStatement), Raise(RaiseStatement), Call(Function), Copy { source: CopySource, to: bool, target: CopyTarget, options: Vec<CopyOption>, legacy_options: Vec<CopyLegacyOption>, values: Vec<Option<String>>, }, CopyIntoSnowflake {
Show 14 fields kind: CopyIntoSnowflakeKind, into: ObjectName, into_columns: Option<Vec<Ident>>, from_obj: Option<ObjectName>, from_obj_alias: Option<Ident>, stage_params: StageParamsObject, from_transformations: Option<Vec<StageLoadSelectItemKind>>, from_query: Option<Box<Query>>, files: Option<Vec<String>>, pattern: Option<String>, file_format: KeyValueOptions, copy_options: KeyValueOptions, validation_mode: Option<String>, partition: Option<Box<Expr>>,
}, Open(OpenStatement), Close { cursor: CloseCursor, }, Update(Update), Delete(Delete), CreateView(CreateView), CreateTable(CreateTable), CreateVirtualTable { name: ObjectName, if_not_exists: bool, module_name: Ident, module_args: Vec<Ident>, }, CreateIndex(CreateIndex), CreateRole(CreateRole), CreateSecret { or_replace: bool, temporary: Option<bool>, if_not_exists: bool, name: Option<Ident>, storage_specifier: Option<Ident>, secret_type: Ident, options: Vec<SecretOption>, }, CreateServer(CreateServerStatement), CreatePolicy(CreatePolicy), CreateConnector(CreateConnector), CreateOperator(CreateOperator), CreateOperatorFamily(CreateOperatorFamily), CreateOperatorClass(CreateOperatorClass), AlterTable(AlterTable), AlterSchema(AlterSchema), AlterIndex { name: ObjectName, operation: AlterIndexOperation, }, AlterView { name: ObjectName, columns: Vec<Ident>, query: Box<Query>, with_options: Vec<SqlOption>, }, AlterType(AlterType), AlterOperator(AlterOperator), AlterOperatorFamily(AlterOperatorFamily), AlterOperatorClass(AlterOperatorClass), AlterRole { name: Ident, operation: AlterRoleOperation, }, AlterPolicy(AlterPolicy), AlterConnector { name: Ident, properties: Option<Vec<SqlOption>>, url: Option<String>, owner: Option<AlterConnectorOwner>, }, AlterSession { set: bool, session_params: KeyValueOptions, }, AttachDatabase { schema_name: Ident, database_file_name: Expr, database: bool, }, AttachDuckDBDatabase { if_not_exists: bool, database: bool, database_path: Ident, database_alias: Option<Ident>, attach_options: Vec<AttachDuckDBDatabaseOption>, }, DetachDuckDBDatabase { if_exists: bool, database: bool, database_alias: Ident, }, Drop { object_type: ObjectType, if_exists: bool, names: Vec<ObjectName>, cascade: bool, restrict: bool, purge: bool, temporary: bool, table: Option<ObjectName>, }, DropFunction(DropFunction), DropDomain(DropDomain), DropProcedure { if_exists: bool, proc_desc: Vec<FunctionDesc>, drop_behavior: Option<DropBehavior>, }, DropSecret { if_exists: bool, temporary: Option<bool>, name: Ident, storage_specifier: Option<Ident>, }, DropPolicy(DropPolicy), DropConnector { if_exists: bool, name: Ident, }, Declare { stmts: Vec<Declare>, }, CreateExtension(CreateExtension), DropExtension(DropExtension), DropOperator(DropOperator), DropOperatorFamily(DropOperatorFamily), DropOperatorClass(DropOperatorClass), Fetch { name: Ident, direction: FetchDirection, position: FetchPosition, into: Option<ObjectName>, }, Flush { object_type: FlushType, location: Option<FlushLocation>, channel: Option<String>, read_lock: bool, export: bool, tables: Vec<ObjectName>, }, Discard { object_type: DiscardObject, }, ShowFunctions { filter: Option<ShowStatementFilter>, }, ShowVariable { variable: Vec<Ident>, }, ShowStatus { filter: Option<ShowStatementFilter>, global: bool, session: bool, }, ShowVariables { filter: Option<ShowStatementFilter>, global: bool, session: bool, }, ShowCreate { obj_type: ShowCreateObject, obj_name: ObjectName, }, ShowColumns { extended: bool, full: bool, show_options: ShowStatementOptions, }, ShowDatabases { terse: bool, history: bool, show_options: ShowStatementOptions, }, ShowSchemas { terse: bool, history: bool, show_options: ShowStatementOptions, }, ShowCharset(ShowCharset), ShowObjects(ShowObjects), ShowTables { terse: bool, history: bool, extended: bool, full: bool, external: bool, show_options: ShowStatementOptions, }, ShowViews { terse: bool, materialized: bool, show_options: ShowStatementOptions, }, ShowCollation { filter: Option<ShowStatementFilter>, }, Use(Use), StartTransaction { modes: Vec<TransactionMode>, begin: bool, transaction: Option<BeginTransactionKind>, modifier: Option<TransactionModifier>, statements: Vec<Statement>, exception: Option<Vec<ExceptionWhen>>, has_end_keyword: bool, }, Comment { object_type: CommentObject, object_name: ObjectName, comment: Option<String>, if_exists: bool, }, Commit { chain: bool, end: bool, modifier: Option<TransactionModifier>, }, Rollback { chain: bool, savepoint: Option<Ident>, }, CreateSchema { schema_name: SchemaName, if_not_exists: bool, with: Option<Vec<SqlOption>>, options: Option<Vec<SqlOption>>, default_collate_spec: Option<Expr>, clone: Option<ObjectName>, }, CreateDatabase {
Show 22 fields db_name: ObjectName, if_not_exists: bool, location: Option<String>, managed_location: Option<String>, or_replace: bool, transient: bool, clone: Option<ObjectName>, data_retention_time_in_days: Option<u64>, max_data_extension_time_in_days: Option<u64>, external_volume: Option<String>, catalog: Option<String>, replace_invalid_characters: Option<bool>, default_ddl_collation: Option<String>, storage_serialization_policy: Option<StorageSerializationPolicy>, comment: Option<String>, default_charset: Option<String>, default_collation: Option<String>, catalog_sync: Option<String>, catalog_sync_namespace_mode: Option<CatalogSyncNamespaceMode>, catalog_sync_namespace_flatten_delimiter: Option<String>, with_tags: Option<Vec<Tag>>, with_contacts: Option<Vec<ContactEntry>>,
}, CreateFunction(CreateFunction), CreateTrigger(CreateTrigger), DropTrigger(DropTrigger), CreateProcedure { or_alter: bool, name: ObjectName, params: Option<Vec<ProcedureParam>>, language: Option<Ident>, body: ConditionalStatements, }, CreateMacro { or_replace: bool, temporary: bool, name: ObjectName, args: Option<Vec<MacroArg>>, definition: MacroDefinition, }, CreateStage { or_replace: bool, temporary: bool, if_not_exists: bool, name: ObjectName, stage_params: StageParamsObject, directory_table_params: KeyValueOptions, file_format: KeyValueOptions, copy_options: KeyValueOptions, comment: Option<String>, }, Assert { condition: Expr, message: Option<Expr>, }, Grant(Grant), Deny(DenyStatement), Revoke(Revoke), Deallocate { name: Ident, prepare: bool, }, Execute { name: Option<ObjectName>, parameters: Vec<Expr>, has_parentheses: bool, immediate: bool, into: Vec<Ident>, using: Vec<ExprWithAlias>, output: bool, default: bool, }, Prepare { name: Ident, data_types: Vec<DataType>, statement: Box<Statement>, }, Kill { modifier: Option<KillType>, id: u64, }, ExplainTable { describe_alias: DescribeAlias, hive_format: Option<HiveDescribeFormat>, has_table_keyword: bool, table_name: ObjectName, }, Explain { describe_alias: DescribeAlias, analyze: bool, verbose: bool, query_plan: bool, estimate: bool, statement: Box<Statement>, format: Option<AnalyzeFormatKind>, options: Option<Vec<UtilityOption>>, }, Savepoint { name: Ident, }, ReleaseSavepoint { name: Ident, }, Merge(Merge), Cache { table_flag: Option<ObjectName>, table_name: ObjectName, has_as: bool, options: Vec<SqlOption>, query: Option<Box<Query>>, }, UNCache { table_name: ObjectName, if_exists: bool, }, CreateSequence { temporary: bool, if_not_exists: bool, name: ObjectName, data_type: Option<DataType>, sequence_options: Vec<SequenceOptions>, owned_by: Option<ObjectName>, }, CreateDomain(CreateDomain), CreateType { name: ObjectName, representation: Option<UserDefinedTypeRepresentation>, }, Pragma { name: ObjectName, value: Option<Value>, is_eq: bool, }, LockTables { tables: Vec<LockTable>, }, UnlockTables, Unload { query: Option<Box<Query>>, query_text: Option<String>, to: Ident, auth: Option<IamRoleKind>, with: Vec<SqlOption>, options: Vec<CopyLegacyOption>, }, OptimizeTable { name: ObjectName, on_cluster: Option<Ident>, partition: Option<Partition>, include_final: bool, deduplicate: Option<Deduplicate>, }, LISTEN { channel: Ident, }, UNLISTEN { channel: Ident, }, NOTIFY { channel: Ident, payload: Option<String>, }, LoadData { local: bool, inpath: String, overwrite: bool, table_name: ObjectName, partitioned: Option<Vec<Expr>>, table_format: Option<HiveLoadDataFormat>, }, RenameTable(Vec<RenameTable>), List(FileStagingCommand), Remove(FileStagingCommand), RaisError { message: Box<Expr>, severity: Box<Expr>, state: Box<Expr>, arguments: Vec<Expr>, options: Vec<RaisErrorOption>, }, Print(PrintStatement), Return(ReturnStatement), ExportData(ExportData), CreateUser(CreateUser), AlterUser(AlterUser), Vacuum(VacuumStatement), Reset(ResetStatement),
}
Expand description

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

Variants§

§

Analyze(Analyze)

ANALYZE

Analyze (Hive)

§

Set(Set)

SET statements (session, transaction, timezone, etc.).

§

Truncate(Truncate)

TRUNCATE

Truncate (Hive)

§

Msck(Msck)

MSCK

Msck (Hive)

§

Query(Box<Query>)

SELECT
§

Insert(Insert)

INSERT
§

Install

INSTALL

Fields

§extension_name: Ident

Only for DuckDB

§

Load

LOAD

Fields

§extension_name: Ident

Only for DuckDB

§

Directory

LOAD DATA from a directory or query source.

Fields

§overwrite: bool

Whether to overwrite existing files.

§local: bool

Whether the directory is local to the server.

§path: String

Path to the directory or files.

§file_format: Option<FileFormat>

Optional file format for the data.

§source: Box<Query>

Source query providing data to load.

§

Case(CaseStatement)

A CASE statement.

§

If(IfStatement)

An IF statement.

§

While(WhileStatement)

A WHILE statement.

§

Raise(RaiseStatement)

A RAISE statement.

§

Call(Function)

CALL <function>
§

Copy

COPY [TO | FROM] ...

Fields

§source: CopySource

The source of ‘COPY TO’, or the target of ‘COPY FROM’

§to: bool

If true, is a ‘COPY TO’ statement. If false is a ‘COPY FROM’

§target: CopyTarget

The target of ‘COPY TO’, or the source of ‘COPY FROM’

§options: Vec<CopyOption>

WITH options (from PostgreSQL version 9.0)

§legacy_options: Vec<CopyLegacyOption>

WITH options (before PostgreSQL version 9.0)

§values: Vec<Option<String>>

VALUES a vector of values to be copied

§

CopyIntoSnowflake

COPY INTO <table> | <location>

See: https://docs.snowflake.com/en/sql-reference/sql/copy-into-table https://docs.snowflake.com/en/sql-reference/sql/copy-into-location

Copy Into syntax available for Snowflake is different than the one implemented in Postgres. Although they share common prefix, it is reasonable to implement them in different enums. This can be refactored later once custom dialects are allowed to have custom Statements.

Fields

§kind: CopyIntoSnowflakeKind

Kind of COPY INTO operation (table or location).

§into: ObjectName

Target object for the COPY INTO operation.

§into_columns: Option<Vec<Ident>>

Optional list of target columns.

§from_obj: Option<ObjectName>

Optional source object name (staged data).

§from_obj_alias: Option<Ident>

Optional alias for the source object.

§stage_params: StageParamsObject

Stage-specific parameters (e.g., credentials, path).

§from_transformations: Option<Vec<StageLoadSelectItemKind>>

Optional list of transformations applied when loading.

§from_query: Option<Box<Query>>

Optional source query instead of a staged object.

§files: Option<Vec<String>>

Optional list of specific file names to load.

§pattern: Option<String>

Optional filename matching pattern.

§file_format: KeyValueOptions

File format options.

§copy_options: KeyValueOptions

Additional copy options.

§validation_mode: Option<String>

Optional validation mode string.

§partition: Option<Box<Expr>>

Optional partition expression for loading.

§

Open(OpenStatement)

OPEN cursor_name

Opens a cursor.

§

Close

CLOSE

Closes the portal underlying an open cursor.

Fields

§cursor: CloseCursor

Cursor name

§

Update(Update)

UPDATE
§

Delete(Delete)

DELETE
§

CreateView(CreateView)

CREATE VIEW
§

CreateTable(CreateTable)

CREATE TABLE
§

CreateVirtualTable

CREATE VIRTUAL TABLE .. USING <module_name> (<module_args>)`

Sqlite specific statement

Fields

§name: ObjectName

Name of the virtual table module instance.

§if_not_exists: bool

true when IF NOT EXISTS was specified.

§module_name: Ident

Module name used by the virtual table.

§module_args: Vec<Ident>

Arguments passed to the module.

§

CreateIndex(CreateIndex)

`CREATE INDEX`
§

CreateRole(CreateRole)

CREATE ROLE

See PostgreSQL

§

CreateSecret

CREATE SECRET

See DuckDB

Fields

§or_replace: bool

true when OR REPLACE was specified.

§temporary: Option<bool>

Optional TEMPORARY flag.

§if_not_exists: bool

true when IF NOT EXISTS was present.

§name: Option<Ident>

Optional secret name.

§storage_specifier: Option<Ident>

Optional storage specifier identifier.

§secret_type: Ident

The secret type identifier.

§options: Vec<SecretOption>

Additional secret options.

§

CreateServer(CreateServerStatement)

A CREATE SERVER statement.

§

CreatePolicy(CreatePolicy)

CREATE POLICY

See PostgreSQL

§

CreateConnector(CreateConnector)

CREATE CONNECTOR

See Hive

§

CreateOperator(CreateOperator)

CREATE OPERATOR

See PostgreSQL

§

CreateOperatorFamily(CreateOperatorFamily)

CREATE OPERATOR FAMILY

See PostgreSQL

§

CreateOperatorClass(CreateOperatorClass)

CREATE OPERATOR CLASS

See PostgreSQL

§

AlterTable(AlterTable)

ALTER TABLE
§

AlterSchema(AlterSchema)

ALTER SCHEMA

See BigQuery

§

AlterIndex

ALTER INDEX

Fields

§name: ObjectName

Name of the index to alter.

§operation: AlterIndexOperation

The operation to perform on the index.

§

AlterView

ALTER VIEW

Fields

§name: ObjectName

View name being altered.

§columns: Vec<Ident>

Optional new column list for the view.

§query: Box<Query>

Replacement query for the view definition.

§with_options: Vec<SqlOption>

Additional WITH options for the view.

§

AlterType(AlterType)

ALTER TYPE
See [PostgreSQL](https://www.postgresql.org/docs/current/sql-altertype.html)
§

AlterOperator(AlterOperator)

ALTER OPERATOR

See PostgreSQL

§

AlterOperatorFamily(AlterOperatorFamily)

ALTER OPERATOR FAMILY

See PostgreSQL

§

AlterOperatorClass(AlterOperatorClass)

ALTER OPERATOR CLASS

See PostgreSQL

§

AlterRole

ALTER ROLE

Fields

§name: Ident

Role name being altered.

§operation: AlterRoleOperation

Operation to perform on the role.

§

AlterPolicy(AlterPolicy)

ALTER POLICY <NAME> ON <TABLE NAME> [<OPERATION>]

(Postgresql-specific)

§

AlterConnector

ALTER CONNECTOR connector_name SET DCPROPERTIES(property_name=property_value, ...);
or
ALTER CONNECTOR connector_name SET URL new_url;
or
ALTER CONNECTOR connector_name SET OWNER [USER|ROLE] user_or_role;

(Hive-specific)

Fields

§name: Ident

Name of the connector to alter.

§properties: Option<Vec<SqlOption>>

Optional connector properties to set.

§url: Option<String>

Optional new URL for the connector.

§owner: Option<AlterConnectorOwner>

Optional new owner specification.

§

AlterSession

ALTER SESSION SET sessionParam
ALTER SESSION UNSET <param_name> [ , <param_name> , ... ]

See https://docs.snowflake.com/en/sql-reference/sql/alter-session

Fields

§set: bool

true is to set for the session parameters, false is to unset

§session_params: KeyValueOptions

The session parameters to set or unset

§

AttachDatabase

ATTACH DATABASE 'path/to/file' AS alias

(SQLite-specific)

Fields

§schema_name: Ident

The name to bind to the newly attached database

§database_file_name: Expr

An expression that indicates the path to the database file

§database: bool

true if the syntax is ‘ATTACH DATABASE’, false if it’s just ‘ATTACH’

§

AttachDuckDBDatabase

(DuckDB-specific)

ATTACH 'sqlite_file.db' AS sqlite_db (READ_ONLY, TYPE SQLITE);

See https://duckdb.org/docs/sql/statements/attach.html

Fields

§if_not_exists: bool

true when IF NOT EXISTS was present.

§database: bool

true if the syntax used ATTACH DATABASE rather than ATTACH.

§database_path: Ident

The path identifier to the database file being attached.

§database_alias: Option<Ident>

Optional alias assigned to the attached database.

§attach_options: Vec<AttachDuckDBDatabaseOption>

Dialect-specific attach options (e.g., READ_ONLY).

§

DetachDuckDBDatabase

(DuckDB-specific)

DETACH db_alias;

See https://duckdb.org/docs/sql/statements/attach.html

Fields

§if_exists: bool

true when IF EXISTS was present.

§database: bool

true if the syntax used DETACH DATABASE rather than DETACH.

§database_alias: Ident

Alias of the database to detach.

§

Drop

DROP [TABLE, VIEW, ...]

Fields

§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.

§restrict: bool

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

§purge: bool

Hive allows you specify whether the table’s stored data will be deleted along with the dropped table

§temporary: bool

MySQL-specific “TEMPORARY” keyword

§table: Option<ObjectName>

MySQL-specific drop index syntax, which requires table specification See https://dev.mysql.com/doc/refman/8.4/en/drop-index.html

§

DropFunction(DropFunction)

DROP FUNCTION
§

DropDomain(DropDomain)

DROP DOMAIN

See PostgreSQL

DROP DOMAIN [ IF EXISTS ] name [, …] [ CASCADE | RESTRICT ]

§

DropProcedure

DROP PROCEDURE

Fields

§if_exists: bool

true when IF EXISTS was present.

§proc_desc: Vec<FunctionDesc>

One or more functions/procedures to drop.

§drop_behavior: Option<DropBehavior>

Optional drop behavior (CASCADE or RESTRICT).

§

DropSecret

DROP SECRET

Fields

§if_exists: bool

true when IF EXISTS was present.

§temporary: Option<bool>

Optional TEMPORARY marker.

§name: Ident

Name of the secret to drop.

§storage_specifier: Option<Ident>

Optional storage specifier identifier.

§

DropPolicy(DropPolicy)

 DROP POLICY

See PostgreSQL

§

DropConnector

DROP CONNECTOR

See Hive

Fields

§if_exists: bool

true when IF EXISTS was present.

§name: Ident

Name of the connector to drop.

§

Declare

DECLARE

Declare Cursor Variables

Note: this is a PostgreSQL-specific statement, but may also compatible with other SQL.

Fields

§stmts: Vec<Declare>

Cursor declaration statements collected by DECLARE.

§

CreateExtension(CreateExtension)

CREATE EXTENSION [ IF NOT EXISTS ] extension_name
    [ WITH ] [ SCHEMA schema_name ]
             [ VERSION version ]
             [ CASCADE ]

Note: this is a PostgreSQL-specific statement,

§

DropExtension(DropExtension)

DROP EXTENSION [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]

Note: this is a PostgreSQL-specific statement. https://www.postgresql.org/docs/current/sql-dropextension.html

§

DropOperator(DropOperator)

DROP OPERATOR [ IF EXISTS ] name ( { left_type | NONE } , right_type ) [, ...] [ CASCADE | RESTRICT ]

Note: this is a PostgreSQL-specific statement. https://www.postgresql.org/docs/current/sql-dropoperator.html

§

DropOperatorFamily(DropOperatorFamily)

DROP OPERATOR FAMILY [ IF EXISTS ] name USING index_method [ CASCADE | RESTRICT ]

Note: this is a PostgreSQL-specific statement. https://www.postgresql.org/docs/current/sql-dropopfamily.html

§

DropOperatorClass(DropOperatorClass)

DROP OPERATOR CLASS [ IF EXISTS ] name USING index_method [ CASCADE | RESTRICT ]

Note: this is a PostgreSQL-specific statement. https://www.postgresql.org/docs/current/sql-dropopclass.html

§

Fetch

FETCH

Retrieve rows from a query using a cursor

Note: this is a PostgreSQL-specific statement, but may also compatible with other SQL.

Fields

§name: Ident

Cursor name

§direction: FetchDirection

The fetch direction (e.g., FORWARD, BACKWARD).

§position: FetchPosition

The fetch position (e.g., ALL, NEXT, ABSOLUTE).

§into: Option<ObjectName>

Optional target table to fetch rows into.

§

Flush

FLUSH [NO_WRITE_TO_BINLOG | LOCAL] flush_option [, flush_option] ... | tables_option

Note: this is a Mysql-specific statement, but may also compatible with other SQL.

Fields

§object_type: FlushType

The specific flush option or object to flush.

§location: Option<FlushLocation>

Optional flush location (dialect-specific).

§channel: Option<String>

Optional channel name used for flush operations.

§read_lock: bool

Whether a read lock was requested.

§export: bool

Whether this is an export flush operation.

§tables: Vec<ObjectName>

Optional list of tables involved in the flush.

§

Discard

DISCARD [ ALL | PLANS | SEQUENCES | TEMPORARY | TEMP ]

Note: this is a PostgreSQL-specific statement, but may also compatible with other SQL.

Fields

§object_type: DiscardObject

The kind of object(s) to discard (ALL, PLANS, etc.).

§

ShowFunctions

SHOW FUNCTIONS

Note: this is a Presto-specific statement.

Fields

§filter: Option<ShowStatementFilter>

Optional filter for which functions to display.

§

ShowVariable

SHOW <variable>

Note: this is a PostgreSQL-specific statement.

Fields

§variable: Vec<Ident>

Variable name as one or more identifiers.

§

ShowStatus

SHOW [GLOBAL | SESSION] STATUS [LIKE 'pattern' | WHERE expr]

Note: this is a MySQL-specific statement.

Fields

§filter: Option<ShowStatementFilter>

Optional filter for which status entries to display.

§global: bool

true when GLOBAL scope was requested.

§session: bool

true when SESSION scope was requested.

§

ShowVariables

SHOW VARIABLES

Note: this is a MySQL-specific statement.

Fields

§filter: Option<ShowStatementFilter>

Optional filter for which variables to display.

§global: bool

true when GLOBAL scope was requested.

§session: bool

true when SESSION scope was requested.

§

ShowCreate

SHOW CREATE TABLE

Note: this is a MySQL-specific statement.

Fields

§obj_type: ShowCreateObject

The kind of object being shown (TABLE, VIEW, etc.).

§obj_name: ObjectName

The name of the object to show create statement for.

§

ShowColumns

SHOW COLUMNS

Fields

§extended: bool

true when extended column information was requested.

§full: bool

true when full column details were requested.

§show_options: ShowStatementOptions

Additional options for SHOW COLUMNS.

§

ShowDatabases

SHOW DATABASES

Fields

§terse: bool

true when terse output format was requested.

§history: bool

true when history information was requested.

§show_options: ShowStatementOptions

Additional options for SHOW DATABASES.

§

ShowSchemas

SHOW SCHEMAS

Fields

§terse: bool

true when terse (compact) output was requested.

§history: bool

true when history information was requested.

§show_options: ShowStatementOptions

Additional options for SHOW SCHEMAS.

§

ShowCharset(ShowCharset)

Show the available character sets (alias CHARSET).

§

ShowObjects(ShowObjects)

SHOW OBJECTS LIKE 'line%' IN mydb.public

Snowflake-specific statement https://docs.snowflake.com/en/sql-reference/sql/show-objects

§

ShowTables

SHOW TABLES

Fields

§terse: bool

true when terse output format was requested (compact listing).

§history: bool

true when history rows are requested.

§extended: bool

true when extended information should be shown.

§full: bool

true when a full listing was requested.

§external: bool

true when external tables should be included.

§show_options: ShowStatementOptions

Additional options for SHOW statements.

§

ShowViews

SHOW VIEWS

Fields

§terse: bool

true when terse output format was requested.

§materialized: bool

true when materialized views should be included.

§show_options: ShowStatementOptions

Additional options for SHOW statements.

§

ShowCollation

SHOW COLLATION

Note: this is a MySQL-specific statement.

Fields

§filter: Option<ShowStatementFilter>

Optional filter for which collations to display.

§

Use(Use)

`USE ...`
§

StartTransaction

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

If begin is false.

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

If begin is true

Fields

§modes: Vec<TransactionMode>

Transaction modes such as ISOLATION LEVEL or READ WRITE.

§begin: bool

true when this was parsed as BEGIN instead of START.

§transaction: Option<BeginTransactionKind>

Optional specific keyword used: TRANSACTION or WORK.

§modifier: Option<TransactionModifier>

Optional transaction modifier (e.g., AND NO CHAIN).

§statements: Vec<Statement>

List of statements belonging to the BEGIN block. Example:

BEGIN
    SELECT 1;
    SELECT 2;
END;
§exception: Option<Vec<ExceptionWhen>>

Exception handling with exception clauses. Example:

EXCEPTION
    WHEN EXCEPTION_1 THEN
        SELECT 2;
    WHEN EXCEPTION_2 OR EXCEPTION_3 THEN
        SELECT 3;
    WHEN OTHER THEN
        SELECT 4;

https://cloud.google.com/bigquery/docs/reference/standard-sql/procedural-language#beginexceptionend https://docs.snowflake.com/en/sql-reference/snowflake-scripting/exception

§has_end_keyword: bool

TRUE if the statement has an END keyword.

§

Comment

COMMENT ON ...

Note: this is a PostgreSQL-specific statement.

Fields

§object_type: CommentObject

Type of object being commented (table, column, etc.).

§object_name: ObjectName

Name of the object the comment applies to.

§comment: Option<String>

Optional comment text (None to remove comment).

§if_exists: bool

An optional IF EXISTS clause. (Non-standard.) See https://docs.snowflake.com/en/sql-reference/sql/comment

§

Commit

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

If end is false

END [ TRY | CATCH ]

If end is true

Fields

§chain: bool

true when AND [ NO ] CHAIN was present.

§end: bool

true when this COMMIT was parsed as an END block terminator.

§modifier: Option<TransactionModifier>

Optional transaction modifier for commit semantics.

§

Rollback

ROLLBACK [ TRANSACTION | WORK ] [ AND [ NO ] CHAIN ] [ TO [ SAVEPOINT ] savepoint_name ]

Fields

§chain: bool

true when AND [ NO ] CHAIN was present.

§savepoint: Option<Ident>

Optional savepoint name to roll back to.

§

CreateSchema

CREATE SCHEMA

Fields

§schema_name: SchemaName

<schema name> | AUTHORIZATION <schema authorization identifier> | <schema name> AUTHORIZATION <schema authorization identifier>

§if_not_exists: bool

true when IF NOT EXISTS was present.

§with: Option<Vec<SqlOption>>

Schema properties.

CREATE SCHEMA myschema WITH (key1='value1');

Trino

§options: Option<Vec<SqlOption>>

Schema options.

CREATE SCHEMA myschema OPTIONS(key1='value1');

BigQuery

§default_collate_spec: Option<Expr>

Default collation specification for the schema.

CREATE SCHEMA myschema DEFAULT COLLATE 'und:ci';

BigQuery

§clone: Option<ObjectName>

Clones a schema

CREATE SCHEMA myschema CLONE otherschema

Snowflake

§

CreateDatabase

Fields

§db_name: ObjectName

Database name.

§if_not_exists: bool

IF NOT EXISTS flag.

§location: Option<String>

Optional location URI.

§managed_location: Option<String>

Optional managed location.

§or_replace: bool

OR REPLACE flag.

§transient: bool

TRANSIENT flag.

§clone: Option<ObjectName>

Optional clone source.

§data_retention_time_in_days: Option<u64>

Optional data retention time in days.

§max_data_extension_time_in_days: Option<u64>

Optional maximum data extension time in days.

§external_volume: Option<String>

Optional external volume identifier.

§catalog: Option<String>

Optional catalog name.

§replace_invalid_characters: Option<bool>

Whether to replace invalid characters.

§default_ddl_collation: Option<String>

Default DDL collation string.

§storage_serialization_policy: Option<StorageSerializationPolicy>

Storage serialization policy.

§comment: Option<String>

Optional comment.

§default_charset: Option<String>

Optional default character set (MySQL).

§default_collation: Option<String>

Optional default collation (MySQL).

§catalog_sync: Option<String>

Optional catalog sync identifier.

§catalog_sync_namespace_mode: Option<CatalogSyncNamespaceMode>

Catalog sync namespace mode.

§catalog_sync_namespace_flatten_delimiter: Option<String>

Optional flatten delimiter for namespace sync.

§with_tags: Option<Vec<Tag>>

Optional tags for the database.

§with_contacts: Option<Vec<ContactEntry>>

Optional contact entries for the database.

§

CreateFunction(CreateFunction)

CREATE FUNCTION

Supported variants:

  1. Hive
  2. PostgreSQL
  3. BigQuery
  4. MsSql
§

CreateTrigger(CreateTrigger)

CREATE TRIGGER statement. See struct CreateTrigger for details.

§

DropTrigger(DropTrigger)

DROP TRIGGER statement. See struct DropTrigger for details.

§

CreateProcedure

CREATE PROCEDURE

Fields

§or_alter: bool

OR ALTER flag.

§name: ObjectName

Procedure name.

§params: Option<Vec<ProcedureParam>>

Optional procedure parameters.

§language: Option<Ident>

Optional language identifier.

§body: ConditionalStatements

Procedure body statements.

§

CreateMacro

CREATE MACRO

Supported variants:

  1. DuckDB

Fields

§or_replace: bool

OR REPLACE flag.

§temporary: bool

Whether macro is temporary.

§name: ObjectName

Macro name.

§args: Option<Vec<MacroArg>>

Optional macro arguments.

§definition: MacroDefinition

Macro definition body.

§

CreateStage

Fields

§or_replace: bool

OR REPLACE flag for stage.

§temporary: bool

Whether stage is temporary.

§if_not_exists: bool

IF NOT EXISTS flag.

§name: ObjectName

Stage name.

§stage_params: StageParamsObject

Stage parameters.

§directory_table_params: KeyValueOptions

Directory table parameters.

§file_format: KeyValueOptions

File format options.

§copy_options: KeyValueOptions

Copy options for stage.

§comment: Option<String>

Optional comment.

§

Assert

ASSERT <condition> [AS <message>]

Fields

§condition: Expr

Assertion condition expression.

§message: Option<Expr>

Optional message expression.

§

Grant(Grant)

GRANT privileges ON objects TO grantees
§

Deny(DenyStatement)

DENY privileges ON object TO grantees
§

Revoke(Revoke)

REVOKE privileges ON objects FROM grantees
§

Deallocate

DEALLOCATE [ PREPARE ] { name | ALL }

Note: this is a PostgreSQL-specific statement.

Fields

§name: Ident

Name to deallocate (or ALL).

§prepare: bool

Whether PREPARE keyword was present.

§

Execute

Fields

§name: Option<ObjectName>

Optional function/procedure name.

§parameters: Vec<Expr>

Parameter expressions passed to execute.

§has_parentheses: bool

Whether parentheses were present.

§immediate: bool

Is this an EXECUTE IMMEDIATE.

§into: Vec<Ident>

Identifiers to capture results into.

§using: Vec<ExprWithAlias>

USING expressions with optional aliases.

§output: bool
§default: bool
§

Prepare

PREPARE name [ ( data_type [, ...] ) ] AS statement

Note: this is a PostgreSQL-specific statement.

Fields

§name: Ident

Name of the prepared statement.

§data_types: Vec<DataType>

Optional data types for parameters.

§statement: Box<Statement>

Statement being prepared.

§

Kill

Fields

§modifier: Option<KillType>

Optional kill modifier (CONNECTION, QUERY, MUTATION).

§id: u64

The id of the process to kill.

§

ExplainTable

[EXPLAIN | DESC | DESCRIBE] TABLE

Note: this is a MySQL-specific statement. See https://dev.mysql.com/doc/refman/8.0/en/explain.html

Fields

§describe_alias: DescribeAlias

EXPLAIN | DESC | DESCRIBE

§hive_format: Option<HiveDescribeFormat>

Hive style FORMATTED | EXTENDED

§has_table_keyword: bool

Snowflake and ClickHouse support DESC|DESCRIBE TABLE <table_name> syntax

Snowflake ClickHouse

§table_name: ObjectName

Table name

§

Explain

[EXPLAIN | DESC | DESCRIBE]  <statement>

Fields

§describe_alias: DescribeAlias

EXPLAIN | DESC | DESCRIBE

§analyze: bool

Carry out the command and show actual run times and other statistics.

§verbose: bool

Display additional information regarding the plan.

§query_plan: bool

EXPLAIN QUERY PLAN Display the query plan without running the query.

SQLite

§estimate: bool

EXPLAIN ESTIMATE Clickhouse

§statement: Box<Statement>

A SQL query that specifies what to explain

§format: Option<AnalyzeFormatKind>

Optional output format of explain

§options: Option<Vec<UtilityOption>>

Postgres style utility options, (analyze, verbose true)

§

Savepoint

SAVEPOINT

Define a new savepoint within the current transaction

Fields

§name: Ident

Name of the savepoint being defined.

§

ReleaseSavepoint

RELEASE [ SAVEPOINT ] savepoint_name

Fields

§name: Ident

Name of the savepoint to release.

§

Merge(Merge)

A MERGE statement.

MERGE INTO <target_table> USING <source> ON <join_expr> { matchedClause | notMatchedClause } [ ... ]

Snowflake BigQuery MSSQL

§

Cache

CACHE [ FLAG ] TABLE <table_name> [ OPTIONS('K1' = 'V1', 'K2' = V2) ] [ AS ] [ <query> ]

See Spark SQL docs for more details.

Fields

§table_flag: Option<ObjectName>

Table flag

§table_name: ObjectName

Table name

§has_as: bool

true if AS keyword was present before the query.

§options: Vec<SqlOption>

Table confs

§query: Option<Box<Query>>

Cache table as a Query

§

UNCache

UNCACHE TABLE [ IF EXISTS ]  <table_name>

Fields

§table_name: ObjectName

Table name

§if_exists: bool

true when IF EXISTS was present.

§

CreateSequence

CREATE [ { TEMPORARY | TEMP } ] SEQUENCE [ IF NOT EXISTS ] <sequence_name>

Define a new sequence:

Fields

§temporary: bool

Whether the sequence is temporary.

§if_not_exists: bool

IF NOT EXISTS flag.

§name: ObjectName

Sequence name.

§data_type: Option<DataType>

Optional data type for the sequence.

§sequence_options: Vec<SequenceOptions>

Sequence options (INCREMENT, MINVALUE, etc.).

§owned_by: Option<ObjectName>

Optional OWNED BY target.

§

CreateDomain(CreateDomain)

A CREATE DOMAIN statement.

§

CreateType

CREATE TYPE <name>

Fields

§name: ObjectName

Type name to create.

§representation: Option<UserDefinedTypeRepresentation>

Optional type representation details.

§

Pragma

PRAGMA <schema-name>.<pragma-name> = <pragma-value>

Fields

§name: ObjectName

Pragma name (possibly qualified).

§value: Option<Value>

Optional pragma value.

§is_eq: bool

Whether the pragma used =.

§

LockTables

LOCK TABLES <table_name> [READ [LOCAL] | [LOW_PRIORITY] WRITE]

Note: this is a MySQL-specific statement. See https://dev.mysql.com/doc/refman/8.0/en/lock-tables.html

Fields

§tables: Vec<LockTable>

List of tables to lock with modes.

§

UnlockTables

UNLOCK TABLES

Note: this is a MySQL-specific statement. See https://dev.mysql.com/doc/refman/8.0/en/lock-tables.html

§

Unload

Unloads the result of a query to file

Athena:

UNLOAD(statement) TO <destination> [ WITH options ]

Redshift:

UNLOAD('statement') TO <destination> [ OPTIONS ]

Fields

§query: Option<Box<Query>>

Optional query AST to unload.

§query_text: Option<String>

Optional original query text.

§to: Ident

Destination identifier.

§auth: Option<IamRoleKind>

Optional IAM role/auth information.

§with: Vec<SqlOption>

Additional WITH options.

§options: Vec<CopyLegacyOption>

Legacy copy-style options.

§

OptimizeTable

OPTIMIZE TABLE [db.]name [ON CLUSTER cluster] [PARTITION partition | PARTITION ID 'partition_id'] [FINAL] [DEDUPLICATE [BY expression]]

See ClickHouse https://clickhouse.com/docs/en/sql-reference/statements/optimize

Fields

§name: ObjectName

Table name to optimize.

§on_cluster: Option<Ident>

Optional cluster identifier.

§partition: Option<Partition>

Optional partition spec.

§include_final: bool

Whether FINAL was specified.

§deduplicate: Option<Deduplicate>

Optional deduplication settings.

§

LISTEN

LISTEN

listen for a notification channel

See Postgres https://www.postgresql.org/docs/current/sql-listen.html

Fields

§channel: Ident

Notification channel identifier.

§

UNLISTEN

UNLISTEN

stop listening for a notification

See Postgres https://www.postgresql.org/docs/current/sql-unlisten.html

Fields

§channel: Ident

Notification channel identifier.

§

NOTIFY

NOTIFY channel [ , payload ]

send a notification event together with an optional “payload” string to channel

See Postgres https://www.postgresql.org/docs/current/sql-notify.html

Fields

§channel: Ident

Notification channel identifier.

§payload: Option<String>

Optional payload string.

§

LoadData

LOAD DATA [LOCAL] INPATH 'filepath' [OVERWRITE] INTO TABLE tablename
[PARTITION (partcol1=val1, partcol2=val2 ...)]
[INPUTFORMAT 'inputformat' SERDE 'serde']

Loading files into tables

See Hive https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=27362036#LanguageManualDML-Loadingfilesintotables

Fields

§local: bool

Whether LOCAL is present.

§inpath: String

Input path for files to load.

§overwrite: bool

Whether OVERWRITE was specified.

§table_name: ObjectName

Target table name to load into.

§partitioned: Option<Vec<Expr>>

Optional partition specification.

§table_format: Option<HiveLoadDataFormat>

Optional table format information.

§

RenameTable(Vec<RenameTable>)

Rename TABLE tbl_name TO new_tbl_name[, tbl_name2 TO new_tbl_name2] ...

Renames one or more tables

See Mysql https://dev.mysql.com/doc/refman/9.1/en/rename-table.html

§

List(FileStagingCommand)

§

Remove(FileStagingCommand)

§

RaisError

RaiseError (MSSQL) RAISERROR ( { msg_id | msg_str | @local_variable } { , severity , state } [ , argument [ , …n ] ] ) [ WITH option [ , …n ] ] See https://learn.microsoft.com/en-us/sql/t-sql/language-elements/raiserror-transact-sql?view=sql-server-ver16

Fields

§message: Box<Expr>

Error message expression or identifier.

§severity: Box<Expr>

Severity expression.

§state: Box<Expr>

State expression.

§arguments: Vec<Expr>

Substitution arguments for the message.

§options: Vec<RaisErrorOption>

Additional WITH options for RAISERROR.

§

Print(PrintStatement)

PRINT msg_str | @local_variable | string_expr

See: https://learn.microsoft.com/en-us/sql/t-sql/statements/print-transact-sql

§

Return(ReturnStatement)

RETURN [ expression ]

See ReturnStatement

§

ExportData(ExportData)

Export data statement

Example:

EXPORT DATA OPTIONS(uri='gs://bucket/folder/*', format='PARQUET', overwrite=true) AS
SELECT field1, field2 FROM mydataset.table1 ORDER BY field1 LIMIT 10

BigQuery

§

CreateUser(CreateUser)

CREATE [OR REPLACE] USER <user> [IF NOT EXISTS]

Snowflake

§

AlterUser(AlterUser)

ALTER USER \[ IF EXISTS \] \[ <name> \]

Snowflake

§

Vacuum(VacuumStatement)

Re-sorts rows and reclaims space in either a specified table or all tables in the current database

VACUUM tbl

Redshift

§

Reset(ResetStatement)

Restore the value of a run-time parameter to the default value.

RESET configuration_parameter;
RESET ALL;

PostgreSQL

Trait Implementations§

Source§

impl Clone for Statement

Source§

fn clone(&self) -> Statement

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Statement

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Display for Statement

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats a SQL statement with support for pretty printing.

When using the alternate flag ({:#}), the statement will be formatted with proper indentation and line breaks. For example:

let sql = "SELECT a, b FROM table_1";
let ast = Parser::parse_sql(&GenericDialect, sql).unwrap();

// Regular formatting
assert_eq!(format!("{}", ast[0]), "SELECT a, b FROM table_1");

// Pretty printing
assert_eq!(format!("{:#}", ast[0]),
r#"SELECT
  a,
  b
FROM
  table_1"#);
Source§

impl From<AlterOperator> for Statement

Source§

fn from(a: AlterOperator) -> Statement

Converts to this type from the input type.
Source§

impl From<AlterOperatorClass> for Statement

Source§

fn from(a: AlterOperatorClass) -> Statement

Converts to this type from the input type.
Source§

impl From<AlterOperatorFamily> for Statement

Source§

fn from(a: AlterOperatorFamily) -> Statement

Converts to this type from the input type.
Source§

impl From<AlterPolicy> for Statement

Source§

fn from(v: AlterPolicy) -> Statement

Converts to this type from the input type.
Source§

impl From<AlterSchema> for Statement

Source§

fn from(a: AlterSchema) -> Statement

Converts to this type from the input type.
Source§

impl From<AlterTable> for Statement

Source§

fn from(at: AlterTable) -> Statement

Converts to this type from the input type.
Source§

impl From<AlterType> for Statement

Source§

fn from(a: AlterType) -> Statement

Converts to this type from the input type.
Source§

impl From<AlterUser> for Statement

Source§

fn from(a: AlterUser) -> Statement

Converts to this type from the input type.
Source§

impl From<Analyze> for Statement

Source§

fn from(analyze: Analyze) -> Statement

Converts to this type from the input type.
Source§

impl From<Box<Query>> for Statement

Source§

fn from(q: Box<Query>) -> Statement

Converts to this type from the input type.
Source§

impl From<CaseStatement> for Statement

Source§

fn from(c: CaseStatement) -> Statement

Converts to this type from the input type.
Source§

impl From<CreateConnector> for Statement

Source§

fn from(c: CreateConnector) -> Statement

Converts to this type from the input type.
Source§

impl From<CreateDomain> for Statement

Source§

fn from(c: CreateDomain) -> Statement

Converts to this type from the input type.
Source§

impl From<CreateExtension> for Statement

Source§

fn from(ce: CreateExtension) -> Statement

Converts to this type from the input type.
Source§

impl From<CreateFunction> for Statement

Source§

fn from(c: CreateFunction) -> Statement

Converts to this type from the input type.
Source§

impl From<CreateIndex> for Statement

Source§

fn from(c: CreateIndex) -> Statement

Converts to this type from the input type.
Source§

impl From<CreateOperator> for Statement

Source§

fn from(c: CreateOperator) -> Statement

Converts to this type from the input type.
Source§

impl From<CreateOperatorClass> for Statement

Source§

fn from(c: CreateOperatorClass) -> Statement

Converts to this type from the input type.
Source§

impl From<CreateOperatorFamily> for Statement

Source§

fn from(c: CreateOperatorFamily) -> Statement

Converts to this type from the input type.
Source§

impl From<CreatePolicy> for Statement

Source§

fn from(v: CreatePolicy) -> Statement

Converts to this type from the input type.
Source§

impl From<CreateRole> for Statement

Source§

fn from(cr: CreateRole) -> Statement

Converts to this type from the input type.
Source§

impl From<CreateServerStatement> for Statement

Source§

fn from(c: CreateServerStatement) -> Statement

Converts to this type from the input type.
Source§

impl From<CreateTable> for Statement

Source§

fn from(c: CreateTable) -> Statement

Converts to this type from the input type.
Source§

impl From<CreateTrigger> for Statement

Source§

fn from(c: CreateTrigger) -> Statement

Converts to this type from the input type.
Source§

impl From<CreateUser> for Statement

Source§

fn from(c: CreateUser) -> Statement

Converts to this type from the input type.
Source§

impl From<CreateView> for Statement

Source§

fn from(cv: CreateView) -> Statement

Converts to this type from the input type.
Source§

impl From<Delete> for Statement

Source§

fn from(d: Delete) -> Statement

Converts to this type from the input type.
Source§

impl From<DenyStatement> for Statement

Source§

fn from(d: DenyStatement) -> Statement

Converts to this type from the input type.
Source§

impl From<DropDomain> for Statement

Source§

fn from(d: DropDomain) -> Statement

Converts to this type from the input type.
Source§

impl From<DropExtension> for Statement

Source§

fn from(de: DropExtension) -> Statement

Converts to this type from the input type.
Source§

impl From<DropFunction> for Statement

Source§

fn from(df: DropFunction) -> Statement

Converts to this type from the input type.
Source§

impl From<DropOperator> for Statement

Source§

fn from(d: DropOperator) -> Statement

Converts to this type from the input type.
Source§

impl From<DropOperatorClass> for Statement

Source§

fn from(d: DropOperatorClass) -> Statement

Converts to this type from the input type.
Source§

impl From<DropOperatorFamily> for Statement

Source§

fn from(d: DropOperatorFamily) -> Statement

Converts to this type from the input type.
Source§

impl From<DropPolicy> for Statement

Source§

fn from(v: DropPolicy) -> Statement

Converts to this type from the input type.
Source§

impl From<DropTrigger> for Statement

Source§

fn from(d: DropTrigger) -> Statement

Converts to this type from the input type.
Source§

impl From<ExportData> for Statement

Source§

fn from(e: ExportData) -> Statement

Converts to this type from the input type.
Source§

impl From<Function> for Statement

Source§

fn from(f: Function) -> Statement

Converts to this type from the input type.
Source§

impl From<Grant> for Statement

Source§

fn from(v: Grant) -> Statement

Converts to this type from the input type.
Source§

impl From<IfStatement> for Statement

Source§

fn from(i: IfStatement) -> Statement

Converts to this type from the input type.
Source§

impl From<Insert> for Statement

Source§

fn from(i: Insert) -> Statement

Converts to this type from the input type.
Source§

impl From<Merge> for Statement

Source§

fn from(m: Merge) -> Statement

Converts to this type from the input type.
Source§

impl From<Msck> for Statement

Source§

fn from(msck: Msck) -> Statement

Converts to this type from the input type.
Source§

impl From<OpenStatement> for Statement

Source§

fn from(o: OpenStatement) -> Statement

Converts to this type from the input type.
Source§

impl From<PrintStatement> for Statement

Source§

fn from(p: PrintStatement) -> Statement

Converts to this type from the input type.
Source§

impl From<Query> for Statement

Source§

fn from(q: Query) -> Statement

Converts to this type from the input type.
Source§

impl From<RaiseStatement> for Statement

Source§

fn from(r: RaiseStatement) -> Statement

Converts to this type from the input type.
Source§

impl From<RenameTable> for Statement

Source§

fn from(r: RenameTable) -> Statement

Converts to this type from the input type.
Source§

impl From<ResetStatement> for Statement

Source§

fn from(r: ResetStatement) -> Statement

Converts to this type from the input type.
Source§

impl From<ReturnStatement> for Statement

Source§

fn from(r: ReturnStatement) -> Statement

Converts to this type from the input type.
Source§

impl From<Revoke> for Statement

Source§

fn from(v: Revoke) -> Statement

Converts to this type from the input type.
Source§

impl From<Set> for Statement

Source§

fn from(s: Set) -> Statement

Converts to this type from the input type.
Source§

impl From<ShowCharset> for Statement

Source§

fn from(s: ShowCharset) -> Statement

Converts to this type from the input type.
Source§

impl From<ShowObjects> for Statement

Source§

fn from(s: ShowObjects) -> Statement

Converts to this type from the input type.
Source§

impl From<Truncate> for Statement

Source§

fn from(truncate: Truncate) -> Statement

Converts to this type from the input type.
Source§

impl From<Update> for Statement

Source§

fn from(u: Update) -> Statement

Converts to this type from the input type.
Source§

impl From<Use> for Statement

Source§

fn from(u: Use) -> Statement

Converts to this type from the input type.
Source§

impl From<VacuumStatement> for Statement

Source§

fn from(v: VacuumStatement) -> Statement

Converts to this type from the input type.
Source§

impl From<Vec<RenameTable>> for Statement

Source§

fn from(r: Vec<RenameTable>) -> Statement

Converts to this type from the input type.
Source§

impl From<WhileStatement> for Statement

Source§

fn from(w: WhileStatement) -> Statement

Converts to this type from the input type.
Source§

impl Hash for Statement

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

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

impl Ord for Statement

Source§

fn cmp(&self, other: &Statement) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for Statement

Source§

fn eq(&self, other: &Statement) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for Statement

Source§

fn partial_cmp(&self, other: &Statement) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Spanned for Statement

§partial span

Missing spans:

Source§

fn span(&self) -> Span

Return the Span (the minimum and maximum Location) for this AST node, by recursively combining the spans of its children.
Source§

impl Eq for Statement

Source§

impl StructuralPartialEq for Statement

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Key for T
where T: Clone,

Source§

fn align() -> usize

The alignment necessary for the key. Must return a power of two.
Source§

fn size(&self) -> usize

The size of the key in bytes.
Source§

unsafe fn init(&self, ptr: *mut u8)

Initialize the key in the given memory location. Read more
Source§

unsafe fn get<'a>(ptr: *const u8) -> &'a T

Get a reference to the key from the given memory location. Read more
Source§

unsafe fn drop_in_place(ptr: *mut u8)

Drop the key in place. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToCompactString for T
where T: Display,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T> ToStringFallible for T
where T: Display,

Source§

fn try_to_string(&self) -> Result<String, TryReserveError>

ToString::to_string, but without panic on OOM.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> PlanCallbackArgs for T

Source§

impl<T> PlanCallbackOut for T