commit
905b7c4255
@ -22,13 +22,16 @@ clap = { version = "^2.33.3" }
|
|||||||
dotenv = { version = "^0.15" }
|
dotenv = { version = "^0.15" }
|
||||||
async-std = { version = "^1.9", features = [ "attributes" ] }
|
async-std = { version = "^1.9", features = [ "attributes" ] }
|
||||||
sea-orm-codegen = { version = "^0.2.0", path = "../sea-orm-codegen" }
|
sea-orm-codegen = { version = "^0.2.0", path = "../sea-orm-codegen" }
|
||||||
sea-schema = { version = "^0.2.7", git = "https://github.com/SeaQL/sea-schema.git", default-features = false, features = [
|
sea-schema = { version = "^0.2.8", git = "https://github.com/SeaQL/sea-schema.git", default-features = false, features = [
|
||||||
|
"debug-print",
|
||||||
"sqlx-mysql",
|
"sqlx-mysql",
|
||||||
"sqlx-postgres",
|
"sqlx-postgres",
|
||||||
"discovery",
|
"discovery",
|
||||||
"writer",
|
"writer",
|
||||||
] }
|
] }
|
||||||
sqlx = { version = "^0.5", default-features = false, features = [ "mysql", "postgres" ] }
|
sqlx = { version = "^0.5", default-features = false, features = [ "mysql", "postgres" ] }
|
||||||
|
env_logger = { version = "^0.9" }
|
||||||
|
log = { version = "^0.4" }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = [ "runtime-async-std-native-tls" ]
|
default = [ "runtime-async-std-native-tls" ]
|
||||||
|
@ -62,5 +62,13 @@ pub fn build_cli() -> App<'static, 'static> {
|
|||||||
.version(env!("CARGO_PKG_VERSION"))
|
.version(env!("CARGO_PKG_VERSION"))
|
||||||
.setting(AppSettings::VersionlessSubcommands)
|
.setting(AppSettings::VersionlessSubcommands)
|
||||||
.subcommand(entity_subcommand)
|
.subcommand(entity_subcommand)
|
||||||
|
.arg(
|
||||||
|
Arg::with_name("VERBOSE")
|
||||||
|
.long("verbose")
|
||||||
|
.short("v")
|
||||||
|
.help("Show debug messages")
|
||||||
|
.takes_value(false)
|
||||||
|
.global(true),
|
||||||
|
)
|
||||||
.setting(AppSettings::SubcommandRequiredElseHelp)
|
.setting(AppSettings::SubcommandRequiredElseHelp)
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
use clap::ArgMatches;
|
use clap::ArgMatches;
|
||||||
use dotenv::dotenv;
|
use dotenv::dotenv;
|
||||||
|
use log::LevelFilter;
|
||||||
use sea_orm_codegen::{EntityTransformer, OutputFile};
|
use sea_orm_codegen::{EntityTransformer, OutputFile};
|
||||||
use std::{error::Error, fmt::Display, fs, io::Write, path::Path, process::Command};
|
use std::{error::Error, fmt::Display, fs, io::Write, path::Path, process::Command};
|
||||||
|
|
||||||
@ -33,6 +34,12 @@ async fn run_generate_command(matches: &ArgMatches<'_>) -> Result<(), Box<dyn Er
|
|||||||
!table.starts_with("_")
|
!table.starts_with("_")
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
if args.is_present("VERBOSE") {
|
||||||
|
let _ = ::env_logger::builder()
|
||||||
|
.filter_level(LevelFilter::Debug)
|
||||||
|
.is_test(true)
|
||||||
|
.try_init();
|
||||||
|
}
|
||||||
|
|
||||||
let table_stmts = if url.starts_with("mysql://") {
|
let table_stmts = if url.starts_with("mysql://") {
|
||||||
use sea_schema::mysql::discovery::SchemaDiscovery;
|
use sea_schema::mysql::discovery::SchemaDiscovery;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user