fix jshint errors in lib/native/query.js

This commit is contained in:
Philipp Borgers 2013-01-24 00:52:02 +01:00
parent 3b1a5beba8
commit 0c3e1cba83

View File

@ -20,7 +20,7 @@ var NativeQuery = function(config, values, callback) {
this.text = config.text;
this.values = config.values;
this.callback = config.callback;
this._result = new Result();
//normalize values
if(this.values) {
@ -38,8 +38,9 @@ var p = NativeQuery.prototype;
var mapRowData = function(row) {
var result = {};
for(var i = 0, len = row.length; i < len; i++) {
var item = row[i];
result[item.name] = item.value === null ? null : types.getTypeParser(item.type, 'text')(item.value);
var item = row[i];
result[item.name] = item.value === null ? null :
types.getTypeParser(item.type, 'text')(item.value);
}
return result;
};
@ -79,14 +80,14 @@ p.handleReadyForQuery = function(meta) {
};
p.streamData = function (connection) {
if ( this.stream ) this.stream.startStreamingToConnection(connection);
else connection.sendCopyFail('No source stream defined');
else connection.sendCopyFail('No source stream defined');
};
p.handleCopyFromChunk = function (chunk) {
if ( this.stream ) {
this.stream.handleChunk(chunk);
}
//if there are no stream (for example when copy to query was sent by
//query method instead of copyTo) error will be handled
//on copyOutResponse event, so silently ignore this error here
//query method instead of copyTo) error will be handled
//on copyOutResponse event, so silently ignore this error here
};
module.exports = NativeQuery;