Fixed
Status Update
Comments
de...@gmail.com <de...@gmail.com> #2
Also, it would be great to return Observable, cause Flowable has some overhead.
yb...@google.com <yb...@google.com> #3
We are going to add Single for queries (and Maybe) but for @insert, @Update and @Delete it is a bit more tricky because we would be reading those values when the computable runs, in which case developer may change them by mistake. We've not decided whether we want to take that risk or not. (We could copy but that would be additional hidden load, especially if the input is a long list).
#2, flowable can easily turn into an observable, would you like to escalate on why you think the overhead is a problem?
#2, flowable can easily turn into an observable, would you like to escalate on why you think the overhead is a problem?
ji...@gmail.com <ji...@gmail.com> #4
Cool for Single/Maybe for queries :)
For @insert, @Update and @Delete I personally would like to have the possibility to have Single/Maybe... because I will 100% of the time wrap the call into a Single to make it asynchronous and have the possibility to chain other actions with it. I understand that copying entries will take additional resources but in that case we'll have the possibility to not use the RX return type.
That my opinion ^^
Thanks !
For @insert, @Update and @Delete I personally would like to have the possibility to have Single/Maybe... because I will 100% of the time wrap the call into a Single to make it asynchronous and have the possibility to chain other actions with it. I understand that copying entries will take additional resources but in that case we'll have the possibility to not use the RX return type.
That my opinion ^^
Thanks !
ra...@gmail.com <ra...@gmail.com> #5
Shouldn't this be typed as a feature request?
ra...@gmail.com <ra...@gmail.com> #6
la...@x2mobile.net <la...@x2mobile.net> #7
This issue is half year old and it's still not implemented. Without this the library is unusable.
je...@gmail.com <je...@gmail.com> #8
+1
fr...@gmail.com <fr...@gmail.com> #9
+1 Here as well. I would like Completable support.
sh...@gmail.com <sh...@gmail.com> #10
+1 i think Completable support is necessary
do...@gmail.com <do...@gmail.com> #11
+1 for Completable support as well
wh...@gmail.com <wh...@gmail.com> #12
+1 for completable - just missed it on the fly while coding
ej...@gmail.com <ej...@gmail.com> #13
+1 for Completable support as well
vs...@gmail.com <vs...@gmail.com> #14
+1 for completable for @Delete @Update and @Insert
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 :)