salix/services/loopback/common/methods/vn-model/rawSql.js

16 lines
486 B
JavaScript

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);
});
});
};
};