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
82
commits into
develop
Choose a base branch
from
feature/dao-migration
base: develop
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
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.
Room is designed to choose the journal mode itself if none is specified. greenDAO's journal mode ("TRUNCATE") will stay for now because the journal mode has influence on the behavior caused by issue #529 [1] and because changing the journal mode complicates the migration further. This can still be changed later. *This commit is related to issue #529 [1]* [1] #529
Replaced particular implementation of "fix" with call to freshly introduced, user-supplied mapping function (and added "RandomUUIDSQLMappingFunction" as new mapping function with that particular implementation) Replaced "fixCompile" with direct instantiation of "CacheControlledSupportSQLiteStatement" Updated static elements to be inner members of "CacheControlledSupportSQLiteDatabase" (and removed now unnecessary properties) Changed computation logic of "sql" property in "CacheControlledSupportSQLiteQuery" *This commit is related to issue #529 [1]* [1] #529
Renamed class "CacheControlledSupportSQLiteDatabase" to "MappingSupportSQLiteDatabase" Renamed class "CacheControlledSupportSQLiteOpenHelper" to "MappingSupportSQLiteOpenHelper" Renamed class "CacheControlledSupportSQLiteOpenHelperFactory" to "MappingSupportSQLiteOpenHelperFactory" Renamed inner class "CacheControlledSupportSQLiteStatement" to "MappingSupportSQLiteStatement" Renamed inner class "CacheControlledSupportSQLiteQuery" to "MappingSupportSQLiteQuery" Renamed method "fix" to "map" in "MappingSupportSQLiteDatabase" Renamed method "fixWhereClause" to "mapWhereClause" in "MappingSupportSQLiteDatabase" Renamed property "identifiers" to "mappedQueries" in "MappingSupportSQLiteQuery" Renamed extension method "SupportSQLiteOpenHelper.Factory.asCacheControlled" to "SupportSQLiteOpenHelper.Factory.asMapped" in "MappingSupportSQLiteDatabase.kt" *This commit is related to issue #529 [1]* [1] #529
Moved "RandomUUIDSQLMappingFunction" from "MappingSupportSQLiteDatabase.kt" to new file "SQLiteCacheControl.kt" Added extension function "SupportSQLiteOpenHelper.Factory.asCacheControlled" in "SQLiteCacheControl.kt" as wrapper for "asMapped" with "RandomUUIDSQLMappingFunction" as mapping function Removed "RandomUUIDSQLMappingFunction" as default mapping function from extension function "SupportSQLiteOpenHelper.Factory.asMapped" in "MappingSupportSQLiteDatabase.kt" Replaced call to "asMapped" with call to "asCacheControlled" in "DatabaseModule" *This commit is related to issue #529 [1]* [1] #529
# Conflicts: # build.gradle
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