tmp-postgres

Start and stop a temporary postgres for testing

https://github.com/jfischoff/tmp-postgres#readme

Version on this page:0.1.0.7
LTS Haskell 21.25:1.34.1.0
Stackage Nightly 2023-06-21:1.34.1.0
Latest on Hackage:1.34.1.0

See all snapshots tmp-postgres appears in

BSD-3-Clause licensed by Jonathan Fischoff
Maintained by [email protected]
This version can be pinned in stack with:tmp-postgres-0.1.0.7@sha256:05aca59575daa435d9b6008398a1ff35a04b478cce55f400cfeb973ebb56d1db,2402

Module documentation for 0.1.0.7

Used by 1 package in nightly-2017-07-15(full list with versions):

Travis CI Status

tmp-postgres

tmp-postgres is a libary for greating 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