Skip to content

Commit

Permalink
feat(bin): support envvars SLT_HOST/PORT/DB/USER/PASSWORD (#197)
Browse files Browse the repository at this point in the history
  • Loading branch information
xxchan authored Sep 20, 2023
1 parent 263aa0c commit 17d18b8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
10 changes: 5 additions & 5 deletions sqllogictest-bin/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>,
/// 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<u16>,
/// 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)]
Expand Down

0 comments on commit 17d18b8

Please sign in to comment.