pub enum AlterColumnOperation {
SetType {
data_type: DbType,
},
SetMaxLength {
max_length: i32,
},
DropMaxLength,
}Expand description
Representation of a single change to an existing column.
Each variant renders into exactly one ALTER TABLE statement, or into none at
all in sqlite: it has no ALTER COLUMN, and none of these changes are
observable in a STRICT table - DbType::VarChar and DbType::Text are
both TEXT, every integer is INTEGER, both floats are REAL, and a maximum
length is never enforced.
Variants§
SetType
Set the column’s type
The type has to be one which is fully described by itself. A
DbType::VarChar carries its maximum length and a DbType::Choices
its enum, so neither can be rendered from the type alone.
SetMaxLength
Add the check constraint enforcing the column’s maximum length
A column which already has one has to drop it first: a constraint can’t be redefined, only replaced.
DropMaxLength
Drop the check constraint enforcing the column’s maximum length
Trait Implementations§
Source§impl Clone for AlterColumnOperation
impl Clone for AlterColumnOperation
Source§fn clone(&self) -> AlterColumnOperation
fn clone(&self) -> AlterColumnOperation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for AlterColumnOperation
Auto Trait Implementations§
impl Freeze for AlterColumnOperation
impl RefUnwindSafe for AlterColumnOperation
impl Send for AlterColumnOperation
impl Sync for AlterColumnOperation
impl Unpin for AlterColumnOperation
impl UnsafeUnpin for AlterColumnOperation
impl UnwindSafe for AlterColumnOperation
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,
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 more