As per docs, You can use
query.sql
to get the actual executed query.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'
In this case, it will be
connection.query(command, function (err, rows) {
if (err) {
console.log('this.sql', this.sql); //command/query
console.log(command);
console.log("ERROR");
console.log(err);
return;
}
console.log("good");
});
Không có nhận xét nào:
Đăng nhận xét