From 610481473aba12b1759baa0a3ec4c4bce3036f8c Mon Sep 17 00:00:00 2001 From: xxchan <37948597+xxchan@users.noreply.github.com> Date: Tue, 15 Nov 2022 10:45:09 +0100 Subject: [PATCH] fix: --external-engine-command-template is not required (#99) --- CHANGELOG.md | 6 +++++- Cargo.toml | 2 +- README.md | 2 +- sqllogictest-bin/src/lib.rs | 10 ++++++++-- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a5f4052..0337f80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -## [0.6.5] - 2022-11-14 +## [0.7.1] - 2022-11-15 + +- Fix: `--external-engine-command-template` should not be required + +## [0.7.0] - 2022-11-14 - Add support for external driver. - Support more type in postgres-extended. diff --git a/Cargo.toml b/Cargo.toml index b4a1076..57a7d25 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ members = ["sqllogictest", "sqllogictest-bin", "examples/*", "tests"] [workspace.package] -version = "0.7.0" +version = "0.7.1" edition = "2021" homepage = "https://github.com/risinglightdb/sqllogictest-rs" keywords = ["sql", "database", "parser", "cli"] diff --git a/README.md b/README.md index 65a1673..686e4c3 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Add the following lines to your `Cargo.toml` file: ```toml [dependencies] -sqllogictest = "0.6" +sqllogictest = "0.7" ``` Implement `DB` trait for your database structure: diff --git a/sqllogictest-bin/src/lib.rs b/sqllogictest-bin/src/lib.rs index ec1fb7e..c238acc 100644 --- a/sqllogictest-bin/src/lib.rs +++ b/sqllogictest-bin/src/lib.rs @@ -46,7 +46,7 @@ struct Opt { /// jdbc:postgresql://{host}:{port}/{db} {user}" The items in `{}` will be replaced by /// [`DBConfig`]. #[clap(long, env)] - external_engine_command_template: String, + external_engine_command_template: Option, /// Whether to enable colorful output. #[clap( @@ -137,7 +137,13 @@ pub async fn main_okk() -> Result<()> { let engine = match engine { EngineType::Postgres => EngineConfig::Postgres, EngineType::PostgresExtended => EngineConfig::PostgresExtended, - EngineType::External => EngineConfig::External(external_engine_command_template), + EngineType::External => { + if let Some(external_engine_command_template) = external_engine_command_template { + EngineConfig::External(external_engine_command_template) + } else { + bail!("`--external-engine-command-template` is required for `--engine=external`") + } + } }; match color {