Add drawer menu with flat structure, unified panel styling, Room/SQLCipher setup
This commit is contained in:
parent
21505aae75
commit
7eadec669c
45 changed files with 1378 additions and 18 deletions
22
app/src/main/java/com/mistral/chat/data/SettingDao.kt
Normal file
22
app/src/main/java/com/mistral/chat/data/SettingDao.kt
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
package com.mistral.chat.data
|
||||
|
||||
import androidx.room.*
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
|
||||
@Dao
|
||||
interface SettingDao {
|
||||
@Query("SELECT * FROM settings WHERE `key` = :key")
|
||||
suspend fun getSetting(key: String): Setting?
|
||||
|
||||
@Query("SELECT value FROM settings WHERE `key` = :key")
|
||||
suspend fun getValue(key: String): String?
|
||||
|
||||
@Query("SELECT value FROM settings WHERE `key` = :key")
|
||||
fun getValueFlow(key: String): Flow<String?>
|
||||
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
suspend fun insert(setting: Setting)
|
||||
|
||||
@Query("DELETE FROM settings WHERE `key` = :key")
|
||||
suspend fun delete(key: String)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue