package com.gh.gamecenter.room.dao

import androidx.room.*
import com.gh.gamecenter.entity.HistoryGameEntity
import io.reactivex.Single

@Dao
interface GameDao {

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun addGame(game: HistoryGameEntity)

    @Query("select * from HistoryGameEntity order by orderTag desc limit :pageSize offset :offset ")
    fun getGamesWithOffset(pageSize: Int, offset: Int): Single<List<HistoryGameEntity>>

    @Delete
    fun deleteGame(game: HistoryGameEntity)

}
