package com.key.board.journey.inputmethod.mydata

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.key.board.journey.inputmethod.data.ChildBean

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

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

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

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


    @Delete
    suspend fun delete(data: ChildBean)

    @Update
    suspend fun updateLike(data: ChildBean)
}