DEPRECATED
As of pg@6, node-postgres has promise suport out of the box. Do not use this package. It is no longer maintained!
pg-connect
Connect to a postgres database with a promise api. Pretty much just an implementation of the suggestions in the bluebird api
Installation
Usage
var Promise = var getConnection = connectionString Promise
where query is a promisified version of client.query
in pg.
An example with transactions:
var Promise = var getConnection = connectionString getConnection
Also, getConnection.end
is equivalent to pg.end
. Similarly, getConnection.defaults
is equivalent to pg.defauts
.
Testing
- Ensure you have a local postgres database named
pg_connect_test
or exportDATABASE_URL
pointing to a database. npm test