package com.gh.vspace.db

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import kotlinx.coroutines.flow.Flow

@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 getAllGames(): Flow<List<VGameEntity>>

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

}