Allow changing pg.defaults
Created by: swissspidy
In #51 (closed) I noted how it's not possible to change pg.defaults
via Massive. node-postgres
allows overriding a few defaults. Here's an example:
var pg = require('pg');
pg.defaults.poolSize = 25;
//pool is created on first call to pg.connect
pg.connect(function(err, client, done) {
done();
});
pg.defaults.poolSize = 2;
//pool still has a size of 25
pg.connect(function(err, client, done) {
done();
});
//creating a new pool by using a different connection string
//will create this second pool with a size of 2
pg.connect('other-pool', function(err, client, done) {
});
The runner class (DB.prototype.query
and DB.prototype.stream
, specifically) could be extended to allow changing these defaults.