package com.haven.wallpapers.room;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;

import java.util.List;

@Dao
public interface ImportDao {
    @Insert
    void insert(ImportEntry importEntry);

    @Delete
    void delete(ImportEntry importEntry);

    @Query("SELECT * FROM image_entry")
    List<ImportEntry> getAllImages();

    @Query("SELECT * FROM image_entry WHERE imagePath = :imagePath LIMIT 1")
    ImportEntry findByPath(String imagePath);

    @Query("DELETE FROM image_entry WHERE imagePath = :imagePath")
    void deleteByPath(String imagePath);
}
