forked from diesel-rs/diesel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmod.rs
More file actions
38 lines (33 loc) · 933 Bytes
/
Copy pathmod.rs
File metadata and controls
38 lines (33 loc) · 933 Bytes
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
#[allow(unused)]
macro_rules! try_drop {
($e:expr, $msg:expr) => {
match $e {
Ok(x) => x,
Err(e) => {
use std::io::{stderr, Write};
if ::std::thread::panicking() {
write!(stderr(), "{}: {:?}", $msg, e).unwrap();
return;
} else {
panic!("{}: {:?}", $msg, e);
}
}
}
};
}
mod command;
mod project_builder;
#[cfg_attr(feature = "sqlite", path = "sqlite_database.rs")]
#[cfg_attr(feature = "postgres", path = "postgres_database.rs")]
#[cfg_attr(feature = "mysql", path = "mysql_database.rs")]
pub mod database;
#[cfg(rustfmt)]
mod mysql_database;
#[cfg(rustfmt)]
mod postgres_database;
#[cfg(rustfmt)]
mod sqlite_database;
pub use self::project_builder::project;
pub fn database(url: &str) -> database::Database {
database::Database::new(url)
}