diff options
| author | Stefan Kreutz <mail@skreutz.com> | 2026-04-16 01:07:28 +0200 |
|---|---|---|
| committer | Stefan Kreutz <mail@skreutz.com> | 2026-04-16 01:07:28 +0200 |
| commit | e9bd990587227b29dc6e41e3d43a5cf2ec9dcd5b (patch) | |
| tree | d9524ecacf291f802f28bc14b7ed058344e70773 /README.md | |
| parent | b1735044d222e7173447d6b72d6bc90085994d32 (diff) | |
| download | temp-postgres-e9bd990587227b29dc6e41e3d43a5cf2ec9dcd5b.tar.gz | |
Add wrapped command option
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 25 |
1 files changed, 21 insertions, 4 deletions
@@ -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. |