forked from agzam/vyatsu-schedule
19 lines
505 B
Kotlin
19 lines
505 B
Kotlin
package agzam.vyatsu.data.local
|
|||
|
|
|
||
|
|
import androidx.room.Dao
|
||
|
|
import androidx.room.Query
|
||
|
|
|
||
|
|
@Dao
|
||
|
|
interface PreferencesDao {
|
||
|
|
@Query("SELECT value FROM preferences WHERE key = 'selectedGroupId'")
|
||
|
|
suspend fun selectedGroupId(): String?
|
||
|
|
|
||
|
|
@Query(
|
||
|
|
"INSERT OR REPLACE INTO preferences(key, value) VALUES('selectedGroupId', :groupId)"
|
||
|
|
)
|
||
|
|
suspend fun setSelectedGroup(groupId: String)
|
||
|
|
|
||
|
|
@Query("DELETE FROM preferences WHERE key = 'selectedGroupId'")
|
||
|
|
suspend fun clearSelectedGroup()
|
||
|
|
}
|