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
use crate::errors::MigraResult;
use crate::managers::{ManageMigrations, ManageTransaction};
pub trait OpenDatabaseConnection
where
Self: Sized,
{
fn new(connection_string: &str) -> MigraResult<Self> {
Self::manual(connection_string, "migrations")
}
fn manual(connection_string: &str, migrations_table_name: &str) -> MigraResult<Self>;
}
pub trait Client: ManageMigrations + ManageTransaction {}
pub type AnyClient = Box<(dyn Client + 'static)>;
#[cfg(feature = "postgres")]
mod postgres;
#[cfg(feature = "postgres")]
pub use self::postgres::Client as PostgresClient;
#[cfg(feature = "mysql")]
mod mysql;
#[cfg(feature = "mysql")]
pub use self::mysql::Client as MysqlClient;
#[cfg(feature = "sqlite")]
mod sqlite;
#[cfg(feature = "sqlite")]
pub use self::sqlite::Client as SqliteClient;