package com.color.keyboard.black.myapi

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.color.keyboard.black.bean.ChildData

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

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

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

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


    @Delete
    suspend fun delete(data: ChildData)

    @Update
    suspend fun updateLike(data: ChildData)
}