package com.keypalette.theme.dataabout.database

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.keypalette.theme.dataabout.resource.Data

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

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

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

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


    @Delete
    suspend fun delete(data: Data)

    @Update
    suspend fun updateLike(data: Data)
}