Trait migrate_core::MigrationCtxProvider [−][src]
pub trait MigrationCtxProvider: Send + 'static { type Ctx: Send + 'static; #[must_use] fn create_in_commit_mode<'async_trait>(
self: Box<Self>
) -> Pin<Box<dyn Future<Output = Result<Self::Ctx, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
where
Self: 'async_trait; #[must_use] fn create_in_no_commit_mode<'async_trait>(
self: Box<Self>
) -> Pin<Box<dyn Future<Output = Option<Result<Self::Ctx, Box<dyn Error + Send + Sync>>>> + Send + 'async_trait>>
where
Self: 'async_trait; }
Expand description
Gives methods for creating the context for the migration. This should most likely create a database client, or initialize some state, for example ensure an executable is installed.
Associated Types
Required methods
Create context for real migration. All changes that will be made to the target migration object should be applied for real.
Create the context for no-commit (or dry-run) migration. All changes that will be made to the target migration object should not be applied for real.
‘no-commit’ migration context will most likely just log what would be executed when the migration runs for real.