Open bpasero opened 2 years ago
When calling db.close I would always expect the callback to be called.
db.close
const sqlite3 = require('sqlite3').verbose(); setTimeout(() => { }, 10000); const promise = new Promise(resolve => { const db = new sqlite3.Database('/Users/bpasero/Desktop/node-sqlite3/notexist/vsce.db', error => { if (error) { console.log(error); } console.log("Trying to close..."); db.close(() => { console.log("Closed"); resolve(); }); }); }); promise.then(() => process.exit());
Run this and notice how it never succeeds closing the DB.
5.0.8
16.15.1
macOS ARM
I am also happy to learn that I do not have to call close in case new sqlite3.Database has an error in the callback and then I can solve this issue without calling close if that is expected.
close
new sqlite3.Database
Issue Summary
When calling
db.close
I would always expect the callback to be called.Steps to Reproduce
Run this and notice how it never succeeds closing the DB.
Version
5.0.8
Node.js Version
16.15.1
How did you install the library?
macOS ARM