Enum sqlparser::ast::AlterTableOperation
source · [−]pub enum AlterTableOperation {
AddConstraint(TableConstraint),
AddColumn {
column_def: ColumnDef,
},
DropConstraint {
if_exists: bool,
name: Ident,
cascade: bool,
},
DropColumn {
column_name: Ident,
if_exists: bool,
cascade: bool,
},
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
Fields
column_def: ColumnDef
ADD [ COLUMN ] <column_def>
DropConstraint
DROP CONSTRAINT [ IF EXISTS ] <name>
DropColumn
DROP [ COLUMN ] [ IF EXISTS ] <column_name> [ CASCADE ]
RenamePartitions
RENAME TO PARTITION (partition=val)
AddPartitions
Add Partitions
DropPartitions
RenameColumn
RENAME [ COLUMN ] <old_column_name> TO <new_column_name>
RenameTable
Fields
table_name: ObjectName
RENAME 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
sourceimpl Clone for AlterTableOperation
impl Clone for AlterTableOperation
sourcefn clone(&self) -> AlterTableOperation
fn clone(&self) -> AlterTableOperation
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for AlterTableOperation
impl Debug for AlterTableOperation
sourceimpl Display for AlterTableOperation
impl Display for AlterTableOperation
sourceimpl Hash for AlterTableOperation
impl Hash for AlterTableOperation
sourceimpl PartialEq<AlterTableOperation> for AlterTableOperation
impl PartialEq<AlterTableOperation> for AlterTableOperation
sourcefn eq(&self, other: &AlterTableOperation) -> bool
fn eq(&self, other: &AlterTableOperation) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &AlterTableOperation) -> bool
fn ne(&self, other: &AlterTableOperation) -> bool
This method tests for !=
.
impl Eq for AlterTableOperation
impl StructuralEq for AlterTableOperation
impl StructuralPartialEq for AlterTableOperation
Auto Trait Implementations
impl RefUnwindSafe for AlterTableOperation
impl Send for AlterTableOperation
impl Sync for AlterTableOperation
impl Unpin for AlterTableOperation
impl UnwindSafe for AlterTableOperation
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more