Comparing version 1.0.2 to 1.0.3
@@ -5,6 +5,7 @@ var genericPool = require('generic-pool') | ||
var debug = require('debug') | ||
var objectAssign = require('object-assign') | ||
var Pool = module.exports = function (options, Client) { | ||
EventEmitter.call(this) | ||
this.options = options || {} | ||
this.options = objectAssign({}, options) | ||
this.log = this.options.log || debug('pg:pool') | ||
@@ -11,0 +12,0 @@ this.Client = this.options.Client || Client || require('pg').Client |
{ | ||
"name": "pg-pool", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Connection pool for node-postgres", | ||
@@ -40,4 +40,5 @@ "main": "index.js", | ||
"debug": "^2.2.0", | ||
"generic-pool": "2.4.2" | ||
"generic-pool": "2.4.2", | ||
"object-assign": "4.1.0" | ||
} | ||
} |
@@ -129,2 +129,16 @@ # pg-pool | ||
### environment variables | ||
pg-pool & node-postgres support some of the same environment variables as `psql` supports. The most common are: | ||
``` | ||
PGDATABASE=my_db | ||
PGUSER=username | ||
PGPASSWORD="my awesome password" | ||
PGPORT=5432 | ||
PGSSLMODE=require | ||
``` | ||
Usually I will export these into my local environment via a `.env` file with environment settings or export them in `~/.bash_profile` or something similar. This way I get configurability which works with both the postgres suite of tools (`psql`, `pg_dump`, `pg_restore`) and node, I can vary the environment variables locally and in production, and it supports the concept of a [12-factor app](http://12factor.net/) out of the box. | ||
## tests | ||
@@ -131,0 +145,0 @@ |
@@ -54,2 +54,13 @@ var expect = require('expect.js') | ||
}) | ||
it('should not change given options', function (done) { | ||
var options = { max: 10 } | ||
var pool = new Pool(options) | ||
pool.connect(function (err, client, release) { | ||
release() | ||
if (err) return done(err) | ||
expect(options).to.eql({ max: 10 }) | ||
pool.end(done) | ||
}) | ||
}) | ||
}) | ||
@@ -56,0 +67,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14335
211
161
3
+ Addedobject-assign@4.1.0
+ Addedobject-assign@4.1.0(transitive)