package
Create a postgres connection and ensure it get's closed
npm install pg-connectGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
As of pg@6, node-postgres has promise suport out of the box. Do not use this package. It is no longer maintained!
Connect to a postgres database with a promise api. Pretty much just an implementation of the suggestions in the bluebird api
var Promise = require('bluebird')
var getConnection = require('pg-connect')(connectionString)
Promise.using(
getConnection(),
function (query) {
return query('SELECT * from foo')
}
).
then(function (results) {
// ... use the results
})where query is a promisified version of client.query in pg.
An example with transactions:
var Promise = require('bluebird')
var getConnection = require('pg-connect')(connectionString)
getConnection.withTransaction(function (query) {
return query('SELECT * from foo')
}).
then(function (results) {
// ... use the results
})Also, getConnection.end is equivalent to pg.end. Similarly, getConnection.defaults is equivalent to pg.defauts.
pg_connect_test or export
DATABASE_URL pointing to a database.npm testjyothis-qb
jyothiss@qburst.com
mkdyanugk
mkdyanugk@gmail.com
vigneshk7
vigneshk@qburst.com
aswanth
aswanth@qburst.com
sajith.qb
sajith@qburst.com
dhiluraj-qburst
dhiluraj@qburst.com
cdrohithmqb
rohith.menon@qburst.com
arjunqb
arjun.venugopal@qburst.com
renjith_ram_qburst
renjith.ramaswamy@qburst.com
sidharth.n
sidharth.n@qburst.com
rahulbharadwaj
rahul.bharadwaj@winmore.app
jasif-wm
jasif.shameem@winmore.app
arpit1024
arpit.shrivastava@winmore.app
showvhick-winmore
showvhick.nath@winmore.app
umeshsahu32
umesh.sahu@winmore.io
kaarthikchandran
karthik.chandran@qburst.com
siddling
siddlinga.reddy@winmore.io
mkdyanugk7
manoj.k@winmore.io
sourajpal
souraj.pal@winmore.io
karan_winmore
karan.parmar@winmore.io
yash.patel.winmore
yash.patel@winmore.io
divyansh-winmore
divyansh@winmore.app
ravi.sah
ravi.sah@winmore.app
dev-saj-winmore
subham.jaiswal@winmore.app
apechimp
apeherder@gmail.com