1.2
tj
2025-04-11 27bbd0435881e408f267c99e6a253d2e17873bcc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package com.example.firstapp.database.dao
 
import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.Update
import com.example.firstapp.database.entity.KeywordConfig
import com.example.firstapp.database.entity.KeywordEntity
import io.reactivex.Completable
 
//@Dao
//interface KeywordDao {
//    @Query("SELECT * FROM keywords")
//     fun getAllKeywords(): List<KeywordEntity>
//
//    @Insert(onConflict = OnConflictStrategy.REPLACE)
//    suspend fun insertAll(keywords: List<KeywordEntity>)
//
//
////
////    @Query("DELETE FROM keywords")
////    suspend fun deleteAll()
////
////    @Update
////    suspend fun update(keyword: KeywordEntity)
////
////    @Query("SELECT * FROM keywords WHERE isEnabled = 1")
////     fun getEnabledKeywords(): List<KeywordConfig>
//}
@Dao
interface KeywordDao {
    @Insert(onConflict = OnConflictStrategy.REPLACE)
     fun insertAll(keywords: List<KeywordEntity>)
 
    @Query("SELECT * FROM keywords")
     fun getAllKeywords(): List<KeywordEntity>
 
    @Query("DELETE FROM keywords")
     fun deleteAll(): Completable
}