-
-
Notifications
You must be signed in to change notification settings - Fork 121
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
Replaced greenDAO with androidx.room #506
Draft
JaniruTEC
wants to merge
101
commits into
develop
Choose a base branch
from
feature/dao-migration
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Replaced greenDAO dependency with androidx.room Introduced database version 13
Introduced database version 14
The method was a delegate to the "DaoSession#clear" method provided by greenDAO. Analysis of the generated code indicates that room doesn't cache results internally. Therefore clearing the cache to evict stale entries is unnecessary. See: https://web.archive.org/web/20230806043911/https://greenrobot.org/greendao/documentation/sessions/
This comment was marked as resolved.
This comment was marked as resolved.
Without this change room will create the app db itself on installation without running the migrations.
# Conflicts: # build.gradle
Also added missing "@VisibleForTesting" annotation to "MappingSupportSQLiteDatabase" *This commit is related to issue #529 [1]* [1] #529
Added additional validation Moved database operations to "use" blocks
If database corruption is detected the database is deleted and then recreated. Properly recreating and opening the new database involves invalidating any references to the old database and then running any initialization logic. Added "Invalidatable" as wrapper for database references Added "DatabaseOpenHelperFactory" to the dagger graph and added invalidation logic to "PatchedCallback" Added dynamically delegating implementations for all entities to allow seamless swapping of underlying database instances Configured Room to initialize based on the database template if a database with version 0 is encountered
Also added "databaseName" to parameter list of "provideInternalCryptomatorDatabase" to allow different names for test databases
Added missing message in "CryptomatorAssert" Fixed imports and codestyle Added missing call to "disableWriteAheadLogging" Made instance of "AOP_SQLiteDatabase" in "MappingSupportSQLiteDatabase" static
This creates a single source of truth for configuring the main database and any tests.
"PatchedCallback" and "DatabaseOpenHelperFactoryKt.patchConfiguration" interact with the inner classes of "SupportSQLiteOpenHelper" in a way that is prone to introducing bugs due to unnoticed changes to those classes. The tests introduced by this commit ensure that changes to the bills of materials for those classes are noticed and handled in the future.
Added inner class "MappingSupportSQLiteStatementTest" to "MappingSupportSQLiteDatabaseTest" and included an additional counter-based mapping Added test "testNewBoundStatementSingle": Run "newBoundStatement" three times on the same "MappingSupportSQLiteStatement" (with the same unmapped sql strings and the same backing mapping) Added test "testNewBoundStatementMultiple": Run "newBoundStatement" on three different instances of "MappingSupportSQLiteStatement" (with the same/different unmapped sql strings and per-statement backing mappings) Added matching data sets for tests Added a number of utility methods Refactored "cartesianProduct" methods Refactored extension methods for "ContentValues" defined in "MappingSupportSQLiteDatabaseTest.kt" and mirrored them for "Iterable<Any?>?" Changed visibility of "MappingSupportSQLiteStatement.newBoundStatement" to "internal" and annotated it with "@VisibleForTesting" *This commit is related to issue #529 [1]* [1] #529
Unified the implementation of "testInsert" with the implemention of all tests contained in "MappingSupportSQLiteStatementTest" by first augmenting and moving the implementation of "testSingleNewBoundStatement" to a new method "testSingleCompiledStatement" and then using that method in "testInsert": > Previous control flows: >> "testNewBoundStatementX" -> ("testConsecutiveNewBoundStatements" ->) "testConsecutiveNewBoundStatements" -> "testSingleNewBoundStatement" -> *Verifications* >> "testInsert" -> *Verifications* > New control flows: >> "testNewBoundStatementX" -> ("testConsecutiveNewBoundStatements" ->) "testConsecutiveNewBoundStatements" -> "testSingleNewBoundStatement" -> "testSingleCompiledStatement" -> *Verifications* >> "testInsert" -> "testSingleInsert" -> "testSingleCompiledStatement" -> *Verifications* Removed extensions methods for "ContentValues" defined in "MappingSupportSQLiteDatabaseTest.kt" and replaced usages with calls to corresponding extension methods for "Iterable<Any?>?" defined in "MappingSupportSQLiteDatabaseTest.kt" *This commit is related to issue #529 [1]* [1] #529
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary by CodeRabbit
New Features
improveddata integrity.Enhancements
Improved database operation efficiency by utilizing Kotlin's type alias and constructor-based entity creation.Enhanced database schema with the addition of entities for Cloud, Update Check, and Vault.Bug Fixes
Refactor
Documentation
Chores