Comparing version 7.0.2 to 7.1.0
@@ -7,2 +7,8 @@ All major and minor releases are briefly explained below. | ||
### 7.1.0 | ||
#### Enhancements | ||
- [You can now supply both a connection string and additional config options to clients.](https://github.com/brianc/node-postgres/pull/1363) | ||
### 7.0.0 | ||
@@ -9,0 +15,0 @@ |
@@ -14,2 +14,4 @@ 'use strict' | ||
var parse = require('pg-connection-string').parse // parses a connection string | ||
var val = function (key, config, envVar) { | ||
@@ -29,5 +31,2 @@ if (envVar === undefined) { | ||
// parses a connection string | ||
var parse = require('pg-connection-string').parse | ||
var useSsl = function () { | ||
@@ -48,8 +47,10 @@ switch (process.env.PGSSLMODE) { | ||
// if a string is passed, it is a raw connection string so we parse it into a config | ||
config = typeof config === 'string' ? parse(config) : (config || {}) | ||
config = typeof config === 'string' ? parse(config) : config || {} | ||
// if the config has a connectionString defined, parse IT into the config we use | ||
// this will override other default values with what is stored in connectionString | ||
if (config.connectionString) { | ||
config = parse(config.connectionString) | ||
config = Object.assign({}, config, parse(config.connectionString)) | ||
} | ||
this.user = val('user', config) | ||
@@ -56,0 +57,0 @@ this.database = val('database', config) |
@@ -18,6 +18,3 @@ 'use strict' | ||
var BoundPool = function (options) { | ||
var config = { Client: Client } | ||
for (var key in options) { | ||
config[key] = options[key] | ||
} | ||
var config = Object.assign({ Client: Client }, options) | ||
return new Pool(config) | ||
@@ -24,0 +21,0 @@ } |
{ | ||
"name": "pg", | ||
"version": "7.0.2", | ||
"version": "7.1.0", | ||
"description": "PostgreSQL client - pure javascript & libpq with the same API", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
83064
21
1936