From e9bd990587227b29dc6e41e3d43a5cf2ec9dcd5b Mon Sep 17 00:00:00 2001 From: Stefan Kreutz Date: Thu, 16 Apr 2026 01:07:28 +0200 Subject: Add wrapped command option --- README.md | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 3663571..1d65c60 100644 --- a/README.md +++ b/README.md @@ -10,13 +10,30 @@ This project's original source code is hosted [here][home]. ## Usage -Create a temporary database "test" with superuser "alex": +Create and serve a temporary database: - $ temp-postgres --dbname test --username alex + $ temp-postgres -Connect to the "test" database: +Wrap the `psql` command to connect to the temporary database once the server is ready: - $ psql --host localhost --dbname test --username alex + $ temp-postgres -- psql + +Run [SQLx integration tests](https://docs.rs/sqlx/latest/sqlx/attr.test.html) against a temporary database: + + $ temp-postgres -- cargo test + +Or configure `temp-postgres` as a wrapper for [cargo-nextest](https://nexte.st/): + +```toml +experimental = ["wrapper-scripts"] + +[scripts.wrapper.temp-postgres] +command = 'temp-postgres' + +[[profile.default.scripts]] +platform = { host = 'cfg(unix)' } +run-wrapper = 'temp-postgres' +``` See the manual page for details. -- cgit v1.3