node-sqlite3
node-sqlite3 copied to clipboard
Tracing causes commands to hang when serialized on 4.1.0
If I enable tracing ("db.on('trace', …)") while a database is serialized ("db.serialize()"), the first command I try to execute appears hangs indefinitely. If either tracing or serialization is off, I don't see this issue.
For example, in the following code, the callback is never called:
var sqlite3 = require('sqlite3');
var db = new sqlite3.Database(":memory:");
db.serialize();
db.on("trace", console.log);
db.run("CREATE TABLE Test (Id INTEGER)", function (err) {
console.log(`Callback: ${err}`);
});
Huh - odd! I just ran into the same whilst working on https://github.com/TryGhost/node-sqlite3/pull/1267