postgresql-config: Types for easy adding postgresql configuration to your program

[ bsd3, database, library ] [ Propose Tags ]

[Skip to Readme]
Versions 0.0.1, 0.0.2, 0.1.0
Change log CHANGELOG.md
Dependencies aeson, base (>=4.6 && <=5.0), bytestring, monad-control, mtl, postgresql-simple, resource-pool, time [details]
License BSD-3-Clause
Author Aleksey Uimanov
Maintainer s9gf4ult@gmail.com
Category Database
Home page https://bitbucket.org/s9gf4ult/postgresql-config
Source repo head: git clone git@bitbucket.org:s9gf4ult/postgresql-config.git
Uploaded by AlekseyUymanov at Fri Jul 31 17:26:29 UTC 2015
Distributions NixOS:0.1.0
Downloads 901 total (13 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2015-09-30 [all 2 reports]
Hackage Matrix CI

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for postgresql-config-0.1.0

[back to package description]

What?

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

How?

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.