package com.app.input.color.board.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.app.input.color.board.bean.BeanDetails

@Dao
interface BeanDetailsDao {
    @Insert(onConflict = OnConflictStrategy.Companion.IGNORE)
    suspend fun insertData(data: BeanDetails): Long

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

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

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


    @Delete
    suspend fun delete(data: BeanDetails)

    @Update
    suspend fun updateLike(data: BeanDetails)
}