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
CreateIndex
DropIndex
CreateView
Fields
DropTable
DropView
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.
Insert
Fields
returning: Option<Vec<SelectItem>>Query(QueryExpr)
Begin
Fields
isolation: Option<IsolationLevel>Commit
Rollback
Update
Fields
returning: Option<Vec<SelectItem>>Delete
Set
SP37: SET [LOCAL] <name> = <value> / SET <name> TO <value> / SET TIME ZONE ....
Show
SP37: SHOW <name> / SHOW TIME ZONE.
Reset
SP37: RESET <name>.
Fields
target: ResetTargetCreateRole
DropRole
GrantTablePrivileges
RevokeTablePrivileges
SetRole
CreateFdw
CREATE FOREIGN DATA WRAPPER <name> OPTIONS (…)
DropFdw
DROP FOREIGN DATA WRAPPER [IF EXISTS] <name>
CreateServer
CREATE SERVER <name> FOREIGN DATA WRAPPER <wrapper> OPTIONS (…)
AlterServer
ALTER SERVER <name> OPTIONS (…)
DropServer
DROP SERVER [IF EXISTS] <name>
CreateUserMapping
CREATE USER MAPPING FOR <user> SERVER <server> OPTIONS (…)
AlterUserMapping
ALTER USER MAPPING FOR <user> SERVER <server> OPTIONS (…)
DropUserMapping
DROP USER MAPPING [IF EXISTS] FOR <user> SERVER <server>
CreateForeignTable
CREATE FOREIGN TABLE <name> (<col> <type>, …) SERVER <server> OPTIONS (…)
DropForeignTable
DROP FOREIGN TABLE [IF EXISTS] <name>
ImportForeignSchema
IMPORT FOREIGN SCHEMA <remote_schema> [LIMIT TO | EXCEPT (<tables>)] FROM SERVER <server> [INTO <local_schema>]
Implementations§
Source§impl Statement
impl Statement
Sourcepub const fn compatibility_refusal(&self) -> Option<RefusalCommand>
pub const fn compatibility_refusal(&self) -> Option<RefusalCommand>
Return the centralized refusal contract for richer refusal AST variants.