-
Notifications
You must be signed in to change notification settings - Fork 82
Expand file tree
/
Copy pathlib.rs
More file actions
52 lines (41 loc) · 1.63 KB
/
lib.rs
File metadata and controls
52 lines (41 loc) · 1.63 KB
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
//! Generic db abstration.
#[cfg(test)]
#[macro_use]
extern crate slog_scope;
pub mod mock;
#[cfg(test)]
mod tests;
#[cfg(feature = "mysql")]
pub type DbPoolImpl = syncstorage_mysql::MysqlDbPool;
#[cfg(feature = "mysql")]
pub use syncstorage_mysql::DbError;
#[cfg(feature = "mysql")]
pub type DbImpl = syncstorage_mysql::MysqlDb;
#[cfg(feature = "postgres")]
pub type DbPoolImpl = syncstorage_postgres::PgDbPool;
#[cfg(feature = "postgres")]
pub use syncstorage_postgres::DbError;
#[cfg(feature = "postgres")]
pub type DbImpl = syncstorage_postgres::PgDb;
#[cfg(feature = "spanner")]
pub type DbPoolImpl = syncstorage_spanner::SpannerDbPool;
#[cfg(feature = "spanner")]
pub use syncstorage_spanner::DbError;
#[cfg(feature = "spanner")]
pub type DbImpl = syncstorage_spanner::SpannerDb;
pub use syncserver_db_common::GetPoolStatus;
pub use syncstorage_db_common::error::DbErrorIntrospect;
pub use syncstorage_db_common::{
Db, DbPool, Sorting, UserIdentifier, params, results,
util::{SyncTimestamp, to_rfc3339},
};
#[cfg(all(feature = "mysql", feature = "spanner"))]
compile_error!("only one of the \"mysql\" and \"spanner\" features can be enabled at a time");
#[cfg(all(feature = "mysql", feature = "postgres"))]
compile_error!("only one of the \"mysql\" and \"postgres\" features can be enabled at a time");
#[cfg(all(feature = "postgres", feature = "spanner"))]
compile_error!("only one of the \"postgres\" and \"spanner\" features can be enabled at a time");
#[cfg(not(any(feature = "mysql", feature = "postgres", feature = "spanner")))]
compile_error!(
"exactly one of the \"mysql\", \"postgres\" and \"spanner\" features must be enabled"
);