pub enum AlterTableOperation {
Show 39 variants
AddConstraint(TableConstraint),
AddColumn {
column_keyword: bool,
if_not_exists: bool,
column_def: ColumnDef,
column_position: Option<MySQLColumnPosition>,
},
AddProjection {
if_not_exists: bool,
name: Ident,
select: ProjectionSelect,
},
DropProjection {
if_exists: bool,
name: Ident,
},
MaterializeProjection {
if_exists: bool,
name: Ident,
partition: Option<Ident>,
},
ClearProjection {
if_exists: bool,
name: Ident,
partition: Option<Ident>,
},
DisableRowLevelSecurity,
DisableRule {
name: Ident,
},
DisableTrigger {
name: Ident,
},
DropConstraint {
if_exists: bool,
name: Ident,
drop_behavior: Option<DropBehavior>,
},
DropColumn {
column_name: Ident,
if_exists: bool,
drop_behavior: Option<DropBehavior>,
},
AttachPartition {
partition: Partition,
},
DetachPartition {
partition: Partition,
},
FreezePartition {
partition: Partition,
with_name: Option<Ident>,
},
UnfreezePartition {
partition: Partition,
with_name: Option<Ident>,
},
DropPrimaryKey,
EnableAlwaysRule {
name: Ident,
},
EnableAlwaysTrigger {
name: Ident,
},
EnableReplicaRule {
name: Ident,
},
EnableReplicaTrigger {
name: Ident,
},
EnableRowLevelSecurity,
EnableRule {
name: Ident,
},
EnableTrigger {
name: Ident,
},
RenamePartitions {
old_partitions: Vec<Expr>,
new_partitions: Vec<Expr>,
},
AddPartitions {
if_not_exists: bool,
new_partitions: Vec<Partition>,
},
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>,
column_position: Option<MySQLColumnPosition>,
},
ModifyColumn {
col_name: Ident,
data_type: DataType,
options: Vec<ColumnOption>,
column_position: Option<MySQLColumnPosition>,
},
RenameConstraint {
old_name: Ident,
new_name: Ident,
},
AlterColumn {
column_name: Ident,
op: AlterColumnOperation,
},
SwapWith {
table_name: ObjectName,
},
SetTblProperties {
table_properties: Vec<SqlOption>,
},
OwnerTo {
new_owner: Owner,
},
ClusterBy {
exprs: Vec<Expr>,
},
DropClusteringKey,
SuspendRecluster,
ResumeRecluster,
}
Expand description
An ALTER TABLE
(Statement::AlterTable
) operation
Variants§
AddConstraint(TableConstraint)
ADD <table_constraint>
AddColumn
ADD [COLUMN] [IF NOT EXISTS] <column_def>
Fields
column_position: Option<MySQLColumnPosition>
MySQL ALTER TABLE
only [FIRST | AFTER column_name]
AddProjection
ADD PROJECTION [IF NOT EXISTS] name ( SELECT <COLUMN LIST EXPR> [GROUP BY] [ORDER BY])
Note: this is a ClickHouse-specific operation. Please refer to ClickHouse
DropProjection
DROP PROJECTION [IF EXISTS] name
Note: this is a ClickHouse-specific operation. Please refer to ClickHouse
MaterializeProjection
MATERIALIZE PROJECTION [IF EXISTS] name [IN PARTITION partition_name]
Note: this is a ClickHouse-specific operation. Please refer to ClickHouse
ClearProjection
CLEAR PROJECTION [IF EXISTS] name [IN PARTITION partition_name]
Note: this is a ClickHouse-specific operation. Please refer to ClickHouse
DisableRowLevelSecurity
DISABLE ROW LEVEL SECURITY
Note: this is a PostgreSQL-specific operation.
DisableRule
DISABLE RULE rewrite_rule_name
Note: this is a PostgreSQL-specific operation.
DisableTrigger
DISABLE TRIGGER [ trigger_name | ALL | USER ]
Note: this is a PostgreSQL-specific operation.
DropConstraint
DROP CONSTRAINT [ IF EXISTS ] <name>
DropColumn
DROP [ COLUMN ] [ IF EXISTS ] <column_name> [ CASCADE ]
AttachPartition
ATTACH PART|PARTITION <partition_expr>
Note: this is a ClickHouse-specific operation, please refer to
ClickHouse
DetachPartition
DETACH PART|PARTITION <partition_expr>
Note: this is a ClickHouse-specific operation, please refer to
ClickHouse
FreezePartition
FREEZE PARTITION <partition_expr>
Note: this is a ClickHouse-specific operation, please refer to
ClickHouse
UnfreezePartition
UNFREEZE PARTITION <partition_expr>
Note: this is a ClickHouse-specific operation, please refer to
ClickHouse
DropPrimaryKey
DROP PRIMARY KEY
Note: this is a MySQL-specific operation.
EnableAlwaysRule
ENABLE ALWAYS RULE rewrite_rule_name
Note: this is a PostgreSQL-specific operation.
EnableAlwaysTrigger
ENABLE ALWAYS TRIGGER trigger_name
Note: this is a PostgreSQL-specific operation.
EnableReplicaRule
ENABLE REPLICA RULE rewrite_rule_name
Note: this is a PostgreSQL-specific operation.
EnableReplicaTrigger
ENABLE REPLICA TRIGGER trigger_name
Note: this is a PostgreSQL-specific operation.
EnableRowLevelSecurity
ENABLE ROW LEVEL SECURITY
Note: this is a PostgreSQL-specific operation.
EnableRule
ENABLE RULE rewrite_rule_name
Note: this is a PostgreSQL-specific operation.
EnableTrigger
ENABLE TRIGGER [ trigger_name | ALL | USER ]
Note: this is a PostgreSQL-specific operation.
RenamePartitions
RENAME TO PARTITION (partition=val)
AddPartitions
Add Partitions
DropPartitions
RenameColumn
RENAME [ COLUMN ] <old_column_name> TO <new_column_name>
RenameTable
RENAME TO <table_name>
Fields
table_name: ObjectName
ChangeColumn
Fields
options: Vec<ColumnOption>
column_position: Option<MySQLColumnPosition>
MySQL ALTER TABLE
only [FIRST | AFTER column_name]
ModifyColumn
Fields
options: Vec<ColumnOption>
column_position: Option<MySQLColumnPosition>
MySQL ALTER TABLE
only [FIRST | AFTER column_name]
RenameConstraint
RENAME CONSTRAINT <old_constraint_name> TO <new_constraint_name>
Note: this is a PostgreSQL-specific operation.
AlterColumn
ALTER [ COLUMN ]
SwapWith
‘SWAP WITH <table_name>’
Note: this is Snowflake specific https://docs.snowflake.com/en/sql-reference/sql/alter-table
Fields
table_name: ObjectName
SetTblProperties
‘SET TBLPROPERTIES ( { property_key [ = ] property_val } [, …] )’
OwnerTo
OWNER TO { <new_owner> | CURRENT_ROLE | CURRENT_USER | SESSION_USER }
Note: this is PostgreSQL-specific https://www.postgresql.org/docs/current/sql-altertable.html
ClusterBy
Snowflake table clustering options https://docs.snowflake.com/en/sql-reference/sql/alter-table#clustering-actions-clusteringaction
DropClusteringKey
SuspendRecluster
ResumeRecluster
Trait Implementations§
Source§impl Clone for AlterTableOperation
impl Clone for AlterTableOperation
Source§fn clone(&self) -> AlterTableOperation
fn clone(&self) -> AlterTableOperation
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for AlterTableOperation
impl Debug for AlterTableOperation
Source§impl Display for AlterTableOperation
impl Display for AlterTableOperation
Source§impl Hash for AlterTableOperation
impl Hash for AlterTableOperation
Source§impl Ord for AlterTableOperation
impl Ord for AlterTableOperation
Source§fn cmp(&self, other: &AlterTableOperation) -> Ordering
fn cmp(&self, other: &AlterTableOperation) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for AlterTableOperation
impl PartialEq for AlterTableOperation
Source§impl PartialOrd for AlterTableOperation
impl PartialOrd for AlterTableOperation
Source§impl Spanned for AlterTableOperation
§partial span
Missing spans:
impl Spanned for AlterTableOperation
§partial span
Missing spans:
Source§impl Visit for AlterTableOperation
impl Visit for AlterTableOperation
Source§impl VisitMut for AlterTableOperation
impl VisitMut for AlterTableOperation
fn visit<V>(&mut self, visitor: &mut V) -> ControlFlow<<V as VisitorMut>::Break>where
V: VisitorMut,
impl Eq for AlterTableOperation
impl StructuralPartialEq for AlterTableOperation
Auto Trait Implementations§
impl Freeze for AlterTableOperation
impl RefUnwindSafe for AlterTableOperation
impl Send for AlterTableOperation
impl Sync for AlterTableOperation
impl Unpin for AlterTableOperation
impl UnwindSafe for AlterTableOperation
Blanket Implementations§
Source§impl<T> AlignerFor<1> for T
impl<T> AlignerFor<1> for T
Source§impl<T> AlignerFor<1024> for T
impl<T> AlignerFor<1024> for T
Source§type Aligner = AlignTo1024<T>
type Aligner = AlignTo1024<T>
AlignTo*
type which aligns Self
to ALIGNMENT
.Source§impl<T> AlignerFor<128> for T
impl<T> AlignerFor<128> for T
Source§type Aligner = AlignTo128<T>
type Aligner = AlignTo128<T>
AlignTo*
type which aligns Self
to ALIGNMENT
.Source§impl<T> AlignerFor<16> for T
impl<T> AlignerFor<16> for T
Source§impl<T> AlignerFor<16384> for T
impl<T> AlignerFor<16384> for T
Source§type Aligner = AlignTo16384<T>
type Aligner = AlignTo16384<T>
AlignTo*
type which aligns Self
to ALIGNMENT
.Source§impl<T> AlignerFor<2> for T
impl<T> AlignerFor<2> for T
Source§impl<T> AlignerFor<2048> for T
impl<T> AlignerFor<2048> for T
Source§type Aligner = AlignTo2048<T>
type Aligner = AlignTo2048<T>
AlignTo*
type which aligns Self
to ALIGNMENT
.Source§impl<T> AlignerFor<256> for T
impl<T> AlignerFor<256> for T
Source§type Aligner = AlignTo256<T>
type Aligner = AlignTo256<T>
AlignTo*
type which aligns Self
to ALIGNMENT
.Source§impl<T> AlignerFor<32> for T
impl<T> AlignerFor<32> for T
Source§impl<T> AlignerFor<32768> for T
impl<T> AlignerFor<32768> for T
Source§type Aligner = AlignTo32768<T>
type Aligner = AlignTo32768<T>
AlignTo*
type which aligns Self
to ALIGNMENT
.Source§impl<T> AlignerFor<4> for T
impl<T> AlignerFor<4> for T
Source§impl<T> AlignerFor<4096> for T
impl<T> AlignerFor<4096> for T
Source§type Aligner = AlignTo4096<T>
type Aligner = AlignTo4096<T>
AlignTo*
type which aligns Self
to ALIGNMENT
.Source§impl<T> AlignerFor<512> for T
impl<T> AlignerFor<512> for T
Source§type Aligner = AlignTo512<T>
type Aligner = AlignTo512<T>
AlignTo*
type which aligns Self
to ALIGNMENT
.Source§impl<T> AlignerFor<64> for T
impl<T> AlignerFor<64> for T
Source§impl<T> AlignerFor<8> for T
impl<T> AlignerFor<8> for T
Source§impl<T> AlignerFor<8192> for T
impl<T> AlignerFor<8192> for T
Source§type Aligner = AlignTo8192<T>
type Aligner = AlignTo8192<T>
AlignTo*
type which aligns Self
to ALIGNMENT
.Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<'a, T> RCowCompatibleRef<'a> for Twhere
T: Clone + 'a,
impl<'a, T> RCowCompatibleRef<'a> for Twhere
T: Clone + 'a,
Source§fn as_c_ref(from: &'a T) -> <T as RCowCompatibleRef<'a>>::RefC
fn as_c_ref(from: &'a T) -> <T as RCowCompatibleRef<'a>>::RefC
Source§fn as_rust_ref(from: <T as RCowCompatibleRef<'a>>::RefC) -> &'a T
fn as_rust_ref(from: <T as RCowCompatibleRef<'a>>::RefC) -> &'a T
Source§impl<S> ROExtAcc for S
impl<S> ROExtAcc for S
Source§fn f_get<F>(&self, offset: FieldOffset<S, F, Aligned>) -> &F
fn f_get<F>(&self, offset: FieldOffset<S, F, Aligned>) -> &F
offset
. Read moreSource§fn f_get_mut<F>(&mut self, offset: FieldOffset<S, F, Aligned>) -> &mut F
fn f_get_mut<F>(&mut self, offset: FieldOffset<S, F, Aligned>) -> &mut F
offset
. Read moreSource§fn f_get_ptr<F, A>(&self, offset: FieldOffset<S, F, A>) -> *const F
fn f_get_ptr<F, A>(&self, offset: FieldOffset<S, F, A>) -> *const F
offset
. Read moreSource§fn f_get_mut_ptr<F, A>(&mut self, offset: FieldOffset<S, F, A>) -> *mut F
fn f_get_mut_ptr<F, A>(&mut self, offset: FieldOffset<S, F, A>) -> *mut F
offset
. Read moreSource§impl<S> ROExtOps<Aligned> for S
impl<S> ROExtOps<Aligned> for S
Source§fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Aligned>, value: F) -> F
fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Aligned>, value: F) -> F
offset
) with value
,
returning the previous value of the field. Read moreSource§fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Aligned>) -> Fwhere
F: Copy,
fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Aligned>) -> Fwhere
F: Copy,
Source§impl<S> ROExtOps<Unaligned> for S
impl<S> ROExtOps<Unaligned> for S
Source§fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Unaligned>, value: F) -> F
fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Unaligned>, value: F) -> F
offset
) with value
,
returning the previous value of the field. Read moreSource§fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Unaligned>) -> Fwhere
F: Copy,
fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Unaligned>) -> Fwhere
F: Copy,
Source§impl<T> SelfOps for Twhere
T: ?Sized,
impl<T> SelfOps for Twhere
T: ?Sized,
Source§fn piped<F, U>(self, f: F) -> U
fn piped<F, U>(self, f: F) -> U
Source§fn piped_ref<'a, F, U>(&'a self, f: F) -> Uwhere
F: FnOnce(&'a Self) -> U,
fn piped_ref<'a, F, U>(&'a self, f: F) -> Uwhere
F: FnOnce(&'a Self) -> U,
piped
except that the function takes &Self
Useful for functions that take &Self
instead of Self
. Read moreSource§fn piped_mut<'a, F, U>(&'a mut self, f: F) -> Uwhere
F: FnOnce(&'a mut Self) -> U,
fn piped_mut<'a, F, U>(&'a mut self, f: F) -> Uwhere
F: FnOnce(&'a mut Self) -> U,
piped
, except that the function takes &mut Self
.
Useful for functions that take &mut Self
instead of Self
.Source§fn mutated<F>(self, f: F) -> Self
fn mutated<F>(self, f: F) -> Self
Source§fn observe<F>(self, f: F) -> Self
fn observe<F>(self, f: F) -> Self
Source§fn as_ref_<T>(&self) -> &T
fn as_ref_<T>(&self) -> &T
AsRef
,
using the turbofish .as_ref_::<_>()
syntax. Read more