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

[ bsd3, database, library ] [ Propose Tags ]

Modules

[Index]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 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 2015-07-31T17:26:29Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 2452 total (16 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2015-09-30 [all 2 reports]

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.