connect-pg
connect-pg copied to clipboard
Correct example for new version of node-postgres
As of version 1.0 of node-postgres, the pg.connect callback now returns a 'done' callback which one needs to use to return the client object to the connection pool.
var pg = require('pg');
function pgConnect (callback) {
pg.connect('tcp://nodepg:password@localhost/pgstore',
function (err, client, done) {
if (err) {
console.log(JSON.stringify(err));
}
if (client) {
callback(client);
done();
}
}
);
};
Give me a little time to look at the code. Personal life interfering with productive coding.
Any progress on this ?
https://github.com/jebas/connect-pg/pull/5
+1 The above code works, the example in Readme.md not. Readme.md should be updated.