pub struct AlterTableBuilder { /* private fields */ }Expand description
Collects changes inside alter_table. Each change is applied as its own
ALTER TABLE statement, so this works uniformly across backends (including
SQLite, which permits only one alteration per statement).
Implementations§
Source§impl AlterTableBuilder
impl AlterTableBuilder
Sourcepub fn add_column(
&mut self,
name: &str,
f: impl FnOnce(&mut ColumnDef),
) -> &mut ColumnDef
pub fn add_column( &mut self, name: &str, f: impl FnOnce(&mut ColumnDef), ) -> &mut ColumnDef
add_column :name — f configures the column type and modifiers. The
returned &mut ColumnDef allows further chaining.
Sourcepub fn drop_column(&mut self, name: &str)
pub fn drop_column(&mut self, name: &str)
drop_column :name.
Sourcepub fn rename_column(&mut self, from: &str, to: &str)
pub fn rename_column(&mut self, from: &str, to: &str)
rename_column :from, :to.
Auto Trait Implementations§
impl Freeze for AlterTableBuilder
impl RefUnwindSafe for AlterTableBuilder
impl Send for AlterTableBuilder
impl Sync for AlterTableBuilder
impl Unpin for AlterTableBuilder
impl UnsafeUnpin for AlterTableBuilder
impl UnwindSafe for AlterTableBuilder
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
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>
Converts
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>
Converts
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