2021-01-31 02:38:35 +03:00
|
|
|
#![deny(clippy::all)]
|
2021-02-21 18:22:00 +03:00
|
|
|
#![forbid(unsafe_code)]
|
2021-01-31 02:38:35 +03:00
|
|
|
|
2021-03-26 02:10:41 +03:00
|
|
|
#[macro_use]
|
|
|
|
extern crate cfg_if;
|
|
|
|
|
|
|
|
#[cfg(not(any(feature = "postgres", feature = "mysql")))]
|
|
|
|
compile_error!(r#"Either features "postgres" or "mysql" must be enabled for "migra" crate"#);
|
|
|
|
|
2021-04-08 01:26:30 +03:00
|
|
|
mod app;
|
2021-02-13 00:39:39 +03:00
|
|
|
mod commands;
|
2021-01-31 03:23:43 +03:00
|
|
|
mod config;
|
2021-02-05 01:37:25 +03:00
|
|
|
mod database;
|
2021-02-10 01:13:27 +03:00
|
|
|
mod error;
|
2021-01-31 02:54:23 +03:00
|
|
|
mod opts;
|
2021-01-31 02:38:35 +03:00
|
|
|
|
2021-02-13 00:39:39 +03:00
|
|
|
use crate::error::StdResult;
|
2021-04-08 01:26:30 +03:00
|
|
|
use app::App;
|
2021-01-31 03:23:43 +03:00
|
|
|
use config::Config;
|
2021-04-08 01:26:30 +03:00
|
|
|
use opts::{AppOpt, StructOpt};
|
2021-01-31 02:38:35 +03:00
|
|
|
|
2021-02-13 00:39:39 +03:00
|
|
|
fn main() -> StdResult<()> {
|
2021-02-26 01:21:29 +03:00
|
|
|
#[cfg(feature = "dotenv")]
|
|
|
|
dotenv::dotenv().ok();
|
|
|
|
|
2021-04-08 01:26:30 +03:00
|
|
|
App::new(AppOpt::from_args()).run_command()
|
2021-01-31 02:38:35 +03:00
|
|
|
}
|