package com.keyboard.themes.key.db

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 androidx.room.Update
import com.keyboard.themes.key.data.MyData

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

    @Query("select * from MyData ")
     fun queryAllLike(): LiveData<List<MyData?>?>

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

    @Query("select * from MyData  where titleName = :title ")
    suspend fun queryIsLike(title: String ): MyData?


    @Delete
    suspend fun delete(data: MyData)

    @Update
    suspend fun updateLike(data: MyData)
}