Fixed
Status Update
Comments
de...@gmail.com <de...@gmail.com> #2
+1, but Deferred does not solve the Observer problem that Rx and LiveData do, so I guess Google should implement Channels instead of LiveData which is actually a Kotlin Coroutine counterpart. Looking forward to this as I've decided not to use RxJava in most of future projects due to Kotlin Coroutines..
yb...@google.com <yb...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-master-dev
commit e78cceffeac28f0028342990c1391c640edf453c
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Wed Nov 28 12:40:24 2018
Room Support for Coroutines
This change allows users to define suspend functions in DAOs with
@Query, @Insert, @Update and @Delete. The new artifact room-coroutine
defines a helper classes for supporting the feature.
Bug: 69474692
Test: ./gradlew room:integration-tests:kotlintestapp:cC
Change-Id: Id73a6b845df3f21f99d14cb6980130dcf3885c81
M buildSrc/src/main/kotlin/androidx/build/PublishDocsRules.kt
A room/compiler/src/main/kotlin/androidx/room/ext/KotlinMetadataElement.kt
D room/compiler/src/main/kotlin/androidx/room/ext/KotlinMetadataProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/ext/element_ext.kt
M room/compiler/src/main/kotlin/androidx/room/ext/javapoet_ext.kt
M room/compiler/src/main/kotlin/androidx/room/processor/DeletionMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/processor/InsertionMethodProcessor.kt
A room/compiler/src/main/kotlin/androidx/room/processor/MethodProcessorDelegate.kt
M room/compiler/src/main/kotlin/androidx/room/processor/PojoProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/processor/ProcessorErrors.kt
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/processor/RawQueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/processor/ShortcutMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/processor/UpdateMethodProcessor.kt
A room/compiler/src/main/kotlin/androidx/room/solver/query/result/CoroutineResultBinder.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
A room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binder/CoroutineDeleteOrUpdateMethodBinder.kt
A room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binder/CoroutineInsertMethodBinder.kt
M room/compiler/src/main/kotlin/androidx/room/solver/shortcut/result/DeleteOrUpdateMethodAdapter.kt
M room/compiler/src/main/kotlin/androidx/room/solver/shortcut/result/InsertMethodAdapter.kt
M room/compiler/src/main/kotlin/androidx/room/vo/RelationCollector.kt
M room/compiler/src/test/kotlin/androidx/room/processor/QueryMethodProcessorTest.kt
A room/coroutines/build.gradle
A room/coroutines/src/main/AndroidManifest.xml
A room/coroutines/src/main/java/androidx/room/CoroutinesRoom.kt
M room/integration-tests/kotlintestapp/build.gradle
M room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/dao/BooksDao.kt
M room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/BooksDaoTest.kt
A room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/SuspendRoomDispatcherTest.kt
M settings.gradle
https://android-review.googlesource.com/833705
https://goto.google.com/android-sha1/e78cceffeac28f0028342990c1391c640edf453c
Branch: androidx-master-dev
commit e78cceffeac28f0028342990c1391c640edf453c
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Wed Nov 28 12:40:24 2018
Room Support for Coroutines
This change allows users to define suspend functions in DAOs with
@Query, @Insert, @Update and @Delete. The new artifact room-coroutine
defines a helper classes for supporting the feature.
Bug: 69474692
Test: ./gradlew room:integration-tests:kotlintestapp:cC
Change-Id: Id73a6b845df3f21f99d14cb6980130dcf3885c81
M buildSrc/src/main/kotlin/androidx/build/PublishDocsRules.kt
A room/compiler/src/main/kotlin/androidx/room/ext/KotlinMetadataElement.kt
D room/compiler/src/main/kotlin/androidx/room/ext/KotlinMetadataProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/ext/element_ext.kt
M room/compiler/src/main/kotlin/androidx/room/ext/javapoet_ext.kt
M room/compiler/src/main/kotlin/androidx/room/processor/DeletionMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/processor/InsertionMethodProcessor.kt
A room/compiler/src/main/kotlin/androidx/room/processor/MethodProcessorDelegate.kt
M room/compiler/src/main/kotlin/androidx/room/processor/PojoProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/processor/ProcessorErrors.kt
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/processor/RawQueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/processor/ShortcutMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/processor/UpdateMethodProcessor.kt
A room/compiler/src/main/kotlin/androidx/room/solver/query/result/CoroutineResultBinder.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
A room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binder/CoroutineDeleteOrUpdateMethodBinder.kt
A room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binder/CoroutineInsertMethodBinder.kt
M room/compiler/src/main/kotlin/androidx/room/solver/shortcut/result/DeleteOrUpdateMethodAdapter.kt
M room/compiler/src/main/kotlin/androidx/room/solver/shortcut/result/InsertMethodAdapter.kt
M room/compiler/src/main/kotlin/androidx/room/vo/RelationCollector.kt
M room/compiler/src/test/kotlin/androidx/room/processor/QueryMethodProcessorTest.kt
A room/coroutines/build.gradle
A room/coroutines/src/main/AndroidManifest.xml
A room/coroutines/src/main/java/androidx/room/CoroutinesRoom.kt
M room/integration-tests/kotlintestapp/build.gradle
M room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/dao/BooksDao.kt
M room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/BooksDaoTest.kt
A room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/SuspendRoomDispatcherTest.kt
M settings.gradle
ji...@gmail.com <ji...@gmail.com> #4
So do you support any Coroutine "observables" like channels? Or these are just one-off suspending calls?
ra...@gmail.com <ra...@gmail.com> #5
For now we'll be just supporting one-off suspend functions in Room 2.1.0-alpha03. Coroutines stream functionality with channels is still a work in progress.
ra...@gmail.com <ra...@gmail.com> #6
Relating to the original request, how about allowing a return type of Deferred<LiveData<T>> which suspends until LiveData<T>'s value has been set the first time?
la...@x2mobile.net <la...@x2mobile.net> #7
I just tested out Room 2.1.0-alpha03 and added suspend to all of my functions.... there appears to be an issue with functions that use @Query() and UPDATE and DELETE queries. Examples:
Code Example 1:
@Query("DELETE FROM individual")
suspend fun deleteAll()
Error:
Deletion methods must either return void or return int (the number of deleted rows).
Code Example 2:
@Query("UPDATE individual SET firstName = :firstName WHERE id = :id")
suspend fun updateFirstName(id: Long, firstName: String)
Error:
Not sure how to convert a Cursor to this method's return type (kotlin.Unit).
Code Example 1:
@Query("DELETE FROM individual")
suspend fun deleteAll()
Error:
Deletion methods must either return void or return int (the number of deleted rows).
Code Example 2:
@Query("UPDATE individual SET firstName = :firstName WHERE id = :id")
suspend fun updateFirstName(id: Long, firstName: String)
Error:
Not sure how to convert a Cursor to this method's return type (kotlin.Unit).
je...@gmail.com <je...@gmail.com> #8
Async return types with @Query that perform UPDATE, DELETE or INSERT are not yet supported. This also applies to coroutines. We are actively working on adding this for the next alpha of 2.1.0. Subscribe to the bug for updates: https://issuetracker.google.com/issues/120227284
fr...@gmail.com <fr...@gmail.com> #9
Hello.
Any updates on returning Channel<T> from DAO?
Will contributions be accepted for that feature?
Any updates on returning Channel<T> from DAO?
Will contributions be accepted for that feature?
sh...@gmail.com <sh...@gmail.com> #10
Channels are experimental right now so we probably want to wait until it is stable.
do...@gmail.com <do...@gmail.com> #11
Channels +1
wh...@gmail.com <wh...@gmail.com> #12
Marking as fix since core coroutines are supported in 2.1, in the mean time we'll keep an eye on the Channels API to potentially support it once its upgraded out of experimental. https://issuetracker.google.com/issues/127328278
ej...@gmail.com <ej...@gmail.com> #13
Is it expected that we still have to ensure that suspended functions aren't dispatched from the main thread?
The first call (eg `final SupportSQLiteStatement _stmt = __preparedStmtOfDeleteAll.acquire();`) is not wrapped in a callable and can't be done on the ui thread, so we still have to wrap suspensions with our own context.
The first call (eg `final SupportSQLiteStatement _stmt = __preparedStmtOfDeleteAll.acquire();`) is not wrapped in a callable and can't be done on the ui thread, so we still have to wrap suspensions with our own context.
vs...@gmail.com <vs...@gmail.com> #14
Kotlinx.coroutines 1.2 released with cold stream abstraction Flow:
https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html
It's in "preview" status, but maybe we also could expect some experimental version of Room with Flow support for observable requests
It's in "preview" status, but maybe we also could expect some experimental version of Room with Flow support for observable requests
lo...@gmail.com <lo...@gmail.com> #15
+1 for Completable support as well
56...@gmail.com <56...@gmail.com> #16
Please Give a star instead of adding new comments.
ju...@gmail.com <ju...@gmail.com> #17
This would be a nice improvement!
My initial response is to wrap the insert in a Completable when exposing the call to a consumer because of the time spent writing to the file system on the main thread. Guessing would probably desire the same API for delete.
Out of the box without LiveData/RxJava support for those types of calls it would violate strict rules and run into the guards of Room ensures that database is never accessed on the main thread.
My initial response is to wrap the insert in a Completable when exposing the call to a consumer because of the time spent writing to the file system on the main thread. Guessing would probably desire the same API for delete.
Out of the box without LiveData/RxJava support for those types of calls it would violate strict rules and run into the guards of Room ensures that database is never accessed on the main thread.
fo...@gmail.com <fo...@gmail.com> #18
It's really necessary thing and it's not implemented still(
sh...@gmail.com <sh...@gmail.com> #19
+1 Come on we need support for completable. its been more than an year :(
yb...@google.com <yb...@google.com> #20
we are targeting this for 2.1.
bo...@li.ru <bo...@li.ru> #21
+1 for completable for @Delete @Update and @Insert
ai...@gmail.com <ai...@gmail.com> #22
+1 Come on guys!! ^_^
ap...@google.com <ap...@google.com> #23
Project: platform/frameworks/support
Branch: androidx-master-dev
commit c0c36b71b1e73eeaa49e5f29c2e3ee3923c811da
Author: Florina Muntenescu <florinam@google.com>
Date: Wed Aug 15 10:49:18 2018
Refactoring insert/update/delete to allow extensibility around the return type
Bug: 63317956
Test: tests updated
Change-Id: I5f8168fbd5cf08e64cb80c1835f4eebef6b4e018
M room/compiler/src/main/kotlin/androidx/room/processor/DeletionMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/processor/InsertionMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/processor/ProcessorErrors.kt
M room/compiler/src/main/kotlin/androidx/room/processor/UpdateMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
A room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binder/DeleteOrUpdateMethodBinder.kt
A room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binder/InsertMethodBinder.kt
A room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binder/InstantDeleteOrUpdateMethodBinder.kt
A room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binder/InstantInsertMethodBinder.kt
A room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binderprovider/DeleteOrUpdateMethodBinderProvider.kt
A room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binderprovider/InsertMethodBinderProvider.kt
A room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binderprovider/InstantDeleteOrUpdateMethodBinderProvider.kt
A room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binderprovider/InstantInsertMethodBinderProvider.kt
A room/compiler/src/main/kotlin/androidx/room/solver/shortcut/result/DeleteOrUpdateMethodAdapter.kt
A room/compiler/src/main/kotlin/androidx/room/solver/shortcut/result/InsertMethodAdapter.kt
M room/compiler/src/main/kotlin/androidx/room/vo/DeletionMethod.kt
M room/compiler/src/main/kotlin/androidx/room/vo/InsertionMethod.kt
M room/compiler/src/main/kotlin/androidx/room/vo/ShortcutMethod.kt
M room/compiler/src/main/kotlin/androidx/room/vo/UpdateMethod.kt
M room/compiler/src/main/kotlin/androidx/room/writer/DaoWriter.kt
M room/compiler/src/test/kotlin/androidx/room/processor/DeletionMethodProcessorTest.kt
M room/compiler/src/test/kotlin/androidx/room/processor/InsertionMethodProcessorTest.kt
M room/compiler/src/test/kotlin/androidx/room/processor/UpdateMethodProcessorTest.kt
M room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/dao/BooksDao.kt
https://android-review.googlesource.com/732628
https://goto.google.com/android-sha1/c0c36b71b1e73eeaa49e5f29c2e3ee3923c811da
Branch: androidx-master-dev
commit c0c36b71b1e73eeaa49e5f29c2e3ee3923c811da
Author: Florina Muntenescu <florinam@google.com>
Date: Wed Aug 15 10:49:18 2018
Refactoring insert/update/delete to allow extensibility around the return type
Bug: 63317956
Test: tests updated
Change-Id: I5f8168fbd5cf08e64cb80c1835f4eebef6b4e018
M room/compiler/src/main/kotlin/androidx/room/processor/DeletionMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/processor/InsertionMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/processor/ProcessorErrors.kt
M room/compiler/src/main/kotlin/androidx/room/processor/UpdateMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
A room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binder/DeleteOrUpdateMethodBinder.kt
A room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binder/InsertMethodBinder.kt
A room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binder/InstantDeleteOrUpdateMethodBinder.kt
A room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binder/InstantInsertMethodBinder.kt
A room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binderprovider/DeleteOrUpdateMethodBinderProvider.kt
A room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binderprovider/InsertMethodBinderProvider.kt
A room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binderprovider/InstantDeleteOrUpdateMethodBinderProvider.kt
A room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binderprovider/InstantInsertMethodBinderProvider.kt
A room/compiler/src/main/kotlin/androidx/room/solver/shortcut/result/DeleteOrUpdateMethodAdapter.kt
A room/compiler/src/main/kotlin/androidx/room/solver/shortcut/result/InsertMethodAdapter.kt
M room/compiler/src/main/kotlin/androidx/room/vo/DeletionMethod.kt
M room/compiler/src/main/kotlin/androidx/room/vo/InsertionMethod.kt
M room/compiler/src/main/kotlin/androidx/room/vo/ShortcutMethod.kt
M room/compiler/src/main/kotlin/androidx/room/vo/UpdateMethod.kt
M room/compiler/src/main/kotlin/androidx/room/writer/DaoWriter.kt
M room/compiler/src/test/kotlin/androidx/room/processor/DeletionMethodProcessorTest.kt
M room/compiler/src/test/kotlin/androidx/room/processor/InsertionMethodProcessorTest.kt
M room/compiler/src/test/kotlin/androidx/room/processor/UpdateMethodProcessorTest.kt
M room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/dao/BooksDao.kt
ap...@google.com <ap...@google.com> #24
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 524c841aa2bec6fa72768b1aeb40f6c6b6734907
Author: Florina Muntenescu <florinam@google.com>
Date: Mon Sep 03 16:37:48 2018
Adding RxJava support to insert
Bug: 63317956
Change-Id: Ic122774f591319dcd70d7f362af94adb0342184b
Test: InsertionMethodProcessorTest and TypeAdapterStoreTest updated
M room/compiler/src/main/kotlin/androidx/room/ext/javapoet_ext.kt
M room/compiler/src/main/kotlin/androidx/room/processor/InsertionMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/processor/ProcessorErrors.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
A room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binder/RxCallableInsertMethodBinder.kt
M room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binderprovider/InsertMethodBinderProvider.kt
M room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binderprovider/InstantInsertMethodBinderProvider.kt
A room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binderprovider/RxCallableInsertMethodBinderProvider.kt
M room/compiler/src/main/kotlin/androidx/room/solver/shortcut/result/InsertMethodAdapter.kt
A room/compiler/src/test/data/common/input/rxjava2/Completable.java
A room/compiler/src/test/data/common/input/rxjava2/Maybe.java
A room/compiler/src/test/data/common/input/rxjava2/Single.java
M room/compiler/src/test/kotlin/androidx/room/processor/InsertionMethodProcessorTest.kt
M room/compiler/src/test/kotlin/androidx/room/solver/TypeAdapterStoreTest.kt
M room/compiler/src/test/kotlin/androidx/room/testing/test_util.kt
M room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/dao/BooksDao.kt
https://android-review.googlesource.com/745108
https://goto.google.com/android-sha1/524c841aa2bec6fa72768b1aeb40f6c6b6734907
Branch: androidx-master-dev
commit 524c841aa2bec6fa72768b1aeb40f6c6b6734907
Author: Florina Muntenescu <florinam@google.com>
Date: Mon Sep 03 16:37:48 2018
Adding RxJava support to insert
Bug: 63317956
Change-Id: Ic122774f591319dcd70d7f362af94adb0342184b
Test: InsertionMethodProcessorTest and TypeAdapterStoreTest updated
M room/compiler/src/main/kotlin/androidx/room/ext/javapoet_ext.kt
M room/compiler/src/main/kotlin/androidx/room/processor/InsertionMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/processor/ProcessorErrors.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
A room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binder/RxCallableInsertMethodBinder.kt
M room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binderprovider/InsertMethodBinderProvider.kt
M room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binderprovider/InstantInsertMethodBinderProvider.kt
A room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binderprovider/RxCallableInsertMethodBinderProvider.kt
M room/compiler/src/main/kotlin/androidx/room/solver/shortcut/result/InsertMethodAdapter.kt
A room/compiler/src/test/data/common/input/rxjava2/Completable.java
A room/compiler/src/test/data/common/input/rxjava2/Maybe.java
A room/compiler/src/test/data/common/input/rxjava2/Single.java
M room/compiler/src/test/kotlin/androidx/room/processor/InsertionMethodProcessorTest.kt
M room/compiler/src/test/kotlin/androidx/room/solver/TypeAdapterStoreTest.kt
M room/compiler/src/test/kotlin/androidx/room/testing/test_util.kt
M room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/dao/BooksDao.kt
ap...@google.com <ap...@google.com> #25
Project: platform/frameworks/support
Branch: androidx-master-dev
commit ecce72935bbe7987a9c0c1639f4aa245153c717a
Author: Florina Muntenescu <florinam@google.com>
Date: Fri Sep 07 15:36:18 2018
Add RxJava support for Delete and Update methods in Room.
Support for update and delete returning Integer also added.
Now, update and delete support:
* void
* int
* Integer
* Completable
* Single<Integer>
* Maybe<Integer>
Refactored the DeleteOrUpdateMethodAdapter to hold the return type, like InsertMethodAdapter is.
Bug: 63317956
Test: DaoWriterTest, TypeAdapterStoreTest, kotlin integration tests
Change-Id: Ic8d3cff21b9e8179fed237a18421c13b3e59059b
M room/compiler/src/main/kotlin/androidx/room/processor/DeletionMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/processor/UpdateMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binder/DeleteOrUpdateMethodBinder.kt
M room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binder/InstantDeleteOrUpdateMethodBinder.kt
A room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binder/RxCallableDeleteOrUpdateMethodBinder.kt
M room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binderprovider/DeleteOrUpdateMethodBinderProvider.kt
M room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binderprovider/InstantDeleteOrUpdateMethodBinderProvider.kt
A room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binderprovider/RxCallableDeleteOrUpdateMethodBinderProvider.kt
M room/compiler/src/main/kotlin/androidx/room/solver/shortcut/result/DeleteOrUpdateMethodAdapter.kt
M room/compiler/src/main/kotlin/androidx/room/vo/DeletionMethod.kt
M room/compiler/src/main/kotlin/androidx/room/vo/ShortcutMethod.kt
M room/compiler/src/main/kotlin/androidx/room/vo/UpdateMethod.kt
M room/compiler/src/main/kotlin/androidx/room/writer/DaoWriter.kt
M room/compiler/src/test/data/common/input/rxjava2/Completable.java
M room/compiler/src/test/data/common/input/rxjava2/Maybe.java
M room/compiler/src/test/data/common/input/rxjava2/Single.java
M room/compiler/src/test/data/daoWriter/input/DeletionDao.java
M room/compiler/src/test/data/daoWriter/input/UpdateDao.java
M room/compiler/src/test/data/daoWriter/output/DeletionDao.java
M room/compiler/src/test/data/daoWriter/output/UpdateDao.java
M room/compiler/src/test/kotlin/androidx/room/processor/ShortcutMethodProcessorTest.kt
M room/compiler/src/test/kotlin/androidx/room/solver/TypeAdapterStoreTest.kt
M room/compiler/src/test/kotlin/androidx/room/writer/DaoWriterTest.kt
M room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/dao/BooksDao.kt
https://android-review.googlesource.com/750573
https://goto.google.com/android-sha1/ecce72935bbe7987a9c0c1639f4aa245153c717a
Branch: androidx-master-dev
commit ecce72935bbe7987a9c0c1639f4aa245153c717a
Author: Florina Muntenescu <florinam@google.com>
Date: Fri Sep 07 15:36:18 2018
Add RxJava support for Delete and Update methods in Room.
Support for update and delete returning Integer also added.
Now, update and delete support:
* void
* int
* Integer
* Completable
* Single<Integer>
* Maybe<Integer>
Refactored the DeleteOrUpdateMethodAdapter to hold the return type, like InsertMethodAdapter is.
Bug: 63317956
Test: DaoWriterTest, TypeAdapterStoreTest, kotlin integration tests
Change-Id: Ic8d3cff21b9e8179fed237a18421c13b3e59059b
M room/compiler/src/main/kotlin/androidx/room/processor/DeletionMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/processor/UpdateMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binder/DeleteOrUpdateMethodBinder.kt
M room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binder/InstantDeleteOrUpdateMethodBinder.kt
A room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binder/RxCallableDeleteOrUpdateMethodBinder.kt
M room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binderprovider/DeleteOrUpdateMethodBinderProvider.kt
M room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binderprovider/InstantDeleteOrUpdateMethodBinderProvider.kt
A room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binderprovider/RxCallableDeleteOrUpdateMethodBinderProvider.kt
M room/compiler/src/main/kotlin/androidx/room/solver/shortcut/result/DeleteOrUpdateMethodAdapter.kt
M room/compiler/src/main/kotlin/androidx/room/vo/DeletionMethod.kt
M room/compiler/src/main/kotlin/androidx/room/vo/ShortcutMethod.kt
M room/compiler/src/main/kotlin/androidx/room/vo/UpdateMethod.kt
M room/compiler/src/main/kotlin/androidx/room/writer/DaoWriter.kt
M room/compiler/src/test/data/common/input/rxjava2/Completable.java
M room/compiler/src/test/data/common/input/rxjava2/Maybe.java
M room/compiler/src/test/data/common/input/rxjava2/Single.java
M room/compiler/src/test/data/daoWriter/input/DeletionDao.java
M room/compiler/src/test/data/daoWriter/input/UpdateDao.java
M room/compiler/src/test/data/daoWriter/output/DeletionDao.java
M room/compiler/src/test/data/daoWriter/output/UpdateDao.java
M room/compiler/src/test/kotlin/androidx/room/processor/ShortcutMethodProcessorTest.kt
M room/compiler/src/test/kotlin/androidx/room/solver/TypeAdapterStoreTest.kt
M room/compiler/src/test/kotlin/androidx/room/writer/DaoWriterTest.kt
M room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/dao/BooksDao.kt
fl...@google.com <fl...@google.com> #26
Support for Single, Maybe and Completable added for insert, update and delete. To be released in Room 2.1
vf...@thoughtworks.com <vf...@thoughtworks.com> #27
When is Room 2.1 going to be released?
Description
Version used: 1.0.0alpha3
Devices/Android versions reproduced on: all
After using Room and RxRoom I was lacking of some functionalities like the ability to return an Single/Completable from insert queries.
For example something like this would be super helpful :
@Insert(onConflict = OnConflictStrategy.REPLACE)
Completable insertAll(CatalogEntry... entries);
@Insert(onConflict = OnConflictStrategy.REPLACE)
Single<Long> insertAll(CatalogEntry... entries);
@Insert(onConflict = OnConflictStrategy.REPLACE)
Single<List<Long>> insertAll(CatalogEntry... entries);
Also when doing a query for retrieving a list, why should I use Flowable, if I just want to get a list my query should be like:
@Query("SELECT * FROM catalog_entries")
Single<List<CatalogEntry>> getAll();
Thanks for your work ! I love it already :)