Types for easy adding postgresql configuration to your program

Latest on Hackage:0.1.0

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow to host generated Haddocks.

BSD3 licensed by Aleksey Uimanov
Maintained by


Simple types and set of functions to quickly add configuration of postgresql to your Yesod site or whatever.


Add separate file or section inside your existing config like that

database:    "dbname"
host:        ""       # optional
port:         5432             # optional
user:        "dbuser"
password:    "pass"
poolsize:    10               # optional maximum connections in pool
pooltimeout: 60               # optional minimum connection lifetime
poolstripes: 1                # optional count of stripes in pool

and then in your program something like that

conf <- decodeFile "pgconfig.yml"
         >>= maybe (fail "Could not parse pgconfig.yml") return
pool <- createPGPool conf
pingPGPool pool

So now you have a pool and can perform queries any way you like.





  • createPGPoolWithCallback accepting callback which must be executed on each connection just after it opened by pool.


  • base constraints relaxed
  • changelog added
  • cabal file beautified


First version

comments powered byDisqus