package com.apps.quicksketchtrace.database

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query

@Dao
interface UploadDao {
    @Insert(onConflict = OnConflictStrategy.IGNORE)
    suspend fun insert(upload: Upload)

    @Query("SELECT * FROM upload")
    suspend fun getAll(): List<Upload>

    @Query("SELECT * FROM upload WHERE path=:path")
    suspend fun selectByPath(path: String): Upload?

    @Query("DELETE FROM upload WHERE path=:path")
    suspend fun deleteByPath(path: String)
}