package com.framework.mvvm.model.db.dao

import androidx.room.*
import com.framework.mvvm.model.db.entity.ComponentEntity
import com.framework.mvvm.model.db.entity.ConfigEntity

@Dao
interface ComponentDao {
    @Query("select * from component")
    suspend fun getComponents(): List<ComponentEntity>

    @Query("select * from component where id = :id")
    suspend fun getComponentById(id: String): ComponentEntity

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insComponent(vararg comp: ComponentEntity)

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insComponents( comps: List<ComponentEntity>)

    @Delete
    suspend fun delConfig(config: ConfigEntity)
}