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,
pub fn new(context: C) -> Self
Sourcepub async fn apply_all(&mut self) -> TernResult<Report>
pub async fn apply_all(&mut self) -> TernResult<Report>
Apply all unapplied migrations.
Sourcepub async fn dryrun(&mut self) -> TernResult<Report>
pub async fn dryrun(&mut self) -> TernResult<Report>
Return the migration set that would be applied by apply_all.
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.
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 soft_apply(
&mut self,
from_version: Option<i64>,
to_version: Option<i64>,
) -> TernResult<Report>
pub async fn soft_apply( &mut self, from_version: Option<i64>, to_version: Option<i64>, ) -> TernResult<Report>
Run a “soft apply” for the supplied range of migration versions.
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.
If from_version (resp. to_version) is None, this will soft apply
starting at the first migration (resp. ending with the last migration).
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