package com.gh.vspace.db

import androidx.lifecycle.LiveData
import androidx.room.*

@Dao
interface VGameDao {

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insert(game: VGameEntity)

    @Query("SELECT * FROM v_game")
    fun getAll(): List<VGameEntity>

    @Query("SELECT * FROM v_game")
    fun getAllLiveData(): LiveData<List<VGameEntity>>

    @Delete
    fun delete(gameList: List<VGameEntity>)

    @Delete
    fun delete(game: VGameEntity)

    @Query("DELETE FROM v_game WHERE packageName = :packageName")
    fun delete(packageName: String)

}