pub enum DdlOperation {
Show 16 variants
CreateTable {
table: String,
if_not_exists: bool,
},
DropTable {
table: String,
},
AlterTableAddColumn {
table: String,
column: String,
data_type: String,
has_default: bool,
is_not_null: bool,
if_not_exists: bool,
default_expr: Option<String>,
},
AlterTableDropColumn {
table: String,
column: String,
},
AlterTableAlterColumn {
table: String,
column: String,
},
CreateIndex {
name: String,
table: String,
is_concurrent: bool,
is_unique: bool,
},
DropIndex {
name: String,
},
CreateView {
name: String,
is_materialized: bool,
},
DropView {
name: String,
},
CreateFunction {
name: String,
},
DropFunction {
name: String,
},
AddConstraint {
table: String,
constraint_type: String,
},
DropConstraint {
table: String,
name: String,
},
CreateEnum {
name: String,
},
TruncateTable {
table: String,
},
Other {
statement_preview: String,
},
}Expand description
A DDL operation extracted from SQL.
Variants§
CreateTable
A CREATE TABLE statement.
Fields
DropTable
A DROP TABLE statement.
AlterTableAddColumn
An ALTER TABLE … ADD COLUMN statement.
Fields
has_default: boolWhether the column has a DEFAULT expression.
Determined from the parsed column definition only — a DEFAULT
appearing inside a CHECK (...) expression, a string literal, or
a comment does not count.
AlterTableDropColumn
An ALTER TABLE … DROP COLUMN statement.
Fields
AlterTableAlterColumn
An ALTER TABLE … ALTER COLUMN statement.
Fields
CreateIndex
A CREATE INDEX statement.
Fields
DropIndex
A DROP INDEX statement.
CreateView
A CREATE VIEW or CREATE MATERIALIZED VIEW statement.
Fields
DropView
A DROP VIEW statement.
CreateFunction
A CREATE FUNCTION statement.
DropFunction
A DROP FUNCTION statement.
AddConstraint
An ALTER TABLE … ADD CONSTRAINT statement.
Fields
DropConstraint
An ALTER TABLE … DROP CONSTRAINT statement.
Fields
CreateEnum
A CREATE TYPE … AS ENUM statement.
TruncateTable
A TRUNCATE TABLE statement.
Other
Any other SQL statement that does not match known DDL patterns.
Trait Implementations§
Source§impl Clone for DdlOperation
impl Clone for DdlOperation
Source§fn clone(&self) -> DdlOperation
fn clone(&self) -> DdlOperation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more