0

let us say I have //roomdb

@Query("SELECT * FROM Dog")
fun getAllDogs(): Flow<List<Dog>>

// getDogDetails

suspend fun getDogDetils(id:Int) :DogDetails

I want to hit endpoint to get dog details, however room,sqldelight return Flow<List> as Oneshot, I want to call getDogDetils for all dogs async and return the result as Flow<List<DogDetails>>

العبد
  • 359
  • 5
  • 15

1 Answers1

0

It would be easy if you share more details about entity of Dog or schema of your table

Saba Zafar
  • 31
  • 3
  • https://medium.com/androiddevelopers/room-flow-273acffe5b57 I use the dog model from androiddevelopers example – العبد Aug 04 '22 at 19:08
  • @العبد in document there is no schema of DogDetails, and this query @Query("SELECT * FROM Dog") itself returning all dog list containing details of dog. I don't think you need another object for details of dog, you can extract from the same list. you can still write more details of your usecase. – Saba Zafar Aug 05 '22 at 08:02