CodeFoodPixels / node-promise-mysql

A wrapper for mysqljs/mysql that wraps function calls with Bluebird promises.
MIT License
338 stars 63 forks source link

Logging SQL excecuted queries #39

Closed rohitcelestial closed 7 years ago

rohitcelestial commented 7 years ago

As defined in mysql

var post  = {id: 1, title: 'Hello MySQL'};
var query = connection.query('INSERT INTO posts SET ?', post, function(err, result) {
  // Neat!
});
console.log(query.sql); // INSERT INTO posts SET `id` = 1, `title` = 'Hello MySQL'

We can see the excecuted queries in log Please suggest how to log exceuted queries in promise-mysql

Thanks

CodeFoodPixels commented 7 years ago

Try the solution suggested here: https://github.com/lukeb-uk/node-promise-mysql/issues/23#issuecomment-248548894