The tmp-postgres package

[ Tags: bsd3, library, web ] [ Propose Tags ]

This module provides functions 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

The are few different methods for starting postgres which provide different methods of dealing with stdout and stderr.

The start methods use a config based on the one used by pg_tmp (http:/ephemeralpg.org), but can be overriden by different values to the first argument of the start functions.

WARNING!! Ubuntu's PostgreSQL installation does not put initdb on the PATH. We need to add it manually. The necessary binaries are in the /usr/lib/postgresql/VERSION/bin/ directory, and should be added to the PATH

echo "export PATH=$PATH:/usr/lib/postgresql/VERSION/bin/" >> /home/ubuntu/.bashrc

[Skip to Readme]

Properties

Versions 0.1.0.0, 0.1.0.1, 0.1.0.2, 0.1.0.3, 0.1.0.4, 0.1.0.5, 0.1.0.6, 0.1.0.7, 0.1.0.8, 0.1.1.0
Dependencies base (>=4.6 && <5), directory, network, process (>=1.2.0.0), temporary, unix [details]
License BSD3
Copyright 2017 Jonathan Fischoff
Author Jonathan Fischoff
Maintainer jonathangfischoff@gmail.com
Category Web
Home page https://github.com/jfischoff/tmp-postgres#readme
Source repository head: git clone https://github.com/jfischoff/tmp-postgres
Uploaded Mon Sep 25 00:23:15 UTC 2017 by JonathanFischoff
Distributions LTSHaskell:0.1.1.0, NixOS:0.1.0.8, Stackage:0.1.1.0
Downloads 393 total (20 in the last 30 days)
Rating 0.0 (0 ratings) [clear rating]
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2017-09-25 [all 1 reports]
Hackage Matrix CI

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for tmp-postgres-0.1.1.0

[back to package description]

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