Completely promisify firebird driver

This commit is contained in:
Timothy Warren 2016-11-14 20:23:27 -05:00
parent 5dd42e07a7
commit 0ee092abd9
2 changed files with 34 additions and 37 deletions

View File

@ -1,7 +1,6 @@
'use strict'; 'use strict';
const Adapter = require('../Adapter'); const Adapter = require('../Adapter');
const getArgs = require('getargs');
const fb = require('node-firebird'); const fb = require('node-firebird');
class Firebird extends Adapter { class Firebird extends Adapter {
@ -29,7 +28,7 @@ class Firebird extends Adapter {
execute (sql, params) { execute (sql, params) {
return this.instance.then(conn => { return this.instance.then(conn => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
conn.query(args.sql. args.params, (err, result) => { conn.query(sql, params, (err, result) => {
if (err) { if (err) {
return reject(err); return reject(err);
} }

View File

@ -1,11 +1,10 @@
'use strict'; 'use strict';
(() => {
// Load the test base // Load the test base
const path = require('path'); const path = require('path');
const reload = require('require-reload')(require); const reload = require('require-reload')(require);
const testBase = reload('../base'); const testBase = reload('../base');
const expect = reload('chai').expect; const expect = testBase.expect;
const testRunner = testBase.promiseTestRunner; const testRunner = testBase.promiseTestRunner;
// Skip on CI // Skip on CI
@ -39,4 +38,3 @@
qb.end(); qb.end();
}); });
}); });
})();