/// Initialize the database when the table doesn't exist already
InitDatabase {
- #[arg(long)]
+ #[arg(long,default_value="vsearch")]
dbname: String,
- #[arg(long)]
+ #[arg(long,default_value="localhost")]
host: String,
- #[arg(long)]
+ #[arg(long,default_value="cvmigrator")]
user: String,
- #[arg(long)]
+ #[arg(long,env)]
password: String,
},
match args.action {
Action::InitDatabase{ dbname, host, user, password } => {
+
println!("maybe creating the database");
let mut client = postgres::Config::new()
.dbname("postgres")
- .host(&host.to_string())
- .user(&user.to_string())
+ .host(&host)
+ .user(&user)
.password(password.clone())
.connect(NoTls)?;
println!("maybe creating database objects");
let mut client = postgres::Config::new()
.dbname(&dbname)
- .host(&host.to_string())
- .user(&user.to_string())
+ .host(&host)
+ .user(&user)
.password(password)
.connect(NoTls)?;