

package com.keyboard.craft.db

import androidx.room.*
import com.keyboard.craft.bean.ItemDataBean

@Dao
interface LocalLikeDao {

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insertItemDataBeanFile(barcode: ItemDataBean)

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insertItemDataBeanFiles(itemDataBeans: List<ItemDataBean>)

    @Query("SELECT * FROM ItemDataBean")
    suspend fun getAllItemDataBeanFile(): List<ItemDataBean>

    @Delete
    suspend fun deleteItemDataBeanFile(barcode: ItemDataBean)

    @Query("DELETE FROM ItemDataBean")
    suspend fun deleteAllItemDataBeanFile()

    @Update
    suspend fun updateItemDataBeanFile(itemDataBean: ItemDataBean)

    @Query("SELECT * FROM ItemDataBean WHERE `key` = :path LIMIT 1")
    suspend fun getItemDataBeanFileByPath(path: String): ItemDataBean?
}
