Permalink
Browse files

feat: compatible with showSql

  • Loading branch information...
XadillaX committed Oct 17, 2016
1 parent 4267c33 commit 84ce8a2d2e9254f1396d7a66ae1d9b95f5aa9e5f
Showing with 6 additions and 1 deletion.
  1. +4 −0 lib/adapters/mysql.js
  2. +2 −1 test/adapters/mysql.js
@@ -1037,6 +1037,7 @@ class MySQLAdapter extends Adapter {
params = undefined;
}

const self = this;
this.mysql.getConnection((err, conn) => {
if(err) return callback(err);

@@ -1045,6 +1046,9 @@ class MySQLAdapter extends Adapter {
}

debug(`executing sql 【${sql}`);
if(self.options.showSql) {
console.log(`❤️ Toshihiko is executing SQL: 【${sql}】...`);
}
conn.query(sql, function(err, rows) {
conn.release();
callback(err, rows);
@@ -22,7 +22,8 @@ describe("🐣 adapters/mysql", function() {
username: "root",
password: "",
database: "__toshihiko__",
charset: "utf8mb4_general_ci"
charset: "utf8mb4_general_ci",
showSql: true
};

before(function(done) {

0 comments on commit 84ce8a2

Please sign in to comment.