better-sqlite3-multiple-ciphers
better-sqlite3-multiple-ciphers copied to clipboard
file is not a database
I am using this library in an Electron environment, and the usage is as follows:
this.instance = new SQliteDatabase(path, {
verboze: console.log
});
if (this.secretKey) {
this.instance.key(Buffer.from(this.secretKey));
}
This code runs every time the application starts.
Assuming the encrypted DB file exists and contains data, it generally works fine most of the time.
However, on rare occasions, the following error occurs:
{ code: 'SQLITE_NOTADB' }
I can confirm that the secretKey and the DB file are the same each time, and usually, restarting the application once resolves the issue.
I'm not sure what is causing this. Could you provide some debugging ideas or insights?