tmp-postgres

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

Version on this page:0.2.0.0
LTS Haskell 14.14:0.2.0.0
Stackage Nightly 2019-11-11:0.2.0.0
Latest on Hackage:1.9.0.2

See all snapshots tmp-postgres appears in

BSD-3-Clause licensed by Jonathan Fischoff

Module documentation for 0.2.0.0

This version can be pinned in stack with:tmp-postgres-0.2.0.0@sha256:35cb1834e2015647ebe514c32817f65c6fc30929c635c3355576ea71d2ab9cd6,2594

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