From 17d18b846bf88b1b92fd137eac1d3499e191a0fc Mon Sep 17 00:00:00 2001 From: xxchan Date: Wed, 20 Sep 2023 22:00:00 +0800 Subject: [PATCH] feat(bin): support envvars `SLT_HOST/PORT/DB/USER/PASSWORD` (#197) --- CHANGELOG.md | 4 ++++ Cargo.lock | 6 +++--- Cargo.toml | 2 +- sqllogictest-bin/src/main.rs | 10 +++++----- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae5de38..9579c96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +## [0.17.1] - 2023-09-20 + +* bin: support envvars `SLT_HOST/PORT/DB/USER/PASSWORD` + ## [0.17.0] - 2023-09-19 * Support environment variables substituion for SQL and system commands. diff --git a/Cargo.lock b/Cargo.lock index 731b785..2e1c702 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1403,7 +1403,7 @@ dependencies = [ [[package]] name = "sqllogictest" -version = "0.17.0" +version = "0.17.1" dependencies = [ "async-trait", "educe", @@ -1426,7 +1426,7 @@ dependencies = [ [[package]] name = "sqllogictest-bin" -version = "0.17.0" +version = "0.17.1" dependencies = [ "anyhow", "async-trait", @@ -1447,7 +1447,7 @@ dependencies = [ [[package]] name = "sqllogictest-engines" -version = "0.17.0" +version = "0.17.1" dependencies = [ "async-trait", "bytes", diff --git a/Cargo.toml b/Cargo.toml index 74882c2..389e002 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ resolver = "2" members = ["sqllogictest", "sqllogictest-bin", "sqllogictest-engines", "tests"] [workspace.package] -version = "0.17.0" +version = "0.17.1" edition = "2021" homepage = "https://github.com/risinglightdb/sqllogictest-rs" keywords = ["sql", "database", "parser", "cli"] diff --git a/sqllogictest-bin/src/main.rs b/sqllogictest-bin/src/main.rs index afa4a9f..f05502c 100644 --- a/sqllogictest-bin/src/main.rs +++ b/sqllogictest-bin/src/main.rs @@ -68,20 +68,20 @@ struct Opt { /// The database server host. /// If multiple addresses are specified, one will be chosen randomly per session. - #[clap(short, long, default_value = "localhost")] + #[clap(short, long, default_value = "localhost", env = "SLT_HOST")] host: Vec, /// The database server port. /// If multiple addresses are specified, one will be chosen randomly per session. - #[clap(short, long, default_value = "5432")] + #[clap(short, long, default_value = "5432", env = "SLT_PORT")] port: Vec, /// The database name to connect. - #[clap(short, long, default_value = "postgres")] + #[clap(short, long, default_value = "postgres", env = "SLT_DB")] db: String, /// The database username. - #[clap(short, long, default_value = "postgres")] + #[clap(short, long, default_value = "postgres", env = "SLT_USER")] user: String, /// The database password. - #[clap(short = 'w', long, default_value = "postgres")] + #[clap(short = 'w', long, default_value = "postgres", env = "SLT_PASSWORD")] pass: String, /// The database options. #[clap(long)]