package com.themes.fancy.keyboard.keyboard.myroom

import androidx.lifecycle.LiveData
import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import com.themes.fancy.keyboard.keyboard.data.KbSource

@Dao
interface ThemesDao1 {
    @Insert(onConflict = OnConflictStrategy.IGNORE)
    suspend fun insertData(data: KbSource): Long

    @Query("select * from KbSource where `like` = :isLike")
     fun queryAllLike(isLike: Boolean = true): LiveData<List<KbSource?>?>

    @Query("select * from KbSource where `download` = :idDownload")
     fun queryAllDownload(idDownload: Boolean = true): LiveData<List<KbSource?>?>

    @Query("select * from KbSource  where titleName = :title And  `like` = :isLike")
    suspend fun queryIsLike(title: String, isLike: Boolean = true): KbSource?


    @Delete
    suspend fun delete(data: KbSource)
}