Closed KpStP closed 6 years ago
This test validates that an empty list is emitted when there are no rows: https://github.com/square/sqlbrite/blob/dae34762ca41f532094433c3ac1e515865e74754/sqlbrite/src/androidTest/java/com/squareup/sqlbrite3/QueryTest.java#L175-L180
If you think there is a bug, please create a failing test case.
The problem cause by other place in my code. Sorry for my careless.
When result set is 0 row, mapToList method will not emit item. That mean the result set is empty at the beginning or non-empty result set change to empty, the method will not emit item too.
I want emit a empty array to trigger observer when result set is empty. If only want transform a single row query, that can use mapToOneOrDefault, but if want to transform a query to a list, there is no method to do this. I can solve the first case by using concat operator to combine empty array observable and query observable, look like this: Flowable.concat(emptyArrayFlowable, queryFlowable), but that can't solve the second case. Is there have approach to solve both case?
Thanks in advance.