pub struct Runner<C: MigrationContext> { /* private fields */ }Expand description
Run operations on a set of migrations for the chosen context.
Implementations§
Source§impl<C> Runner<C>where
C: MigrationContext,
impl<C> Runner<C>where
C: MigrationContext,
Sourcepub async fn init_history(&mut self) -> TernResult<()>
pub async fn init_history(&mut self) -> TernResult<()>
CREATE IF NOT EXISTS the history table.
Sourcepub async fn drop_history(&mut self) -> TernResult<()>
pub async fn drop_history(&mut self) -> TernResult<()>
DROP the history table.
Sourcepub async fn run_apply(
&mut self,
target_version: Option<i64>,
dryrun: bool,
) -> TernResult<Report>
pub async fn run_apply( &mut self, target_version: Option<i64>, dryrun: bool, ) -> TernResult<Report>
Apply unapplied migrations up to and including the specified version.
Sourcepub async fn apply_all(&mut self) -> TernResult<Report>
👎Deprecated since 3.1.0: use run_apply_all
pub async fn apply_all(&mut self) -> TernResult<Report>
run_apply_allApply all unapplied migrations.
Sourcepub async fn run_apply_all(&mut self, dryrun: bool) -> TernResult<Report>
pub async fn run_apply_all(&mut self, dryrun: bool) -> TernResult<Report>
Apply all unapplied migrations.
Sourcepub async fn list_applied(&mut self) -> TernResult<Report>
pub async fn list_applied(&mut self) -> TernResult<Report>
List the migrations that have already been applied.
pub async fn soft_apply( &mut self, start_version: Option<i64>, target_version: Option<i64>, ) -> TernResult<Report>
👎Deprecated since 3.1.0: no valid use case for
start_versionSourcepub async fn run_soft_apply(
&mut self,
target_version: Option<i64>,
dryrun: bool,
) -> TernResult<Report>
pub async fn run_soft_apply( &mut self, target_version: Option<i64>, dryrun: bool, ) -> TernResult<Report>
Run a “soft apply” of the migrations up to and including the specified version.
This means that the migration will be saved in the history table, but will not have its query applied. This is useful in the case where you want to change migration tables, apply a patch to the current one, migrate from a different migration tool, etc.
Auto Trait Implementations§
impl<C> Freeze for Runner<C>where
C: Freeze,
impl<C> RefUnwindSafe for Runner<C>where
C: RefUnwindSafe,
impl<C> Send for Runner<C>
impl<C> Sync for Runner<C>
impl<C> Unpin for Runner<C>where
C: Unpin,
impl<C> UnwindSafe for Runner<C>where
C: UnwindSafe,
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