hapiest-mysql
Advanced tools
Comparing version 0.0.28 to 0.0.29
@@ -121,2 +121,3 @@ 'use strict'; | ||
return Promise.resolve() | ||
.tap(() => this._logSqlQuery(selectQuery)) | ||
.then(() => MysqlQuery.validateSelect(selectQuery)) | ||
@@ -157,2 +158,3 @@ .then(() => pool.queryAsync(selectQuery)) | ||
return Promise.resolve() | ||
.tap(() => this._logSqlQuery(insertQuery)) | ||
.then(() => MysqlQuery.validateInsert(insertQuery)) | ||
@@ -174,2 +176,3 @@ .then(() => this._writePool.queryAsync(insertQuery)) | ||
return Promise.resolve() | ||
.tap(() => this._logSqlQuery(updateQuery)) | ||
.then(() => MysqlQuery.validateUpdate(updateQuery)) | ||
@@ -191,2 +194,3 @@ .then(() => this._writePool.queryAsync(updateQuery)) | ||
return Promise.resolve() | ||
.tap(() => this._logSqlQuery(deleteQuery)) | ||
.then(() => MysqlQuery.validateDelete(deleteQuery)) | ||
@@ -208,2 +212,3 @@ .then(() => this._writePool.queryAsync(deleteQuery)) | ||
return Promise.resolve() | ||
.tap(() => this._logSqlQuery(query)) | ||
.then(() => {return this._writePool.queryAsync(query)}) // We have to execute generic queries against "master"); | ||
@@ -241,4 +246,10 @@ .catch(err => { | ||
_logSqlQuery(sql) { | ||
if (this._logger) { | ||
this._logger.debug('Executing SQL', {sql: sql}) | ||
} | ||
} | ||
} | ||
module.exports = MysqlService; |
{ | ||
"name": "hapiest-mysql", | ||
"version": "0.0.28", | ||
"version": "0.0.29", | ||
"description": "A wrapper around mysql that provides a very descriptive way of running queries.", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "NODE_ENV=test mocha ./test/unit" | ||
"test": "NODE_ENV=test node_modules/mocha/bin/mocha ./test/unit" | ||
}, | ||
@@ -40,2 +40,3 @@ "repository": { | ||
"intercept-stdout": "^0.1.2", | ||
"mocha": "3.0.2", | ||
"path": "^0.12.7", | ||
@@ -42,0 +43,0 @@ "should": "^8.3.1", |
@@ -5,5 +5,5 @@ { | ||
"host": "localhost", | ||
"database": "optimage", | ||
"user": "optimagedev", | ||
"password": "=7QM^!4ynHebT7s7", | ||
"database": "hapiestmysql", | ||
"user": "hapiestmysql", | ||
"password": "hapiestmysql", | ||
"connectionLimit": 10 | ||
@@ -13,5 +13,5 @@ }, | ||
"host": "localhost", | ||
"database": "optimage", | ||
"user": "optimagedev", | ||
"password": "=7QM^!4ynHebT7s7", | ||
"database": "hapiestmysql", | ||
"user": "hapiestmysql", | ||
"password": "hapiestmysql", | ||
"connectionLimit": 10 | ||
@@ -18,0 +18,0 @@ } |
188320
4106
9