1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#[cfg(any(
feature = "with-diesel-mysql",
feature = "with-diesel-postgres",
feature = "with-diesel-sqlite",
))]
pub(crate) mod diesel;
#[cfg(feature = "with-mysql_async")]
pub(crate) mod mysql_async;
#[cfg(feature = "with-rusqlite")]
pub(crate) mod rusqlite;
#[cfg(any(
feature = "with-sqlx-mssql",
feature = "with-sqlx-mysql",
feature = "with-sqlx-postgres",
feature = "with-sqlx-sqlite",
))]
pub(crate) mod sqlx;
#[cfg(feature = "tiberius")]
pub(crate) mod tiberius;
#[cfg(feature = "with-tokio-postgres")]
pub(crate) mod tokio_postgres;
pub(crate) mod unit;
use crate::{BoxFut, DbMigration, Migration, MigrationGroup};
use alloc::vec::Vec;
pub trait Backend {
fn create_oapth_tables<'a>(&'a mut self) -> BoxFut<'a, crate::Result<()>>;
fn delete_migrations<'a>(
&'a mut self,
version: i32,
mg: &'a MigrationGroup,
) -> BoxFut<'a, crate::Result<()>>;
fn execute<'a>(&'a mut self, command: &'a str) -> BoxFut<'a, crate::Result<()>>;
fn insert_migrations<'a, I>(
&'a mut self,
migrations: I,
mg: &'a MigrationGroup,
) -> BoxFut<'a, crate::Result<()>>
where
I: Clone + Iterator<Item = &'a Migration> + 'a;
fn migrations<'a>(
&'a mut self,
mg: &'a MigrationGroup,
) -> BoxFut<'a, crate::Result<Vec<DbMigration>>>;
fn transaction<'a, I, S>(&'a mut self, commands: I) -> BoxFut<'a, crate::Result<()>>
where
I: Iterator<Item = S> + 'a,
S: AsRef<str>;
}