tmp-postgres

Start and stop a temporary postgres for testing https://github.com/jfischoff/tmp-postgres#readme

Version on this page:0.1.1.1
LTS Haskell 12.22:0.1.1.1
Stackage Nightly 2018-12-12:0.1.1.1
Latest on Hackage:0.1.1.1

See all snapshots tmp-postgres appears in

BSD3 licensed by Jonathan Fischoff
Maintained by jonathangfischoff@gmail.com

Module documentation for 0.1.1.1

There are no documented modules for this package.

Travis CI Status

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
comments powered byDisqus