-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.key is not encrypting existing database #73
Comments
Sorry for the delayed response.
This is expected behavior since the pages are decrypted only when you query any data.
Unfortunately, the only method is to try to decrypt and look for any errors. There's no dedicated way to check the encryption status. I am closing this issue since no further solutions are available. Feel free to reopen if you have any updates. |
Hey @m4heshd , thanks for your reply! Shouldn't I found a particular solution to migrate existing users to a new database, thank you! |
It follows the behavior of SQLite's own SEE for compatibility. Just took a look at your code again. Need to verify something. Can you try the same code with |
Hey @m4heshd same behavior either using .key or pragma key. |
@cezarsmpio Sorry for not responding sooner. Another issue opened recently made me remember what exactly is happening here. Please take a look at #88 (comment). |
Hello everyone, great work on this library. I have the following case, existing databases and first run databases. According to the documentation of
.key
it says:But it's not working as expected I guess? It works fine if I run
.rekey
before.I currently use
typeorm
andElectron
with an Express server and this is my code:The error I get is:
Unfortunately the
try...catch
I put inside theprepareDatabase
method doesn't throw any error, it actually passes, the error happens when it tries to execute a query on the lifecycle of the application.If I only use:
This is the error I get:
Is there a recommended way to check if the database is encrypted already? So I can choose to either run
.key
or.rekey
?Thank you!
The text was updated successfully, but these errors were encountered: