/usr/lib/nodejs/pg/result.js is in libnode-pg 0.4.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | //result object returned from query
//in the 'end' event and also
//passed as second argument to provided callback
var Result = function() {
this.rows = [];
};
var p = Result.prototype;
var matchRegexp = /([A-Za-z]+) (\d+ )?(\d+)?/
//adds a command complete message
p.addCommandComplete = function(msg) {
var match = matchRegexp.exec(msg.text);
if(match) {
this.command = match[1];
//match 3 will only be existing on insert commands
if(match[3]) {
this.rowCount = parseInt(match[3]);
this.oid = parseInt(match[2]);
} else {
this.rowCount = parseInt(match[2]);
}
}
};
p.addRow = function(row) {
this.rows.push(row);
};
module.exports = Result;
|