Type Alias Ast

Source
pub type Ast = Statement;

Aliased Type§

pub enum Ast {
Show 72 variants Analyze { table_name: ObjectName, }, Truncate { table_name: ObjectName, }, Refresh { 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 18 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_columns: Vec<Ident>, query: Option<Box<Query>>, cdc_table_info: Option<CdcTableInfo>, include_column_options: Vec<IncludeOptionItem>, webhook_info: Option<WebhookSourceInfo>, engine: Engine,
}, CreateIndex { name: ObjectName, table_name: ObjectName, columns: Vec<OrderByExpr>, method: Option<Ident>, include: Vec<Ident>, distributed_by: Vec<Expr>, unique: bool, if_not_exists: bool, with_properties: WithProperties, }, CreateSource { stmt: CreateSourceStatement, }, CreateSink { stmt: CreateSinkStatement, }, CreateSubscription { stmt: CreateSubscriptionStatement, }, CreateConnection { stmt: CreateConnectionStatement, }, CreateSecret { stmt: CreateSecretStatement, }, CreateFunction { or_replace: bool, temporary: bool, if_not_exists: bool, name: ObjectName, args: Option<Vec<OperateFunctionArg>>, returns: Option<CreateFunctionReturns>, params: CreateFunctionBody, with_options: CreateFunctionWithOptions, }, CreateAggregate { or_replace: bool, if_not_exists: 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, }, AlterSecret { name: ObjectName, with_options: Vec<SqlOption>, operation: AlterSecretOperation, }, AlterFragment { fragment_id: u32, operation: AlterFragmentOperation, }, AlterDefaultPrivileges { target_users: Option<Vec<Ident>>, schema_names: Option<Vec<ObjectName>>, operation: DefaultPrivilegeOperation, }, Describe { name: ObjectName, kind: DescribeKind, }, DescribeFragment { fragment_id: u32, }, ShowObjects { object: ShowObject, filter: Option<ShowStatementFilter>, }, ShowCreateObject { create_type: ShowCreateType, name: ObjectName, }, ShowTransactionIsolationLevel, CancelJobs(JobIdents), Kill(String), 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>, resource_group: Option<SetVariableValue>, barrier_interval_ms: Option<u32>, checkpoint_frequency: Option<u64>, }, 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: Option<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, }, ExplainAnalyzeStreamJob { target: AnalyzeTarget, duration_secs: Option<u64>, }, CreateUser(CreateUserStatement), AlterUser(AlterUserStatement), AlterSystem { param: Ident, value: SetVariableValue, }, Flush, Wait, Recover, Use { db_name: ObjectName, }, Vacuum { object_name: ObjectName, full: bool, },
}

Variants§

§

Analyze

Analyze (Hive)

Fields

§table_name: ObjectName
§

Truncate

Truncate (Hive)

Fields

§table_name: ObjectName
§

Refresh

Refresh table

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_columns: Vec<Ident>

with_version_columns behind on conflict - supports multiple version columns

§query: Option<Box<Query>>

AS ( query )

§cdc_table_info: Option<CdcTableInfo>

FROM cdc_source TABLE database_name.table_name

§include_column_options: Vec<IncludeOptionItem>

INCLUDE a AS b INCLUDE c

§webhook_info: Option<WebhookSourceInfo>

VALIDATE SECRET secure_secret_name AS secure_compare ()

§engine: Engine

Engine = [hummock | iceberg]

§

CreateIndex

CREATE INDEX

Fields

§name: ObjectName

index name

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

CreateSource

CREATE SOURCE

§

CreateSink

CREATE SINK

§

CreateSubscription

CREATE SUBSCRIPTION

§

CreateConnection

CREATE CONNECTION

§

CreateSecret

§

CreateFunction

Fields

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

Optional parameters.

§

CreateAggregate

Fields

§or_replace: bool
§if_not_exists: 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

§

AlterSecret

ALTER SECRET

Fields

§name: ObjectName

Secret name

§with_options: Vec<SqlOption>
§

AlterFragment

ALTER FRAGMENT

Fields

§fragment_id: u32
§

AlterDefaultPrivileges

DESCRIBE relation ALTER DEFAULT PRIVILEGES

Fields

§target_users: Option<Vec<Ident>>
§schema_names: Option<Vec<ObjectName>>
§

Describe

DESCRIBE relation

Fields

§name: ObjectName

relation name

§

DescribeFragment

DESCRIBE FRAGMENT <fragment_id>

Fields

§fragment_id: u32
§

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(String)

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
§resource_group: Option<SetVariableValue>
§barrier_interval_ms: Option<u32>
§checkpoint_frequency: Option<u64>
§

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

§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

§

ExplainAnalyzeStreamJob

EXPLAIN ANALYZE for stream job We introduce a new statement rather than reuse EXPLAIN because the body of the statement is not an SQL query. TODO(kwannoel): Make profiling duration configurable: EXPLAIN ANALYZE (DURATION 1s) …

Fields

§duration_secs: Option<u64>
§

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

§

Use

USE <db_name>

Note: this is a RisingWave specific statement and used to switch the current database.

Fields

§db_name: ObjectName
§

Vacuum

VACUUM [FULL] [database_name][schema_name][object_name]

Note: this is a RisingWave specific statement for iceberg table/sink compaction.

Fields

§object_name: ObjectName
§full: bool