Comparing version 8.4.2 to 8.5.0
@@ -79,8 +79,14 @@ 'use strict' | ||
var tls = require('tls') | ||
const options = Object.assign( | ||
{ | ||
socket: self.stream, | ||
}, | ||
self.ssl | ||
) | ||
const options = { | ||
socket: self.stream, | ||
} | ||
if (self.ssl !== true) { | ||
Object.assign(options, self.ssl) | ||
if ('key' in self.ssl) { | ||
options.key = self.ssl.key | ||
} | ||
} | ||
if (net.isIP(host) === 0) { | ||
@@ -87,0 +93,0 @@ options.servername = host |
@@ -43,5 +43,2 @@ 'use strict' | ||
} | ||
/* eslint-disable no-console */ | ||
console.error(err.message) | ||
/* eslint-enable no-console */ | ||
} | ||
@@ -48,0 +45,0 @@ |
@@ -200,18 +200,18 @@ 'use strict' | ||
if (this.values) { | ||
try { | ||
this.values = this.values.map(utils.prepareValue) | ||
} catch (err) { | ||
this.handleError(err, connection) | ||
return | ||
} | ||
// because we're mapping user supplied values to | ||
// postgres wire protocol compatible values it could | ||
// throw an exception, so try/catch this section | ||
try { | ||
connection.bind({ | ||
portal: this.portal, | ||
statement: this.name, | ||
values: this.values, | ||
binary: this.binary, | ||
valueMapper: utils.prepareValue, | ||
}) | ||
} catch (err) { | ||
this.handleError(err, connection) | ||
return | ||
} | ||
connection.bind({ | ||
portal: this.portal, | ||
statement: this.name, | ||
values: this.values, | ||
binary: this.binary, | ||
}) | ||
connection.describe({ | ||
@@ -218,0 +218,0 @@ type: 'P', |
@@ -41,2 +41,6 @@ 'use strict' | ||
var prepareValue = function (val, seen) { | ||
// null and undefined are both null for postgres | ||
if (val == null) { | ||
return null | ||
} | ||
if (val instanceof Buffer) { | ||
@@ -62,5 +66,2 @@ return val | ||
} | ||
if (val === null || typeof val === 'undefined') { | ||
return null | ||
} | ||
if (typeof val === 'object') { | ||
@@ -67,0 +68,0 @@ return prepareObject(val, seen) |
{ | ||
"name": "pg", | ||
"version": "8.4.2", | ||
"version": "8.5.0", | ||
"description": "PostgreSQL client - pure javascript & libpq with the same API", | ||
@@ -26,3 +26,3 @@ "keywords": [ | ||
"pg-pool": "^3.2.2", | ||
"pg-protocol": "^1.3.0", | ||
"pg-protocol": "^1.4.0", | ||
"pg-types": "^2.1.0", | ||
@@ -56,3 +56,3 @@ "pgpass": "1.x" | ||
}, | ||
"gitHead": "b6d69d5bc2eb7df4f4e04bc864b133b795c76a7f" | ||
"gitHead": "ec1dcab966ecb03080e75112f6d3623d1360b634" | ||
} |
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
68455
1947
Updatedpg-protocol@^1.4.0