package com.gh.vspace.db

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

@Dao
interface VArchiveDao {

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

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

    @Delete
    fun delete(archive: VArchiveEntity)

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

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

}