Comparing version 7.15.2 to 7.16.0
@@ -21,2 +21,5 @@ 'use strict' | ||
var Connection = require('./connection') | ||
if (process.env.PG_FAST_CONNECTION) { | ||
Connection = require('./connection-fast') | ||
} | ||
@@ -116,3 +119,3 @@ var Client = function (config) { | ||
function checkPgPass (cb) { | ||
function checkPgPass(cb) { | ||
return function (msg) { | ||
@@ -497,3 +500,3 @@ if (typeof self.password === 'function') { | ||
// just do nothing if query completes | ||
query.callback = () => {} | ||
query.callback = () => { } | ||
@@ -500,0 +503,0 @@ // Remove from queue |
@@ -20,4 +20,4 @@ 'use strict' | ||
this.rows = [] | ||
this.fields = [] | ||
this._parsers = [] | ||
this.fields = undefined | ||
this._parsers = undefined | ||
this._types = types | ||
@@ -57,9 +57,9 @@ this.RowCtor = null | ||
Result.prototype._parseRowAsArray = function (rowData) { | ||
var row = [] | ||
var row = new Array(rowData.length) | ||
for (var i = 0, len = rowData.length; i < len; i++) { | ||
var rawValue = rowData[i] | ||
if (rawValue !== null) { | ||
row.push(this._parsers[i](rawValue)) | ||
row[i] = this._parsers[i](rawValue) | ||
} else { | ||
row.push(null) | ||
row[i] = null | ||
} | ||
@@ -93,11 +93,13 @@ } | ||
// you need to reset the fields | ||
this.fields = fieldDescriptions | ||
if (this.fields.length) { | ||
this.fields = [] | ||
this._parsers = [] | ||
this._parsers = new Array(fieldDescriptions.length) | ||
} | ||
for (var i = 0; i < fieldDescriptions.length; i++) { | ||
var desc = fieldDescriptions[i] | ||
this.fields.push(desc) | ||
var parser = (this._types || types).getTypeParser(desc.dataTypeID, desc.format || 'text') | ||
this._parsers.push(parser) | ||
if (this._types) { | ||
this._parsers[i] = this._types.getTypeParser(desc.dataTypeID, desc.format || 'text') | ||
} else { | ||
this._parsers[i] = types.getTypeParser(desc.dataTypeID, desc.format || 'text') | ||
} | ||
} | ||
@@ -104,0 +106,0 @@ } |
{ | ||
"name": "pg", | ||
"version": "7.15.2", | ||
"version": "7.16.0", | ||
"description": "PostgreSQL client - pure javascript & libpq with the same API", | ||
@@ -25,2 +25,3 @@ "keywords": [ | ||
"pg-connection-string": "0.1.3", | ||
"pg-packet-stream": "^1.1.0", | ||
"pg-pool": "^2.0.7", | ||
@@ -56,3 +57,3 @@ "pg-types": "^2.1.0", | ||
}, | ||
"gitHead": "dfae78e383ee33eac074fa93aa2fbb3d68f527b9" | ||
"gitHead": "69345eb96aa2552b288247960aa7126d41210eb6" | ||
} |
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
91319
19
2658
8
10
8
+ Addedpg-packet-stream@^1.1.0
+ Addedpg-packet-stream@1.1.0(transitive)