Types for easy adding postgresql configuration to your program https://bitbucket.org/s9gf4ult/postgresql-config
|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 stackage.org to host generated Haddocks.
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: "127.0.0.1" # 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.
createPGPoolWithCallbackaccepting callback which must be executed on each connection just after it opened by pool.
- changelog added
- cabal file beautified