@Entity data class Dog ( @PrimaryKey val name: String, val cuteness: Int, val barkingVolume: Int )
@Query("SELECT * FROM Dog") fun getAllDogs(): List<Dog>
@Query("SELECT * FROM Dog") fun getAllDogs(): Flow<List<Dog>>
(Frida, 11, 3)
(Bandit, 12, 5)
[(Frida, 11, 3), (Bandit, 12, 5)]
[(Frida, 11, 3), (Bandit, 12, 6)]
@Query("SELECT * FROM Dog WHERE name = :name") fun getDog(name: String): Flow<Dog>
@Dao abstract class DoggosDao {
@Query("SELECT * FROM Dog WHERE name = :name") abstract fun getDog(name: String): Flow<Dog>
fun getDogDistinctUntilChanged(name:String) = getDog(name).distinctUntilChanged() }