package io.nexilis.service.data.daos

import androidx.lifecycle.LiveData
import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import io.nexilis.service.data.entities.*

@Dao
interface LinkPreviewDao {

    @Query("select * from LinkPreview")
    fun getAll(): LiveData<List<LinkPreview>>

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insert(entity: LinkPreview)

    @Query("delete from LinkPreview")
    suspend fun deleteAll()

}