[][src]Trait oapth::Backend

pub trait Backend {
    fn create_oapth_tables<'a>(&'a mut self) -> BoxFut<'a, Result<()>>;
fn delete_migrations<'a>(
        &'a mut self,
        version: i32,
        mg: &'a MigrationGroup
    ) -> BoxFut<'a, Result<()>>;
fn execute<'a>(&'a mut self, command: &'a str) -> BoxFut<'a, Result<()>>;
fn insert_migrations<'a, I>(
        &'a mut self,
        migrations: I,
        mg: &'a MigrationGroup
    ) -> BoxFut<'a, Result<()>>
    where
        I: Clone + Iterator<Item = &'a Migration> + 'a
;
fn migrations<'a>(
        &'a mut self,
        mg: &'a MigrationGroup
    ) -> BoxFut<'a, Result<Vec<DbMigration>>>;
fn transaction<'a, I, S>(
        &'a mut self,
        commands: I
    ) -> BoxFut<'a, Result<()>>
    where
        I: Iterator<Item = S> + 'a,
        S: AsRef<str>
; }

A back end is the bridge between Rust and a database.

Required methods

fn create_oapth_tables<'a>(&'a mut self) -> BoxFut<'a, Result<()>>

Creates the necessary internal tables

fn delete_migrations<'a>(
    &'a mut self,
    version: i32,
    mg: &'a MigrationGroup
) -> BoxFut<'a, Result<()>>

Removes every migration of a given group mg that is greater than version.

fn execute<'a>(&'a mut self, command: &'a str) -> BoxFut<'a, Result<()>>

Executes arbitrary DDL or DML

fn insert_migrations<'a, I>(
    &'a mut self,
    migrations: I,
    mg: &'a MigrationGroup
) -> BoxFut<'a, Result<()>> where
    I: Clone + Iterator<Item = &'a Migration> + 'a, 

Inserts a stream of migrations of a given group.

fn migrations<'a>(
    &'a mut self,
    mg: &'a MigrationGroup
) -> BoxFut<'a, Result<Vec<DbMigration>>>

Returns a vector with all migrations of a group within the database.

fn transaction<'a, I, S>(&'a mut self, commands: I) -> BoxFut<'a, Result<()>> where
    I: Iterator<Item = S> + 'a,
    S: AsRef<str>, 

Executes a stream of arbitrary DDL or DML inside a transaction.

Loading content...

Implementors

impl Backend for ()[src]

Loading content...