Enum sqlparser::ast::AlterTableOperation
source · pub enum AlterTableOperation {
Show 13 variants
AddConstraint(TableConstraint),
AddColumn {
column_def: ColumnDef,
},
DropConstraint {
if_exists: bool,
name: Ident,
cascade: bool,
},
DropColumn {
column_name: Ident,
if_exists: bool,
cascade: bool,
},
DropPrimaryKey,
RenamePartitions {
old_partitions: Vec<Expr>,
new_partitions: Vec<Expr>,
},
AddPartitions {
if_not_exists: bool,
new_partitions: Vec<Expr>,
},
DropPartitions {
partitions: Vec<Expr>,
if_exists: bool,
},
RenameColumn {
old_column_name: Ident,
new_column_name: Ident,
},
RenameTable {
table_name: ObjectName,
},
ChangeColumn {
old_name: Ident,
new_name: Ident,
data_type: DataType,
options: Vec<ColumnOption>,
},
RenameConstraint {
old_name: Ident,
new_name: Ident,
},
AlterColumn {
column_name: Ident,
op: AlterColumnOperation,
},
}Expand description
An ALTER TABLE (Statement::AlterTable) operation
Variants§
AddConstraint(TableConstraint)
ADD <table_constraint>
AddColumn
ADD [ COLUMN ] <column_def>
DropConstraint
DROP CONSTRAINT [ IF EXISTS ] <name>
DropColumn
DROP [ COLUMN ] [ IF EXISTS ] <column_name> [ CASCADE ]
DropPrimaryKey
DROP PRIMARY KEY
Note: this is a MySQL-specific operation.
RenamePartitions
RENAME TO PARTITION (partition=val)
AddPartitions
Add Partitions
DropPartitions
RenameColumn
RENAME [ COLUMN ] <old_column_name> TO <new_column_name>
RenameTable
Fields
§
table_name: ObjectNameRENAME TO <table_name>
ChangeColumn
RenameConstraint
RENAME CONSTRAINT <old_constraint_name> TO <new_constraint_name>
Note: this is a PostgreSQL-specific operation.
AlterColumn
ALTER [ COLUMN ]
Trait Implementations§
source§impl Clone for AlterTableOperation
impl Clone for AlterTableOperation
source§fn clone(&self) -> AlterTableOperation
fn clone(&self) -> AlterTableOperation
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more