Skip to content

Commit 80de6be

Browse files
committed
support execute() without parameters
1 parent b850a01 commit 80de6be

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/pool.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,13 @@ Pool.prototype.query = function(sql, values, cb) {
165165
Pool.prototype.execute = function(sql, values, cb) {
166166
var useNamedPlaceholders = this.config.connectionConfig.namedPlaceholders;
167167

168+
// TODO construct execute command first here and pass it to connection.execute
169+
// so that polymorphic arguments logic is there in one place
170+
if (typeof values == 'function') {
171+
cb = values;
172+
values = [];
173+
}
174+
168175
this.getConnection(function(err, conn) {
169176
if (err) {
170177
return cb(err);

0 commit comments

Comments
 (0)