Improve scripts
This commit is contained in:
@@ -12,7 +12,7 @@ The rest of this section assumes you're in the dev shell.
|
||||
|
||||
### Running Postgres
|
||||
|
||||
`scripts/with-db $COMMAND` will create a Postgres cluster in a temporary directory with the credentials `user=yore-test dbname=yore-test port=5433`, start the Postgres server, run `$COMMAND` and then stop the Postgres erver.
|
||||
`scripts/with-db $COMMAND` will create a Postgres cluster in a temporary directory with the credentials `user=yore-test dbname=yore-test port=5433`, start the Postgres server, apply migrations using `dbmate`, run `$COMMAND` and then stop the Postgres server.
|
||||
On Linux, you need to have write permissions vor `/var/run/postgresql` to run it.
|
||||
You can use this to run the tests in an entirely fresh database, e.g.:
|
||||
|
||||
@@ -24,6 +24,8 @@ You can also use it to run a database for development by choosing a `$COMMAND` t
|
||||
|
||||
```
|
||||
BASE_DIR=./pgdata scripts/with-db psql "dbname=yore-test port=5433 user=yore-test"
|
||||
# cabal repl with env vars set
|
||||
BASE_DIR=./pgdata scripts/with-db scripts/dev
|
||||
```
|
||||
|
||||
By setting `$BASE_DIR` you can persist the database for later runs.
|
||||
|
||||
Reference in New Issue
Block a user