package com.rich.keyboard.skin.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.rich.keyboard.skin.localdata.Child

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

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

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

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


    @Delete
    suspend fun delete(data: Child)

    @Update
    suspend fun updateLike(data: Child)
}