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
returning: Vec<SelectItem>
Define output of this insert statement
Copy
Fields
table_name: ObjectName
TABLE
Update
UPDATE
Fields
table_name: ObjectName
TABLE
assignments: Vec<Assignment>
Column assignments
returning: Vec<SelectItem>
RETURNING
Delete
DELETE
Discard(DiscardType)
DISCARD
CreateView
CREATE VIEW
Fields
name: ObjectName
View name
CreateTable
CREATE TABLE
Fields
name: ObjectName
Table name
constraints: Vec<TableConstraint>
format_encode: Option<CompatibleFormatEncode>
FORMAT ... ENCODE ...
for table with connector
source_watermarks: Vec<SourceWatermark>
The watermark defined on source.
on_conflict: Option<OnConflict>
On conflict behavior
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
CreateSource
CREATE SOURCE
Fields
stmt: CreateSourceStatement
CreateSink
CREATE SINK
Fields
stmt: CreateSinkStatement
CreateSubscription
CREATE SUBSCRIPTION
Fields
CreateConnection
CREATE CONNECTION
Fields
CreateSecret
Fields
stmt: CreateSecretStatement
CreateFunction
CREATE FUNCTION
Postgres: https://www.postgresql.org/docs/15/sql-createfunction.html
Fields
name: ObjectName
args: Option<Vec<OperateFunctionArg>>
returns: Option<CreateFunctionReturns>
params: CreateFunctionBody
Optional parameters.
with_options: CreateFunctionWithOptions
CreateAggregate
CREATE AGGREGATE
Postgres: https://www.postgresql.org/docs/15/sql-createaggregate.html
DeclareCursor
DECLARE CURSOR
Fields
stmt: DeclareCursorStatement
FetchCursor
Fields
stmt: FetchCursorStatement
CloseCursor
Fields
stmt: CloseCursorStatement
AlterDatabase
ALTER DATABASE
AlterSchema
ALTER SCHEMA
AlterTable
ALTER TABLE
AlterIndex
ALTER INDEX
AlterView
ALTER VIEW
AlterSink
ALTER SINK
AlterSubscription
AlterSource
ALTER SOURCE
AlterFunction
ALTER FUNCTION
Fields
name: ObjectName
Function name
args: Option<Vec<OperateFunctionArg>>
operation: AlterFunctionOperation
AlterConnection
ALTER CONNECTION
Describe
DESCRIBE TABLE OR SOURCE
Fields
name: ObjectName
Table or Source name
ShowObjects
SHOW OBJECT COMMAND
ShowCreateObject
SHOW CREATE COMMAND
ShowTransactionIsolationLevel
CancelJobs(JobIdents)
CANCEL JOBS COMMAND
Kill(i32)
KILL COMMAND Kill process in the show processlist.
Drop(DropStatement)
DROP
DropFunction
DROP FUNCTION
Fields
func_desc: Vec<FunctionDesc>
One or more function to drop
option: Option<ReferentialAction>
CASCADE
or RESTRICT
DropAggregate
DROP AGGREGATE
Fields
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.
ShowVariable
SHOW <variable>
Note: this is a PostgreSQL-specific statement.
StartTransaction
START TRANSACTION ...
Fields
modes: Vec<TransactionMode>
Begin
BEGIN [ TRANSACTION | WORK ]
Fields
modes: Vec<TransactionMode>
Abort
ABORT
SetTransaction
SET TRANSACTION ...
SetTimeZone
SET [ SESSION | LOCAL ] TIME ZONE { value | 'value' | LOCAL | DEFAULT }
Comment
COMMENT ON ...
Note: this is a PostgreSQL-specific statement.
Commit
COMMIT [ TRANSACTION | WORK ] [ AND [ NO ] CHAIN ]
Rollback
ROLLBACK [ TRANSACTION | WORK ] [ AND [ NO ] CHAIN ]
CreateSchema
CREATE SCHEMA
CreateDatabase
CREATE DATABASE
Grant
GRANT privileges ON objects TO grantees
Revoke
REVOKE privileges ON objects FROM grantees
Deallocate
DEALLOCATE [ PREPARE ] { name | ALL }
Note: this is a PostgreSQL-specific statement.
Execute
EXECUTE name [ ( parameter [, ...] ) ]
Note: this is a PostgreSQL-specific statement.
Prepare
PREPARE name [ ( data_type [, ...] ) ] AS statement
Note: this is a PostgreSQL-specific statement.
Explain
EXPLAIN / DESCRIBE for select_statement
Fields
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 }
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§
source§impl Statement
impl Statement
pub fn to_redacted_string(&self, keywords: RedactSqlOptionKeywordsRef) -> String
Trait Implementations§
impl Eq for Statement
impl StructuralPartialEq for Statement
Auto Trait Implementations§
impl Freeze for Statement
impl RefUnwindSafe for Statement
impl Send for Statement
impl Sync for Statement
impl Unpin for Statement
impl UnwindSafe for Statement
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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