refactor(controller): simplify PostgreSQL DSN connection string output
This commit is contained in:
10
Cargo.lock
generated
10
Cargo.lock
generated
@@ -409,15 +409,6 @@ dependencies = [
|
||||
"litrs",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dsn"
|
||||
version = "1.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a68ec86c8ab056c40c4d3f6a543ad0ad6a251d7d01dac251feed242aa44e754a"
|
||||
dependencies = [
|
||||
"percent-encoding",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dyn-clone"
|
||||
version = "1.0.20"
|
||||
@@ -1103,7 +1094,6 @@ dependencies = [
|
||||
"cliclack",
|
||||
"colored",
|
||||
"comfy-table",
|
||||
"dsn",
|
||||
"futures",
|
||||
"indicatif",
|
||||
"miette",
|
||||
|
||||
@@ -12,7 +12,6 @@ clap = { version = "4.5.53", features = ["derive"] }
|
||||
cliclack = "0.3.7"
|
||||
colored = "3.0.0"
|
||||
comfy-table = "7.2.1"
|
||||
dsn = "1.2.1"
|
||||
futures = "0.3.31"
|
||||
indicatif = { version = "0.18.3", features = ["improved_unicode"] }
|
||||
miette = { version = "7.6.0", features = ["fancy"] }
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
use dsn::DSN;
|
||||
use miette::miette;
|
||||
|
||||
use colored::Colorize;
|
||||
@@ -92,15 +91,10 @@ impl Controller {
|
||||
|
||||
match format {
|
||||
ConnectionFormat::DSN => {
|
||||
let dsn = DSN::builder()
|
||||
.driver("postgres")
|
||||
.username(USERNAME)
|
||||
.password(project.config.password.clone())
|
||||
.host("127.0.0.1")
|
||||
.port(project.config.port)
|
||||
.database(DATABASE)
|
||||
.build();
|
||||
println!("{}", dsn.to_string());
|
||||
println!(
|
||||
"postgres://{}:{}@127.0.0.1:{}/{}",
|
||||
USERNAME, project.config.password, project.config.port, DATABASE
|
||||
);
|
||||
}
|
||||
ConnectionFormat::Human => {
|
||||
format_conn_human(project);
|
||||
|
||||
Reference in New Issue
Block a user