package com.blue.running.keyboard.run_api

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

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

    @Query("select * from ChildData ")
     fun queryAllLike(): LiveData<List<com.blue.running.keyboard.run_jsonbean.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 ): com.blue.running.keyboard.run_jsonbean.ChildData?


    @Delete
    suspend fun delete(data: com.blue.running.keyboard.run_jsonbean.ChildData)

    @Update
    suspend fun updateLike(data: com.blue.running.keyboard.run_jsonbean.ChildData)
}