pub struct MigrationRunner<S, M, E> { /* private fields */ }
Expand description
Struct for running migrations on a database
Implementations§
Source§impl<S, M, E> MigrationRunner<S, M, E>
impl<S, M, E> MigrationRunner<S, M, E>
Sourcepub fn new(store: S, state_manager: Arc<M>, executor: Arc<E>) -> Self
pub fn new(store: S, state_manager: Arc<M>, executor: Arc<E>) -> Self
Create a new MigrationRunner
Sourcepub async fn migrate(&self) -> Result<Option<u32>>
pub async fn migrate(&self) -> Result<Option<u32>>
Migrate with a separate transaction for each changelog
This will execute each migration inside its own DB transaction. Therefore, if an error occurs and the method returns prematurely, all versions that have been successfully deployed will stay in the database.
Auto Trait Implementations§
impl<S, M, E> Freeze for MigrationRunner<S, M, E>where
S: Freeze,
impl<S, M, E> RefUnwindSafe for MigrationRunner<S, M, E>
impl<S, M, E> Send for MigrationRunner<S, M, E>
impl<S, M, E> Sync for MigrationRunner<S, M, E>
impl<S, M, E> Unpin for MigrationRunner<S, M, E>where
S: Unpin,
impl<S, M, E> UnwindSafe for MigrationRunner<S, M, E>
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