pub enum AlterAction {
Rename {
to: StrRef,
},
RenameColumn {
column: StrRef,
to: StrRef,
},
AddColumn {
column: ColumnDef,
quiet: bool,
},
DropColumn {
column: StrRef,
quiet: bool,
},
Default {
column: StrRef,
default: ExprRef,
},
NotNull {
column: StrRef,
set: bool,
},
Type {
column: StrRef,
ty: StrRef,
using: ExprRef,
},
}Expand description
What one ALTER TABLE does. A column is named as written.
Variants§
Rename
RENAME TO name.
RenameColumn
RENAME COLUMN column TO name.
AddColumn
ADD COLUMN definition, where only the type, NOT NULL and DEFAULT count, since the pin
drops every other constraint written on an added column.
DropColumn
DROP COLUMN column.
Default
ALTER COLUMN column SET DEFAULT expression, or DROP DEFAULT when the expression is
NONE.
NotNull
ALTER COLUMN column SET NOT NULL or DROP NOT NULL.
Type
ALTER COLUMN column SET DATA TYPE type USING expression, either of which can be left out,
though not both. NONE for a missing one.
Trait Implementations§
Source§impl Clone for AlterAction
impl Clone for AlterAction
impl Copy for AlterAction
Source§impl Debug for AlterAction
impl Debug for AlterAction
impl Eq for AlterAction
Source§impl PartialEq for AlterAction
impl PartialEq for AlterAction
impl StructuralPartialEq for AlterAction
Auto Trait Implementations§
impl Freeze for AlterAction
impl RefUnwindSafe for AlterAction
impl Send for AlterAction
impl Sync for AlterAction
impl Unpin for AlterAction
impl UnsafeUnpin for AlterAction
impl UnwindSafe for AlterAction
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
Mutably borrows from an owned value. Read more