risingwave_sqlparser::ast

Enum Statement

source
pub enum Statement {
Show 64 variants Analyze { table_name: ObjectName, }, Truncate { table_name: ObjectName, }, Query(Box<Query>), Insert { table_name: ObjectName, columns: Vec<Ident>, source: Box<Query>, returning: Vec<SelectItem>, }, Copy { table_name: ObjectName, columns: Vec<Ident>, values: Vec<Option<String>>, }, Update { table_name: ObjectName, assignments: Vec<Assignment>, selection: Option<Expr>, returning: Vec<SelectItem>, }, Delete { table_name: ObjectName, selection: Option<Expr>, returning: Vec<SelectItem>, }, Discard(DiscardType), CreateView { or_replace: bool, materialized: bool, if_not_exists: bool, name: ObjectName, columns: Vec<Ident>, query: Box<Query>, emit_mode: Option<EmitMode>, with_options: Vec<SqlOption>, }, CreateTable {
Show 16 fields or_replace: bool, temporary: bool, if_not_exists: bool, name: ObjectName, columns: Vec<ColumnDef>, wildcard_idx: Option<usize>, constraints: Vec<TableConstraint>, with_options: Vec<SqlOption>, format_encode: Option<CompatibleFormatEncode>, source_watermarks: Vec<SourceWatermark>, append_only: bool, on_conflict: Option<OnConflict>, with_version_column: Option<String>, query: Option<Box<Query>>, cdc_table_info: Option<CdcTableInfo>, include_column_options: IncludeOption,
}, CreateIndex { name: ObjectName, table_name: ObjectName, columns: Vec<OrderByExpr>, include: Vec<Ident>, distributed_by: Vec<Expr>, unique: bool, if_not_exists: bool, }, CreateSource { stmt: CreateSourceStatement, }, CreateSink { stmt: CreateSinkStatement, }, CreateSubscription { stmt: CreateSubscriptionStatement, }, CreateConnection { stmt: CreateConnectionStatement, }, CreateSecret { stmt: CreateSecretStatement, }, CreateFunction { or_replace: bool, temporary: bool, name: ObjectName, args: Option<Vec<OperateFunctionArg>>, returns: Option<CreateFunctionReturns>, params: CreateFunctionBody, with_options: CreateFunctionWithOptions, }, CreateAggregate { or_replace: bool, name: ObjectName, args: Vec<OperateFunctionArg>, returns: DataType, append_only: bool, params: CreateFunctionBody, }, DeclareCursor { stmt: DeclareCursorStatement, }, FetchCursor { stmt: FetchCursorStatement, }, CloseCursor { stmt: CloseCursorStatement, }, AlterDatabase { name: ObjectName, operation: AlterDatabaseOperation, }, AlterSchema { name: ObjectName, operation: AlterSchemaOperation, }, AlterTable { name: ObjectName, operation: AlterTableOperation, }, AlterIndex { name: ObjectName, operation: AlterIndexOperation, }, AlterView { name: ObjectName, materialized: bool, operation: AlterViewOperation, }, AlterSink { name: ObjectName, operation: AlterSinkOperation, }, AlterSubscription { name: ObjectName, operation: AlterSubscriptionOperation, }, AlterSource { name: ObjectName, operation: AlterSourceOperation, }, AlterFunction { name: ObjectName, args: Option<Vec<OperateFunctionArg>>, operation: AlterFunctionOperation, }, AlterConnection { name: ObjectName, operation: AlterConnectionOperation, }, Describe { name: ObjectName, }, ShowObjects { object: ShowObject, filter: Option<ShowStatementFilter>, }, ShowCreateObject { create_type: ShowCreateType, name: ObjectName, }, ShowTransactionIsolationLevel, CancelJobs(JobIdents), Kill(i32), Drop(DropStatement), DropFunction { if_exists: bool, func_desc: Vec<FunctionDesc>, option: Option<ReferentialAction>, }, DropAggregate { if_exists: bool, func_desc: Vec<FunctionDesc>, option: Option<ReferentialAction>, }, SetVariable { local: bool, variable: Ident, value: SetVariableValue, }, ShowVariable { variable: Vec<Ident>, }, StartTransaction { modes: Vec<TransactionMode>, }, Begin { modes: Vec<TransactionMode>, }, Abort, SetTransaction { modes: Vec<TransactionMode>, snapshot: Option<Value>, session: bool, }, SetTimeZone { local: bool, value: SetTimeZoneValue, }, Comment { object_type: CommentObject, object_name: ObjectName, comment: Option<String>, }, Commit { chain: bool, }, Rollback { chain: bool, }, CreateSchema { schema_name: ObjectName, if_not_exists: bool, owner: Option<ObjectName>, }, CreateDatabase { db_name: ObjectName, if_not_exists: bool, owner: Option<ObjectName>, }, Grant { privileges: Privileges, objects: GrantObjects, grantees: Vec<Ident>, with_grant_option: bool, granted_by: Option<Ident>, }, Revoke { privileges: Privileges, objects: GrantObjects, grantees: Vec<Ident>, granted_by: Option<Ident>, revoke_grant_option: bool, cascade: bool, }, Deallocate { name: Ident, prepare: bool, }, Execute { name: Ident, parameters: Vec<Expr>, }, Prepare { name: Ident, data_types: Vec<DataType>, statement: Box<Statement>, }, Explain { analyze: bool, statement: Box<Statement>, options: ExplainOptions, }, CreateUser(CreateUserStatement), AlterUser(AlterUserStatement), AlterSystem { param: Ident, value: SetVariableValue, }, Flush, Wait, Recover,
}
Expand description

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

