Trait sqlx_migrator::migrator::Info

source ·
pub trait Info<DB, State> {
    // Required methods
    fn state(&self) -> &State;
    fn migrations(&self) -> &Vec<Box<dyn Migration<DB, State>>>;
    fn migrations_mut(&mut self) -> &mut Vec<Box<dyn Migration<DB, State>>>;

    // Provided methods
    fn add_migrations(&mut self, migrations: Vec<Box<dyn Migration<DB, State>>>) { ... }
    fn add_migration(&mut self, migration: Box<dyn Migration<DB, State>>) { ... }
}
Expand description

The Info trait provides database-agnostic methods for managing migrations and interacting with migration states.

Required Methods§

source

fn state(&self) -> &State

Returns the current state used by the migrator.

source

fn migrations(&self) -> &Vec<Box<dyn Migration<DB, State>>>

Returns a reference to the list of migrations.

source

fn migrations_mut(&mut self) -> &mut Vec<Box<dyn Migration<DB, State>>>

Returns a mutable reference to the list of migrations.

Provided Methods§

source

fn add_migrations(&mut self, migrations: Vec<Box<dyn Migration<DB, State>>>)

Adds a list of migrations to the migrator.

This method accepts a vector of migrations and adds each one individually to ensure proper handling of migration relationships and duplicates.

source

fn add_migration(&mut self, migration: Box<dyn Migration<DB, State>>)

Adds a single migration to the migrator.

Implementors§

source§

impl<DB, State> Info<DB, State> for Migrator<DB, State>