Skip to content

Commit 3f9c3ff

Browse files
setup the debug module
1 parent 73ea092 commit 3f9c3ff

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

machines/send-native-query.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ module.exports = {
7878
fn: function sendNativeQuery(inputs, exits) {
7979
var util = require('util');
8080
var _ = require('lodash');
81+
var debug = require('debug')('query');
8182
var validateConnection = require('../helpers/validate-connection');
8283

8384
// Validate provided connection.
@@ -105,6 +106,11 @@ module.exports = {
105106
}
106107

107108

109+
debug('Running SQL Query:');
110+
debug('SQL: ' + sql);
111+
debug('Bindings: ' + bindings);
112+
debug('Connection Id: ' + inputs.connection.id);
113+
108114
// Send native query to the database using node-mysql.
109115
inputs.connection.query({
110116
sql: sql,

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"author": "The Treeline Company",
2121
"license": "MIT",
2222
"dependencies": {
23+
"debug": "2.2.0",
2324
"lodash": "3.10.1",
2425
"machine": "12.4.0",
2526
"mysql": "2.10.2",

0 commit comments

Comments
 (0)