Skip to main content

Statement

Enum Statement 

Source
pub enum Statement {
Show 34 variants CompatibilityRefusal(RefusalCommand), CreateTable { name: String, columns: Vec<ColumnDef>, constraints: Vec<TableConstraint>, sharded: bool, sharding: Option<ShardingSpec>, }, CreateIndex { name: String, table: String, columns: Vec<String>, unique: bool, placement: IndexPlacement, }, DropIndex { name: String, if_exists: bool, }, CreateView { name: String, definition: String, query: QueryExpr, }, DropTable { name: String, }, DropView { name: String, if_exists: bool, }, AlterTableRename { table: String, rename: AlterTableRename, }, Insert { table: String, columns: Option<Vec<String>>, rows: Vec<Vec<Expr>>, returning: Option<Vec<SelectItem>>, }, Query(QueryExpr), Begin { isolation: Option<IsolationLevel>, }, Commit, Rollback, Update { table: String, assignments: Vec<(String, Expr)>, filter: Option<Expr>, returning: Option<Vec<SelectItem>>, }, Delete { table: String, filter: Option<Expr>, returning: Option<Vec<SelectItem>>, }, Set { local: bool, name: String, value: SetValue, }, Show { name: String, }, Reset { target: ResetTarget, }, CreateRole { name: String, can_login: bool, }, DropRole { name: String, }, GrantTablePrivileges { privileges: Vec<String>, table: String, grantees: Vec<String>, }, RevokeTablePrivileges { privileges: Vec<String>, table: String, grantees: Vec<String>, }, SetRole { role: Option<String>, }, CreateFdw { name: String, options: OptionList, }, DropFdw { name: String, if_exists: bool, }, CreateServer { name: String, wrapper: String, options: OptionList, }, AlterServer { name: String, options: OptionList, }, DropServer { name: String, if_exists: bool, }, CreateUserMapping { user: String, server: String, options: OptionList, }, AlterUserMapping { user: String, server: String, options: OptionList, }, DropUserMapping { user: String, server: String, if_exists: bool, }, CreateForeignTable { name: String, columns: Vec<ColumnDef>, server: String, options: OptionList, }, DropForeignTable { name: String, if_exists: bool, }, ImportForeignSchema { remote_schema: String, selector: ImportSelector, server: String, into_schema: String, },
}

Variants§

§

CompatibilityRefusal(RefusalCommand)

A PostgreSQL command that is recognized deliberately but cannot be executed by the Gres architecture. Metadata lives on RefusalCommand so parser, session, and compatibility tooling share one contract.

§

CreateTable

Fields

§name: String
§columns: Vec<ColumnDef>
§constraints: Vec<TableConstraint>
§sharded: bool
§

CreateIndex

Fields

§name: String
§table: String
§columns: Vec<String>
§unique: bool
§placement: IndexPlacement
§

DropIndex

Fields

§name: String
§if_exists: bool
§

CreateView

Fields

§name: String
§definition: String

Exact query text following AS, retained for durable catalog storage.

§query: QueryExpr

Parsed definition used by the executor to validate the view schema.

§

DropTable

Fields

§name: String
§

DropView

Fields

§name: String
§if_exists: bool
§

AlterTableRename

Bounded ALTER TABLE rename support. Column renames are parsed so they can fail with a clear unsupported-feature error until dependencies can be rewritten safely.

Fields

§table: String
§

Insert

Fields

§table: String
§columns: Option<Vec<String>>
§rows: Vec<Vec<Expr>>
§returning: Option<Vec<SelectItem>>
§

Query(QueryExpr)

§

Begin

Fields

§

Commit

§

Rollback

§

Update

Fields

§table: String
§assignments: Vec<(String, Expr)>
§filter: Option<Expr>
§returning: Option<Vec<SelectItem>>
§

Delete

Fields

§table: String
§filter: Option<Expr>
§returning: Option<Vec<SelectItem>>
§

Set

SP37: SET [LOCAL] <name> = <value> / SET <name> TO <value> / SET TIME ZONE ....

Fields

§local: bool
§name: String
§value: SetValue
§

Show

SP37: SHOW <name> / SHOW TIME ZONE.

Fields

§name: String
§

Reset

SP37: RESET <name>.

Fields

§

CreateRole

Fields

§name: String
§can_login: bool
§

DropRole

Fields

§name: String
§

GrantTablePrivileges

Fields

§privileges: Vec<String>
§table: String
§grantees: Vec<String>
§

RevokeTablePrivileges

Fields

§privileges: Vec<String>
§table: String
§grantees: Vec<String>
§

SetRole

Fields

§

CreateFdw

CREATE FOREIGN DATA WRAPPER <name> OPTIONS (…)

Fields

§name: String
§options: OptionList
§

DropFdw

DROP FOREIGN DATA WRAPPER [IF EXISTS] <name>

Fields

§name: String
§if_exists: bool
§

CreateServer

CREATE SERVER <name> FOREIGN DATA WRAPPER <wrapper> OPTIONS (…)

Fields

§name: String
§wrapper: String
§options: OptionList
§

AlterServer

ALTER SERVER <name> OPTIONS (…)

Fields

§name: String
§options: OptionList
§

DropServer

DROP SERVER [IF EXISTS] <name>

Fields

§name: String
§if_exists: bool
§

CreateUserMapping

CREATE USER MAPPING FOR <user> SERVER <server> OPTIONS (…)

Fields

§user: String
§server: String
§options: OptionList
§

AlterUserMapping

ALTER USER MAPPING FOR <user> SERVER <server> OPTIONS (…)

Fields

§user: String
§server: String
§options: OptionList
§

DropUserMapping

DROP USER MAPPING [IF EXISTS] FOR <user> SERVER <server>

Fields

§user: String
§server: String
§if_exists: bool
§

CreateForeignTable

CREATE FOREIGN TABLE <name> (<col> <type>, …) SERVER <server> OPTIONS (…)

Fields

§name: String
§columns: Vec<ColumnDef>
§server: String
§options: OptionList
§

DropForeignTable

DROP FOREIGN TABLE [IF EXISTS] <name>

Fields

§name: String
§if_exists: bool
§

ImportForeignSchema

IMPORT FOREIGN SCHEMA <remote_schema> [LIMIT TO | EXCEPT (<tables>)] FROM SERVER <server> [INTO <local_schema>]

Fields

§remote_schema: String
§server: String
§into_schema: String

Implementations§

Source§

impl Statement

Source

pub const fn compatibility_refusal(&self) -> Option<RefusalCommand>

Return the centralized refusal contract for richer refusal AST variants.

Trait Implementations§

Source§

impl Clone for Statement

Source§

fn clone(&self) -> Statement

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 PartialEq for Statement

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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