Merge pull request #264 from zohrevand/bugfix-populated-queries-not-transactional

Add Transaction annotation to queries with populated return type
pull/267/head
Milosz Moczkowski 2 years ago committed by GitHub
commit 24d107c147
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -32,6 +32,7 @@ import kotlinx.coroutines.flow.Flow
*/ */
@Dao @Dao
interface EpisodeDao { interface EpisodeDao {
@Transaction
@Query(value = "SELECT * FROM episodes") @Query(value = "SELECT * FROM episodes")
fun getEpisodesStream(): Flow<List<PopulatedEpisode>> fun getEpisodesStream(): Flow<List<PopulatedEpisode>>

@ -34,6 +34,7 @@ import kotlinx.coroutines.flow.Flow
*/ */
@Dao @Dao
interface NewsResourceDao { interface NewsResourceDao {
@Transaction
@Query( @Query(
value = """ value = """
SELECT * FROM news_resources SELECT * FROM news_resources
@ -42,6 +43,7 @@ interface NewsResourceDao {
) )
fun getNewsResourcesStream(): Flow<List<PopulatedNewsResource>> fun getNewsResourcesStream(): Flow<List<PopulatedNewsResource>>
@Transaction
@Query( @Query(
value = """ value = """
SELECT * FROM news_resources SELECT * FROM news_resources

Loading…
Cancel
Save