Struct migrant_lib::Migrator [−][src]
Migration applicator
Implementations
impl Migrator
[src]
pub fn with_config(config: &Config) -> Self
[src]
Initialize a new Migrator
with a given &Config
pub fn direction(&mut self, dir: Direction) -> &mut Self
[src]
Set direction
. Default is Up
.
Up
=> run up.sql
.
Down
=> run down.sql
.
pub fn force(&mut self, force: bool) -> &mut Self
[src]
Set force
to forcefully apply migrations regardless of errors
pub fn fake(&mut self, fake: bool) -> &mut Self
[src]
Set fake
to fake application of migrations.
Applied migrations table will be updated as if migrations were actually run.
pub fn all(&mut self, all: bool) -> &mut Self
[src]
Set all
to run all remaining available migrations in the given direction
pub fn show_output(&mut self, show_output: bool) -> &mut Self
[src]
Toggle migration application output. Default is true
pub fn swallow_completion(&mut self, swallow_completion: bool) -> &mut Self
[src]
Don’t return any ErrorKind::MigrationComplete
errors when running Migrator::apply
All other errors will still be returned
pub fn apply(&self) -> Result<()>
[src]
Apply migrations using current configuration
Returns an ErrorKind::MigrationComplete
if all migrations in the given
direction have already been applied, unless swallow_completion
is set to true
.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Migrator
impl !Send for Migrator
impl !Sync for Migrator
impl Unpin for Migrator
impl !UnwindSafe for Migrator
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,