package com.sound.prankparty.Room;

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

import java.util.List;

@Dao
public interface FavoriteSoundsDao {

    @Insert
    void insertSound(FavoriteSounds sound);

    @Query("SELECT * FROM favorite_sounds")
    List<FavoriteSounds> getAllSounds();

    @Query("SELECT * FROM favorite_sounds")
    LiveData<List<FavoriteSounds>> getAllSoundsLiveData();

    @Query("SELECT * FROM favorite_sounds WHERE path = :path")
    FavoriteSounds getByPath(String path);

    @Delete
    void delete(FavoriteSounds sound);
}
