如何使用MariaSQL Node JS模块执行上一次查询?

时间:2018-10-12 17:32:00

标签: mysql node.js mariadb

我在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模块,那么我很高兴。

谢谢!

0 个答案:

没有答案