pub enum AlterKind {
RenameTable {
to: Vec<u8>,
},
RenameColumn {
from: Vec<u8>,
to: Vec<u8>,
to_quoted: bool,
},
AddColumn {
start: u32,
end: u32,
risk: AddedColumnRisk,
},
AddColumnFailsAfter {
message: String,
},
DropColumn {
name: Vec<u8>,
position: u16,
},
SetNotNull {
name: Vec<u8>,
position: u16,
start: u32,
end: u32,
},
DropNotNull {
name: Vec<u8>,
position: u16,
},
AddCheck {
name: Option<Vec<u8>>,
start: u32,
end: u32,
expr_start: u32,
expr_end: u32,
},
DropConstraint {
name: Vec<u8>,
},
}Expand description
What an ALTER TABLE does, with every name already resolved.
Variants§
RenameTable
RENAME TO.
RenameColumn
RENAME COLUMN a TO b.
Fields
AddColumn
ADD COLUMN.
Fields
§
start: u32Where the definition starts in the statement’s own source.
The offsets rather than the text, for the same reason CREATE TABLE
carries an offset: the executor has the statement’s source and
slicing it there keeps the written definition - its spacing, its
case and its comments - rather than something re-rendered from the
parse.
§
risk: AddedColumnRiskWhat it would do to rows that already exist.
AddColumnFailsAfter
An ADD COLUMN that SQLite refuses only after it has changed the schema.
DropColumn
DROP COLUMN.
Fields
SetNotNull
ALTER COLUMN ... SET NOT NULL.
Fields
DropNotNull
ALTER COLUMN ... DROP NOT NULL.
AddCheck
ADD [CONSTRAINT name] CHECK (...).
Fields
DropConstraint
DROP CONSTRAINT name.
Trait Implementations§
impl Eq for AlterKind
impl StructuralPartialEq for AlterKind
Auto Trait Implementations§
impl Freeze for AlterKind
impl RefUnwindSafe for AlterKind
impl Send for AlterKind
impl Sync for AlterKind
impl Unpin for AlterKind
impl UnsafeUnpin for AlterKind
impl UnwindSafe for AlterKind
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