package io.nexilis.service.data.daos

import androidx.lifecycle.LiveData
import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import io.nexilis.service.data.entities.*

@Dao
interface ServiceBankDao {

    @Query("select * from ServiceBank")
    fun getAll(): LiveData<List<ServiceBank>>

    @Query("select * from ServiceBank where service_id = :id")
    fun get(id: String): LiveData<List<ServiceBank>>

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insert(entity: ServiceBank)

    @Query("delete from ServiceBank")
    suspend fun deleteAll()

}