@hackage tmp-postgres0.1.2.2
Start and stop a temporary postgres for testing
Categories
License
BSD-3-Clause
Maintainer
jonathangfischoff@gmail.com
Links
Versions
Installation
Dependencies (10)
- async
- base >=4.6 && <5
- bytestring
- directory
- network
- port-utils Show all…
Dependents (16)
@hackage/sydtest-persistent-postgresql, @hackage/trek-db, @hackage/hasql-interpolate, @hackage/pg-entity, @hackage/rel8, @hackage/pg-transact, Show all…
tmp-postgres
tmp-postgres is a library for creating a temporary postgres instance on a random port for testing.
result <- start []
case result of
Left err -> print err
Right tempDB -> do
-- Do stuff
stop tempDB
Installation
macOS
$ brew install postgres
$ stack install tmp-postgres
Ubuntu
Ubuntu's PostgreSQL installation does not put initdb on the PATH. We need to add it manually.
$ sudo apt-get install postgresql-VERSION
$ echo "export PATH=$PATH:/usr/lib/postgresql/VERSION/bin/" >> /home/ubuntu/.bashrc
$ stack install tmp-postgres