Trait schemamama::Adapter [] [src]

pub trait Adapter {
    type MigrationType: Migration + ?Sized;
    type Error;
    fn current_version(&self) -> Result<Option<Version>, Self::Error>;
fn migrated_versions(&self) -> Result<BTreeSet<Version>, Self::Error>;
fn apply_migration(
        migration: &Self::MigrationType
    ) -> Result<(), Self::Error>;
fn revert_migration(
        migration: &Self::MigrationType
    ) -> Result<(), Self::Error>; }

Use this trait to connect the migrator to your chosen database technology.

Associated Types

An alias to a specific trait that extends Migration. Typically, the aforementioned trait will declare functions that the adapter will use to migrate upwards and downwards.

An adapter-specific error type that can be returned from any of this trait's methods.

Required Methods

Returns the latest migration version, or None if no migrations have been recorded.

Returns a set of the versions of all of the currently applied migrations.

Applies the specified migration.

Reverts the specified migration.