Created
October 20, 2020 22:03
-
-
Save TorkelV/3c866f8f04569947df4c7afb96addf59 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Database(entities = [Phrase::class, Group::class]) | |
abstract class PhraseDatabase : RoomDatabase() { | |
abstract fun phraseDao(): PhraseDao | |
} | |
@Dao | |
interface PhraseDao { | |
@Query("SELECT * FROM phrases WHERE `group` = :groupId") | |
fun getAll(groupId: String): Flow<List<Phrase>> | |
@Insert | |
fun insertAll(vararg phrases: Phrase) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment