package com.app.intelligent.board.uidb

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.intelligent.board.uimodel.KeyboardItemInfo

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

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



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


    @Delete
    suspend fun delete(data: KeyboardItemInfo)

    @Update
    suspend fun updateLike(data: KeyboardItemInfo)
}