Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/pool.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,15 +199,15 @@ class PoolManagerCore extends PoolManagerFunctions {
}

// FUNCTION: Execute query
execute(cb, scope) {
execute(cb, payload, scope) {
// Check connection is initialized...
if (!scope.connection) {
return typeof scope.returnCallback === 'function'
? scope.returnCallback([], scope.errorMessage)
: void 0;
}
// Start query execution..
return scope.connection.query(scope.sqlCommand, (err, rows) => {
return scope.connection.query(scope.sqlCommand, payload, (err, rows) => {
// Register query
this.poolActivity[this.currentSessionId()]++;
// Check for any errors
Expand Down Expand Up @@ -238,7 +238,7 @@ class PoolManagerCore extends PoolManagerFunctions {
}

// FUNCTION: Execute query in services database
query(command, callback) {
query(command, payload=[], callback) {
// Scope...
const scope = {
connection: '',
Expand All @@ -254,7 +254,7 @@ class PoolManagerCore extends PoolManagerFunctions {
[
callback => this.checkPoolStatus(callback, scope),
callback => this.getConnection(callback, scope),
callback => this.execute(callback, scope),
callback => this.execute(callback, payload, scope),
],
error => {
if (error) {
Expand Down
Loading