Variants§

§

Analyze

Analyze (Hive)

Fields

§table_name: ObjectName
§

Truncate

Truncate (Hive)

Fields

§table_name: ObjectName
§

Query(Box<Query>)

SELECT

§

Insert

INSERT

Fields

§table_name: ObjectName

TABLE

§columns: Vec<Ident>

COLUMNS

§source: Box<Query>

A SQL query that specifies what to insert

§returning: Vec<SelectItem>

Define output of this insert statement

§

Copy

Fields

§table_name: ObjectName

TABLE

§columns: Vec<Ident>

COLUMNS

§values: Vec<Option<String>>

VALUES a vector of values to be copied

§

Update

UPDATE

Fields

§table_name: ObjectName

TABLE

§assignments: Vec<Assignment>

Column assignments

§selection: Option<Expr>

WHERE

§returning: Vec<SelectItem>

RETURNING

§

Delete

DELETE

Fields

§table_name: ObjectName

FROM

§selection: Option<Expr>

WHERE

§returning: Vec<SelectItem>

RETURNING

§

Discard(DiscardType)

DISCARD

§

CreateView

CREATE VIEW

Fields

§or_replace: bool
§materialized: bool
§if_not_exists: bool
§name: ObjectName

View name

§columns: Vec<Ident>
§query: Box<Query>
§emit_mode: Option<EmitMode>
§with_options: Vec<SqlOption>
§

CreateTable

CREATE TABLE

Fields

§or_replace: bool
§temporary: bool
§if_not_exists: bool
§name: ObjectName

Table name

§columns: Vec<ColumnDef>

Optional schema

§wildcard_idx: Option<usize>
§constraints: Vec<TableConstraint>
§with_options: Vec<SqlOption>
§format_encode: Option<CompatibleFormatEncode>

FORMAT ... ENCODE ... for table with connector

§source_watermarks: Vec<SourceWatermark>

The watermark defined on source.

§append_only: bool

Append only table.

§on_conflict: Option<OnConflict>

On conflict behavior

§with_version_column: Option<String>

with_version_column behind on conflict

§query: Option<Box<Query>>

AS ( query )

§cdc_table_info: Option<CdcTableInfo>

FROM cdc_source TABLE database_name.table_name

§include_column_options: IncludeOption

INCLUDE a AS b INCLUDE c

§

CreateIndex

CREATE INDEX

Fields

§name: ObjectName

index name

§table_name: ObjectName
§columns: Vec<OrderByExpr>
§include: Vec<Ident>
§distributed_by: Vec<Expr>
§unique: bool
§if_not_exists: bool
§

CreateSource

CREATE SOURCE

§

CreateSink

CREATE SINK

§

CreateSubscription

CREATE SUBSCRIPTION

§

CreateConnection

CREATE CONNECTION

§

CreateSecret

§

CreateFunction

Fields

§or_replace: bool
§temporary: bool
§params: CreateFunctionBody

Optional parameters.

§

CreateAggregate

Fields

§or_replace: bool
§returns: DataType
§append_only: bool

Optional parameters.

§

DeclareCursor

DECLARE CURSOR

§

FetchCursor

§

CloseCursor

§

AlterDatabase

ALTER DATABASE

§

AlterSchema

ALTER SCHEMA

Fields

§

AlterTable

ALTER TABLE

Fields

§name: ObjectName

Table name

§

AlterIndex

ALTER INDEX

Fields

§name: ObjectName

Index name

§

AlterView

ALTER VIEW

Fields

§name: ObjectName

View name

§materialized: bool
§

AlterSink

ALTER SINK

Fields

§name: ObjectName

Sink name

§

