sqlx-models-cli 0.1.1

Command-line utility for SQLx, the Rust SQL toolkit.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use clap::{crate_version, FromArgMatches, IntoApp};
use console::style;
use dotenv::dotenv;
use sqlx_models_cli::Opt;

#[tokio::main]
async fn main() {
    dotenv().ok();
    let matches = Opt::into_app().version(crate_version!()).get_matches();

    // no special handling here
    if let Err(error) = sqlx_models_cli::run(Opt::from_arg_matches(&matches)).await {
        println!("{} {}", style("error:").bold().red(), error);
        std::process::exit(1);
    }
}