From d95a7fee2640371eaa27dcd540f81a7cec54e292 Mon Sep 17 00:00:00 2001 From: jiacai2050 Date: Fri, 29 Mar 2024 10:48:44 +0800 Subject: [PATCH] release 0.6.0 --- Cargo.toml | 2 +- README.md | 64 ++++++++++++++++++++++-------------------- sqlness-cli/Cargo.toml | 4 +-- 3 files changed, 37 insertions(+), 33 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index aa1db26..cd1f444 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ members = ["sqlness", "sqlness-cli"] resolver = "2" [workspace.package] -version = "0.5.0" +version = "0.6.0" edition = "2021" authors = [ "CeresDB Authors ", diff --git a/README.md b/README.md index 1749f73..5785f79 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,11 @@ An ergonomic, opinionated framework for SQL integration test. -# Use as library +# Usage + +You can use sqlness as library or as command lines tools directly, it support MySQL/PostgreSQL wire protocol. + +## Use as library First add sqlness to your project: @@ -22,7 +26,35 @@ Then implement `Database` and `EnvController` trait to setup your tests. Users can refer [basic.rs](sqlness/examples/basic.rs) for a complete example. -This is the directory structure of examples +## Use as CLI +```bash +$ cargo install sqlness-cli + +$ sqlness-cli -h +SQLNESS command line tool + +Usage: sqlness-cli [OPTIONS] --case-dir --ip --port + +Options: + -c, --case-dir Directory of test cases + -i, --ip IP of database to test against + -p, --port Port of database to test against + -u, --user User of database to test against + -P, --password Password of database to test against + -d, --db DB name of database to test against + -t, --type Which DBMS to test against [default: mysql] [possible values: mysql, postgresql] + -h, --help Print help + -V, --version Print version +``` + +One example used in our CI is +```bash +sqlness-cli -c tests -i 127.0.0.1 -p 3306 -u root -P 1a2b3c -d public +``` +It will test against a MySQL server listening on `127.0.0.1:3306` + +## Testcase structures +This is the directory structure of testcase for [basic-example](sqlness/examples/basic-case): ``` $ tree examples/ @@ -67,34 +99,6 @@ Stop, env:simple. MyDB stopped. ``` -# Use as CLI -If the tested database supports common wire protocol(such as MySQL), users can choose to use `sqlness-cli` to run integration tests without writing any code. -```bash -$ cargo install sqlness-cli - -$ sqlness-cli -h -A cli to run sqlness tests - -Usage: sqlness-cli [OPTIONS] --case-dir --ip --port - -Options: - -c, --case-dir Directory of test cases - -i, --ip IP of database to test against - -p, --port Port of database to test against - -u, --user User of database to test against - -P, --password Password of database to test against - -d, --db DB name of database to test against - -t, --type Which DBMS to test against [default: mysql] [possible values: mysql] - -h, --help Print help - -V, --version Print version -``` - -One example used in our CI is -```bash -sqlness-cli -c tests -i 127.0.0.1 -p 3306 -u root -P 1a2b3c -d public -``` -It will test against a MySQL server listening on `127.0.0.1:3306` - # Who is using - [CeresDB](https://github.com/CeresDB/ceresdb), a high-performance, distributed, cloud native time-series database that can handle both time-series and analytics workloads. diff --git a/sqlness-cli/Cargo.toml b/sqlness-cli/Cargo.toml index b45758d..d4f2d54 100644 --- a/sqlness-cli/Cargo.toml +++ b/sqlness-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sqlness-cli" -description = "Sqlness command line tool" +description = "SQLNESS command line tool" version = { workspace = true } edition = { workspace = true } homepage = { workspace = true } @@ -13,4 +13,4 @@ readme = { workspace = true } async-trait = "0.1.64" clap = { version = "4.1.8", features = ["derive"] } futures = "0.3.26" -sqlness = { path = "../sqlness", version = "0.5", features = ["mysql", "postgres"] } +sqlness = { path = "../sqlness", version = "0.6", features = ["mysql", "postgres"] }