Closed
Description
This may be an issue listed, i searched and couldn't find anything exact. Also posted in the sqlite library I use that pulls this package - m4heshd/better-sqlite3-multiple-ciphers#62
I seem to be having a problem when connecting to the database via SQLiteStudio, it breaks something. I assume it's my WAL archive.
Config when opening the db:
PRAGMA cipher='chacha20'
PRAGMA journal_mode = WAL
PRAGMA temp_store = memory
PRAGMA mmap_size = 30000000000
PRAGMA page_size = 32768
PRAGMA vacuum
Steps to break it:
- Start the electron application
- Set the password for the database
- Refresh the electron application
- Type the password in to unlock it, all works.
- close the electron application
- Connect to the database via SQLiteStudio
- Make a few queries on SQLiteStudio
- Disconnect from database in SQLiteStudio
- Start application again
- Type password to unlock (same as step 4 above)
- all queries from the application result in
error: SqliteError: database disk image is malformed
Alternate steps to break (if the top has a fix, this is not relevant)
- Modify the config and remove the
journal_mode = WAL
- Delete the database file, so it creates a new one
- Start the electron application
- Set the password, it fails here with error: SqliteError: database disk image is malformed`
Here it does not fail instantly, though. It actually does half the queries and then starts to fail.
BEGIN
[1] 12:08:43.585 › create table `peoplePossibleMatches` (`personMatchId` text not null, `peopleId` text not null, `confidence` integer not null);
[1] 12:08:43.585 › create unique index `peoplepossiblematches_personmatchid_peopleid_unique` on `peoplePossibleMatches` (`personMatchId`, `peopleId`)
[1] 12:08:43.586 › COMMIT
[1] 12:08:43.587 › select `name` from `sqlite_master` where `type` = 'table'
[1] 12:08:43.587 › select * from `migrations`
[1] 12:08:43.588 › [Database Knex Query] error: SqliteError: database disk image is malformed - Query String: 'select * from `migrations`'
Questions:
- How can I fix the above error, if it happens?
- Is there a way to not have SQLiteStudio break the database?
Metadata
Metadata
Assignees
Labels
No labels