Skip to content
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

Bump LiteDB to latest version (5.0.19) to support AutoRebuild functionality in ConnectionString, Other Fixes #137

Closed
alexanderdibenedetto opened this issue Mar 13, 2024 · 1 comment · Fixed by #138

Comments

@alexanderdibenedetto
Copy link

Problem

A production .NET MAUI app I support uses MonkeyCache.LiteDB, and it has quite a few ENSURE and other exceptions as have been reported on the main LiteDB GitHub (https://github.com/mbdavid/LiteDB/releases). They were listed as fixed via the "completely redesigned" auto-rebuild functionality in 5.0.18 along with other bugs.

Typically, we could update LiteDB without needing it updated here, but to get this functionality, we need the ConnectionString MonkeyCache uses to opt-in to this AutoRebuild functionality. See here:

Added "AutoRebuild" option in Connection String
In this version, the Rebuild command has been completely redesigned to be able to recover a full or partial database in case of data corruption. When detecting a structural error (known as the ENSURE exception) the data file will be modified to indicate that this file may be corrupt. When reopening the database, a rebuild process can be performed recovering as much data as possible. Use the "auto-rebuild=true" option in the connection string to activate this functionality. Possible errors found during the rebuild process will be stored in a new collection called "_rebuild_errors". A backup of the original file is created with the "-backup" suffix

Solution
I'm proposing that you add a boolean such as

Barrel.AutoRebuildEnabled

that would have the effect of passing the auto-rebuild=true functionality to the LiteDB connection string for users of MonkeyCache that would like this functionality. Alternatively, if you think there are few people who wouldn't want it, opt MonkeyCache LiteDB users into this functionality for us.

I'm sure it goes without saying, but this proposal also includes bumping to the latest version of LiteDB available at the time this action is performed.

@alexanderdibenedetto
Copy link
Author

@jamesmontemagno thank you for your quick response on this, I appreciate you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant