diff options
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. |