package com.gh.vspace.db

import androidx.room.*

@Dao
interface VArchiveDao {

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insert(archive: VArchiveEntity)

    @Update(onConflict = OnConflictStrategy.REPLACE)
    fun update(archive: VArchiveEntity)

    @Update(onConflict = OnConflictStrategy.REPLACE)
    fun update(archiveList: List<VArchiveEntity>)

    @Delete
    fun delete(archive: VArchiveEntity)

    @Query("DELETE FROM VArchiveEntity")
    fun clearAllArchives()

    @Query("SELECT * FROM VArchiveEntity ORDER BY time desc")
    fun getAll(): List<VArchiveEntity>

}