pub enum TableOp {
Show 15 variants
AddColumn(Column),
DropColumn {
name: Identifier,
is_populated: bool,
},
AlterColumnType {
name: Identifier,
from: ColumnType,
to: ColumnType,
using: Option<NormalizedExpr>,
},
SetColumnNullable {
name: Identifier,
nullable: bool,
},
SetColumnDefault {
name: Identifier,
default: Option<DefaultExpr>,
},
SetColumnIdentity {
name: Identifier,
identity: Option<Identity>,
},
SetColumnGenerated {
name: Identifier,
generated: Option<Generated>,
},
SetColumnComment {
name: Identifier,
comment: Option<String>,
},
SetColumnStorage {
name: Identifier,
from: StorageKind,
to: StorageKind,
},
SetColumnCompression {
name: Identifier,
compression: Option<Compression>,
},
AddConstraint(Constraint),
DropConstraint {
name: Identifier,
},
SetConstraintComment {
name: Identifier,
comment: Option<String>,
},
SetTableComment {
comment: Option<String>,
},
SetTableSpace {
name: Option<Identifier>,
},
}Expand description
One column / constraint / comment operation on a table.
Variants§
AddColumn(Column)
Add a column.
DropColumn
Drop a column.
Fields
name: IdentifierColumn name.
AlterColumnType
Change a column’s data type. Carries an optional USING clause; v0.1
emits None and leaves the rewrite pass to decide.
Fields
name: IdentifierColumn name.
from: ColumnTypeExisting type in the target.
to: ColumnTypeDesired type in the source.
using: Option<NormalizedExpr>Optional USING expression.
SetColumnNullable
Toggle a column’s NOT NULL-ness.
Fields
name: IdentifierColumn name.
SetColumnDefault
Set or clear a column’s DEFAULT expression.
Fields
name: IdentifierColumn name.
default: Option<DefaultExpr>New default (None = drop the default).
SetColumnIdentity
Set or clear a column’s identity specification.
SetColumnGenerated
Set or clear a column’s generated-column expression.
Fields
name: IdentifierColumn name.
SetColumnComment
Set or clear a column-level comment.
SetColumnStorage
Change a column’s TOAST storage strategy.
Fields
name: IdentifierColumn name.
from: StorageKindPrevious storage. Caller resolves Column.storage = None to
the type default before emitting, so both sides are explicit.
Carried so the lint rule (Stage 6) can detect downgrades
without needing to re-derive the previous state.
to: StorageKindNew storage. Same resolution rule as from.
SetColumnCompression
Change a column’s TOAST compression codec.
Fields
name: IdentifierColumn name.
compression: Option<Compression>New compression. None means “use cluster default” — emits
SET COMPRESSION DEFAULT at render time.
AddConstraint(Constraint)
Add a table constraint.
DropConstraint
Drop a table constraint by name.
Fields
name: IdentifierConstraint name (no schema — constraint names live in the table’s namespace).
SetConstraintComment
Set or clear a constraint comment.
SetTableComment
Set or clear a table-level comment.
SetTableSpace
Move the table to a different tablespace (None = pg_default).
Fields
name: Option<Identifier>New tablespace name; None means the cluster default (pg_default).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TableOp
impl<'de> Deserialize<'de> for TableOp
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl StructuralPartialEq for TableOp
Auto Trait Implementations§
impl Freeze for TableOp
impl RefUnwindSafe for TableOp
impl Send for TableOp
impl Sync for TableOp
impl Unpin for TableOp
impl UnsafeUnpin for TableOp
impl UnwindSafe for TableOp
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<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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