12345678910111213141516171819202122232425 |
- package io.nexilis.service.data.daos
- import androidx.room.Dao
- import androidx.room.Insert
- import androidx.room.OnConflictStrategy
- import androidx.room.Query
- import io.nexilis.service.data.entities.*
- import kotlinx.coroutines.flow.Flow
- @Dao
- interface PrefsDao {
- @Query("select * from Prefs")
- fun getAll(): Flow<List<Prefs>>
- @Query("select * from Prefs where `key` = :key")
- fun get(key: String): Flow<List<Prefs>>
- @Insert(onConflict = OnConflictStrategy.REPLACE)
- suspend fun insert(entity: Prefs)
- @Query("delete from Prefs")
- suspend fun deleteAll()
- }
|