Skip to main content

Synchronize

Trait Synchronize 

Source
pub trait Synchronize<DB>: Info<DB> + DatabaseOperation<DB>
where DB: Database,
{ // Provided method fn sync<'life0, 'life1, 'life2, 'async_trait, O>( &'life0 self, connection: &'life1 mut <DB as Database>::Connection, old_migrator: &'life2 O, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where O: OldMigrator<DB> + 'async_trait, Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } }
Expand description

Trait which is implemented for syncing a migration from old migrator to new migrator for a specific database

Provided Methods§

Source

fn sync<'life0, 'life1, 'life2, 'async_trait, O>( &'life0 self, connection: &'life1 mut <DB as Database>::Connection, old_migrator: &'life2 O, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where O: OldMigrator<DB> + 'async_trait, Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Syncs the applied migrations from an old migrator to the current migrator

This function serves two primary purposes:

  1. Migrating from external migrations tosqlx_migrator migration
  2. Handling table renames

Note: Migration timestamps are not preserved - the current time is used for entries

§Errors

If sync cannot be completed

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<DB> Synchronize<DB> for Migrator<DB>
where DB: Database, Self: DatabaseOperation<DB>,