AlterSubscription

§

AlterSource

ALTER SOURCE

Fields

§name: ObjectName

Source name

§

AlterFunction

ALTER FUNCTION

Fields

§name: ObjectName

Function name

§

AlterConnection

ALTER CONNECTION

Fields

§name: ObjectName

Connection name

§

Describe

DESCRIBE TABLE OR SOURCE

Fields

§name: ObjectName

Table or Source name

§

ShowObjects

SHOW OBJECT COMMAND

§

ShowCreateObject

SHOW CREATE COMMAND

Fields

§create_type: ShowCreateType

Show create object type

§name: ObjectName

Show create object name

§

ShowTransactionIsolationLevel

§

CancelJobs(JobIdents)

CANCEL JOBS COMMAND

§

Kill(i32)

KILL COMMAND Kill process in the show processlist.

§

Drop(DropStatement)

DROP

§

DropFunction

DROP FUNCTION

Fields

§if_exists: bool
§func_desc: Vec<FunctionDesc>

One or more function to drop

§option: Option<ReferentialAction>

CASCADE or RESTRICT

§

DropAggregate

DROP AGGREGATE

Fields

§if_exists: bool
§func_desc: Vec<FunctionDesc>

One or more function to drop

§option: Option<ReferentialAction>

CASCADE or RESTRICT

§

SetVariable

SET <variable>

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

Fields

§local: bool
§variable: Ident
§

ShowVariable

SHOW <variable>

Note: this is a PostgreSQL-specific statement.

Fields

§variable: Vec<Ident>
§

StartTransaction

START TRANSACTION ...

Fields

§

Begin

BEGIN [ TRANSACTION | WORK ]

Fields

§

Abort

ABORT

§

SetTransaction

SET TRANSACTION ...

Fields

§snapshot: Option<Value>
§session: bool
§

SetTimeZone

SET [ SESSION | LOCAL ] TIME ZONE { value | 'value' | LOCAL | DEFAULT }

Fields

§local: bool
§

Comment

COMMENT ON ...

Note: this is a PostgreSQL-specific statement.

Fields

§object_type: CommentObject
§object_name: ObjectName
§comment: Option<String>
§

Commit

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

Fields

§chain: bool
§

Rollback

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

Fields

§chain: bool
§

CreateSchema

CREATE SCHEMA

Fields

§schema_name: ObjectName
§if_not_exists: bool
§

CreateDatabase

CREATE DATABASE

Fields

§db_name: ObjectName
§if_not_exists: bool
§

Grant

GRANT privileges ON objects TO grantees

Fields

§privileges: Privileges
§grantees: Vec<Ident>
§with_grant_option: bool
§granted_by: Option<Ident>
§

Revoke

REVOKE privileges ON objects FROM grantees

Fields

§privileges: Privileges
§grantees: Vec<Ident>
§granted_by: Option<Ident>
§revoke_grant_option: bool
§cascade: bool
§

Deallocate

DEALLOCATE [ PREPARE ] { name | ALL }

Note: this is a PostgreSQL-specific statement.

Fields

§name: Ident
§prepare: bool
§

Execute

EXECUTE name [ ( parameter [, ...] ) ]

Note: this is a PostgreSQL-specific statement.

Fields

§name: Ident
§parameters: Vec<Expr>
§

Prepare

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

Note: this is a PostgreSQL-specific statement.

Fields

§name: Ident
§data_types: Vec<DataType>
§statement: Box<Statement>
§

Explain

EXPLAIN / DESCRIBE for select_statement

Fields

§analyze: bool

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

§statement: Box<Statement>

A SQL query that specifies what to explain

§options: ExplainOptions

options of the explain statement

§

CreateUser(CreateUserStatement)

CREATE USER

§

AlterUser(AlterUserStatement)

ALTER USER

§

AlterSystem

ALTER SYSTEM SET configuration_parameter { TO | = } { value | ‘value’ | DEFAULT }

Fields

§param: Ident
§

Flush

FLUSH the current barrier.

Note: RisingWave specific statement.

§

Wait

WAIT for ALL running stream jobs to finish. It will block the current session the condition is met.

§

Recover

Trigger stream job recover

Implementations§

Trait Implementations§

source§

impl Clone for Statement

source§

fn clone(&self) -> Statement

Returns a copy 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

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

impl Display for Statement

source§

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

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

impl Hash for Statement

source§

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

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 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 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, dst: *mut T)

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

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

§

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

Checks if this value is equivalent to the given key. Read more
§

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

§

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.

§

impl<T> Instrument for T

§

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

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

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

default fn to_string(&self) -> String

Converts the given value to a String. Read more
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.
§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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