0.1.2 • Published 2 years ago
postgres-pool-pmb v0.1.2
postgres-pool-pmb
Nicer API for the parts of the pg
postgres module that I actually use.
Mostly renamed config keys for pool config
API
This module exports an object that holds these functions:
initPool(opt)
Returns a promise that will be resolved when we get positive confirmation that the pool accepted our login and has passed a trivial health check.
opt
is an optional options object that supports these mostly optional keys:
pgLib
(required): Your database driver object. It should have an API compatible to the Promise-ing parts of the interface of packagepg
from brianc'snode-postgres
.poolCfg
: An options object with config details for the actual pool. Supported options (all optional) can be found insrc/initPool.opts.mjs
.
Usage
see test/usage.mjs.
Known issues
- Needs more/better tests and docs.
License
ISC