Skip to content

Commit

Permalink
Add raw query support for eventsDB
Browse files Browse the repository at this point in the history
PWC Update freelancer booking form
  • Loading branch information
nedobylskiy committed Apr 9, 2019
1 parent 7318950 commit efe2853
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions modules/smartContracts/EventsDB.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,26 @@ class EventsDB {
});
}

/**
* Executes RAW SQL query
* @param {string} query
* @param {array} bindParams
* @param {function} cb
*/
rawQuery(query, bindParams, cb) {
let statement;

if(bindParams) {
statement = this.db.prepare(query, bindParams);
} else {
statement = this.db.prepare(query, []);
}

statement.all([], function (err, values) {
cb(err, values);
})
}

/**
* Call contract event handlers
* @param contract
Expand Down

0 comments on commit efe2853

Please sign in to comment.