pub struct MigrationRunner { /* private fields */ }Implementations§
Source§impl MigrationRunner
impl MigrationRunner
pub fn new(pool: Pool) -> MigrationRunner
pub fn with_migrations( pool: Pool, migrations: Vec<Box<dyn Migration>>, ) -> MigrationRunner
pub async fn ensure_table(&self) -> Result<(), Error>
pub async fn applied(&self) -> Result<Vec<String>, Error>
pub async fn next_batch(&self) -> Result<i32, Error>
pub async fn run_up(&self) -> Result<Vec<String>, Error>
pub async fn rollback(&self) -> Result<Vec<String>, Error>
pub async fn fresh(&self) -> Result<(), Error>
Sourcepub async fn wipe(&self) -> Result<(), Error>
pub async fn wipe(&self) -> Result<(), Error>
Drop every table in the current schema, regardless of driver. Doesn’t
re-run migrations — use fresh() for that.
- Postgres:
DROP SCHEMA public CASCADE; CREATE SCHEMA public. - MySQL: enumerate user tables and drop each (with
FOREIGN_KEY_CHECKS=0). - SQLite: enumerate user tables in
sqlite_masterand drop each.
pub async fn status(&self) -> Result<Vec<MigrationStatus>, Error>
pub async fn reset(&self) -> Result<Vec<String>, Error>
pub async fn refresh(&self) -> Result<Vec<String>, Error>
pub async fn run_up_step(&self) -> Result<Vec<String>, Error>
pub async fn pretend(&self) -> Result<Vec<String>, Error>
pub async fn install(&self) -> Result<(), Error>
pub fn count(&self) -> usize
Auto Trait Implementations§
impl Freeze for MigrationRunner
impl !RefUnwindSafe for MigrationRunner
impl Send for MigrationRunner
impl Sync for MigrationRunner
impl Unpin for MigrationRunner
impl UnsafeUnpin for MigrationRunner
impl !UnwindSafe for MigrationRunner
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more