Closed code-ape closed 5 months ago
Thanks @Prinzhorn, I've opened a PR which addresses both this and #1124:
fwiw, the built-in sqlite_version() function will return this value:
const bs = require("better-sqlite3");
function sqliteVersion() {
let db;
try {
db = new bs(":memory:");
return db.prepare("select sqlite_version()").pluck().get();
} finally {
db?.close();
}
}
console.log(sqliteVersion());
Emits 3.44.2
In working with better-sqlite3 we wanted to check the exact version of
sqlite3
being used to ensure a feature was available or throw an error. There does not appear to be any way to get the sqlite3 version out of better-sqlite3 right now.Suggestion of something like:
Related Issues & PRs: