Enum AlterTableOperation
pub enum AlterTableOperation {
Show 47 variants
AddConstraint {
constraint: TableConstraint,
not_valid: bool,
},
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 {
has_column_keyword: bool,
column_names: Vec<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 {
drop_behavior: Option<DropBehavior>,
},
DropForeignKey {
name: Ident,
drop_behavior: Option<DropBehavior>,
},
DropIndex {
name: Ident,
},
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>,
},
ReplicaIdentity {
identity: ReplicaIdentity,
},
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: RenameTableNameKind,
},
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,
Algorithm {
equals: bool,
algorithm: AlterTableAlgorithm,
},
Lock {
equals: bool,
lock: AlterTableLock,
},
AutoIncrement {
equals: bool,
value: ValueWithSpan,
},
ValidateConstraint {
name: Ident,
},
SetOptionsParens {
options: Vec<SqlOption>,
},
}Expand description
An ALTER TABLE (Statement::AlterTable) operation
Variants§
AddConstraint
ADD <table_constraint> [NOT VALID]
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> [ , <column_name>, ... ] [ CASCADE ]
Fields
drop_behavior: Option<DropBehavior>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
Fields
drop_behavior: Option<DropBehavior>DropForeignKey
DropIndex
DROP INDEX <index_name>
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)
ReplicaIdentity
REPLICA IDENTITY { DEFAULT | USING INDEX index_name | FULL | NOTHING }
Note: this is a PostgreSQL-specific operation. Please refer to PostgreSQL documentation
Fields
identity: ReplicaIdentityAddPartitions
Add Partitions
DropPartitions
RenameColumn
RENAME [ COLUMN ] <old_column_name> TO <new_column_name>
RenameTable
RENAME TO <table_name>
Fields
table_name: RenameTableNameKindChangeColumn
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: ObjectNameSetTblProperties
‘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
Algorithm
ALGORITHM [=] { DEFAULT | INSTANT | INPLACE | COPY }
MySQL-specific table alter algorithm.
Lock
LOCK [=] { DEFAULT | NONE | SHARED | EXCLUSIVE }
MySQL-specific table alter lock.
AutoIncrement
AUTO_INCREMENT [=] <value>
MySQL-specific table option for raising current auto increment value.
ValidateConstraint
VALIDATE CONSTRAINT <name>
SetOptionsParens
Arbitrary parenthesized SET options.
Example:
SET (scale_factor = 0.01, threshold = 500)`Trait Implementations§
§impl Clone for AlterTableOperation
impl Clone for AlterTableOperation
§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 more§impl Debug for AlterTableOperation
impl Debug for AlterTableOperation
§impl Display for AlterTableOperation
impl Display for AlterTableOperation
§impl Hash for AlterTableOperation
impl Hash for AlterTableOperation
§impl Ord for AlterTableOperation
impl Ord for AlterTableOperation
§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,
§impl PartialEq for AlterTableOperation
impl PartialEq for AlterTableOperation
§impl PartialOrd for AlterTableOperation
impl PartialOrd for AlterTableOperation
§impl Spanned for AlterTableOperation
§partial span
Missing spans:
impl Spanned for AlterTableOperation
§partial span
Missing spans:
§impl Visit for AlterTableOperation
impl Visit for AlterTableOperation
§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> 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,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.