fixed 'overload' error for NativeQuery constructor
This commit is contained in:
parent
cabca209c7
commit
847d84f82e
@ -131,12 +131,12 @@ var NativeQuery = function(text, values, callback) {
|
|||||||
this.name = text.name;
|
this.name = text.name;
|
||||||
} else {
|
} else {
|
||||||
this.text = text;
|
this.text = text;
|
||||||
this.callback = callback;
|
|
||||||
this.values = values;
|
this.values = values;
|
||||||
}
|
this.callback = callback;
|
||||||
if(typeof values == 'function') {
|
if(typeof values == 'function') {
|
||||||
this.values = null;
|
this.values = null;
|
||||||
this.callback = values;
|
this.callback = values;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(this.callback) {
|
if(this.callback) {
|
||||||
this.rows = [];
|
this.rows = [];
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
var helper = require(__dirname + '/test-helper');
|
var helper = require(__dirname + '/test-helper');
|
||||||
|
|
||||||
test("noData message handling", function() {
|
test("noData message handling", function() {
|
||||||
return false;
|
|
||||||
var client = helper.client();
|
var client = helper.client();
|
||||||
|
|
||||||
var q = client.query({
|
var q = client.query({
|
||||||
name: 'boom',
|
name: 'boom',
|
||||||
text: 'create temp table boom(id serial, size integer)'
|
text: 'create temp table boom(id serial, size integer)'
|
||||||
});
|
});
|
||||||
|
|
||||||
client.query({
|
client.query({
|
||||||
name: 'insert',
|
name: 'insert',
|
||||||
text: 'insert into boom(size) values($1)',
|
text: 'insert into boom(size) values($1)',
|
||||||
@ -25,7 +25,7 @@ test("noData message handling", function() {
|
|||||||
text: 'insert into boom(size) values($1)',
|
text: 'insert into boom(size) values($1)',
|
||||||
values: [101]
|
values: [101]
|
||||||
});
|
});
|
||||||
|
|
||||||
var query = client.query({
|
var query = client.query({
|
||||||
name: 'fetch',
|
name: 'fetch',
|
||||||
text: 'select size from boom where size < $1',
|
text: 'select size from boom where size < $1',
|
||||||
@ -37,5 +37,5 @@ test("noData message handling", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
client.on('drain', client.end.bind(client));
|
client.on('drain', client.end.bind(client));
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user