package com.gh.gamecenter.room.dao

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

@Dao
interface GamesCollectionDao {

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun addGamesCollection(gamesCollection: GamesCollectionEntity)

    @Query("select * from GamesCollectionEntity order by orderTag desc limit :pageSize offset :offset")
    fun getGamesCollectionWithOffset(pageSize: Int, offset: Int): Single<MutableList<GamesCollectionEntity>>

    @Delete
    fun deleteGamesCollection(gamesCollection: GamesCollectionEntity)
}