salix/services/loopback/common/methods/vnModel/rawSql.js

16 lines
486 B
JavaScript
Raw Normal View History

2018-02-27 13:55:59 +00:00
module.exports = function(Self) {
Self.rawSql = function(query, params, cb) {
var connector = this.dataSource.connector;
return new Promise(function(resolve, reject) {
connector.execute(query, params, function(error, response) {
if (cb)
cb(error, response);
if (error)
reject(error);
else
resolve(response);
});
});
};
};