我在Node JS中使用mariasql NPM module并连接到MariaSQL 5.5.60服务器。如何检索当前连接执行的最后一个查询?
例如,
connection.query("SELECT * FROM table1 WHERE name = :name AND city = :city", { name: "John Smith", city: "Poughkeepsie" }, (err, data) => {
// Log the query that was executed:
console.log("Executed query was: " + connection.__someFunctionToGetLastQuery___());
// Should display "SELECT * FROM table1 WHERE name = 'John Smith' AND city = 'Poughkeepsie'"
});
如果有一个更好/更新/更完善的MariaDB模块,那么我很高兴。
谢谢!