Skip to content

Commit

Permalink
Update Room to 2.1.0-alpha05
Browse files Browse the repository at this point in the history
  • Loading branch information
ricknout committed Mar 13, 2019
1 parent 87c4664 commit 9506e30
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
6 changes: 4 additions & 2 deletions build.gradle
Expand Up @@ -18,7 +18,7 @@ buildscript {
emoji: '1.0.0',
browser: '1.0.0',
lifecycle: '2.1.0-alpha02',
room: '2.1.0-alpha04',
room: '2.1.0-alpha05',
paging: '2.1.0',
navigation: '2.0.0-rc02',
work: '2.0.0-rc01',
Expand Down Expand Up @@ -76,7 +76,7 @@ buildscript {
room: [
runtime: "androidx.room:room-runtime:$versions.androidX.room",
compiler: "androidx.room:room-compiler:$versions.androidX.room",
coroutines: "androidx.room:room-coroutines:$versions.androidX.room"
ktx: "androidx.room:room-ktx:$versions.androidX.room"
],
paging: [
runtimeKtx: "androidx.paging:paging-runtime-ktx:$versions.androidX.paging"
Expand Down Expand Up @@ -136,6 +136,8 @@ allprojects {
repositories {
google()
jcenter()
// For Room 2.1.0-alpha05: https://youtrack.jetbrains.com/issue/KT-27991
maven { url "https://kotlin.bintray.com/kotlinx/" }
}
apply from: "$rootDir/ktlint.gradle"
}
Expand Down
2 changes: 1 addition & 1 deletion core/build.gradle
Expand Up @@ -27,7 +27,7 @@ dependencies {
api deps.androidX.emoji.bundled
api deps.androidX.lifecycle.extensions
api deps.androidX.room.runtime
api deps.androidX.room.coroutines
api deps.androidX.room.ktx
api deps.androidX.paging.runtimeKtx
api deps.androidX.navigation.uiKtx
api deps.androidX.navigation.fragmentKtx
Expand Down
Expand Up @@ -15,14 +15,10 @@ interface WorldRugbyMatchDao {
@Insert(onConflict = OnConflictStrategy.REPLACE)
suspend fun insert(worldRugbyMatches: List<WorldRugbyMatch>)

// BUG: Using arg0, arg1, arg2 because of issue with DataSource.Factory
// https://issuetracker.google.com/issues/119738980
@Query("SELECT * FROM world_rugby_matches WHERE eventSport = :arg0 AND status = :arg1 AND timeMillis > :arg2 ORDER BY timeMillis ASC")
@Query("SELECT * FROM world_rugby_matches WHERE eventSport = :sport AND status = :matchStatus AND timeMillis > :millis ORDER BY timeMillis ASC")
fun loadAsc(sport: Sport, matchStatus: MatchStatus, millis: Long): DataSource.Factory<Int, WorldRugbyMatch>

// BUG: Using arg0, arg1, arg2 because of issue with DataSource.Factory
// https://issuetracker.google.com/issues/119738980
@Query("SELECT * FROM world_rugby_matches WHERE eventSport = :arg0 AND status = :arg1 AND timeMillis < :arg2 ORDER BY timeMillis DESC")
@Query("SELECT * FROM world_rugby_matches WHERE eventSport = :sport AND status = :matchStatus AND timeMillis < :millis ORDER BY timeMillis DESC")
fun loadDesc(sport: Sport, matchStatus: MatchStatus, millis: Long): DataSource.Factory<Int, WorldRugbyMatch>

@Query("SELECT EXISTS(SELECT * FROM world_rugby_matches WHERE timeMillis > :startMillis AND timeMillis < :endMillis)")
Expand Down

0 comments on commit 9506e30

Please sign in to comment.