From 1b022f8c5f61eccde8138aecd426844de6db9f75 Mon Sep 17 00:00:00 2001 From: Charmander <~@charmander.me> Date: Sun, 26 Jul 2020 10:30:01 -0700 Subject: [PATCH] Remove accidentally duplicated methods Fixes #2293. --- packages/pg/lib/result.js | 73 --------------------------------------- 1 file changed, 73 deletions(-) diff --git a/packages/pg/lib/result.js b/packages/pg/lib/result.js index e1f6bea94..350609743 100644 --- a/packages/pg/lib/result.js +++ b/packages/pg/lib/result.js @@ -95,79 +95,6 @@ class Result { } } } - - // adds a command complete message - addCommandComplete(msg) { - var match - if (msg.text) { - // pure javascript - match = matchRegexp.exec(msg.text) - } else { - // native bindings - match = matchRegexp.exec(msg.command) - } - if (match) { - this.command = match[1] - if (match[3]) { - // COMMMAND OID ROWS - this.oid = parseInt(match[2], 10) - this.rowCount = parseInt(match[3], 10) - } else if (match[2]) { - // COMMAND ROWS - this.rowCount = parseInt(match[2], 10) - } - } - } - - _parseRowAsArray(rowData) { - var row = new Array(rowData.length) - for (var i = 0, len = rowData.length; i < len; i++) { - var rawValue = rowData[i] - if (rawValue !== null) { - row[i] = this._parsers[i](rawValue) - } else { - row[i] = null - } - } - return row - } - - parseRow(rowData) { - var row = {} - for (var i = 0, len = rowData.length; i < len; i++) { - var rawValue = rowData[i] - var field = this.fields[i].name - if (rawValue !== null) { - row[field] = this._parsers[i](rawValue) - } else { - row[field] = null - } - } - return row - } - - addRow(row) { - this.rows.push(row) - } - - addFields(fieldDescriptions) { - // clears field definitions - // multiple query statements in 1 action can result in multiple sets - // of rowDescriptions...eg: 'select NOW(); select 1::int;' - // you need to reset the fields - this.fields = fieldDescriptions - if (this.fields.length) { - this._parsers = new Array(fieldDescriptions.length) - } - for (var i = 0; i < fieldDescriptions.length; i++) { - var desc = fieldDescriptions[i] - 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') - } - } - } } module.exports = Result