package com.example.timert.data.dao

import androidx.lifecycle.LiveData
import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import com.example.timert.data.entity.Exercise


@Dao
interface ExerciseDao {
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insert(exercise: Exercise)

    @Query("SELECT * FROM exercise_table")
    fun getExercise(): LiveData<List<Exercise>>


    //@Delete
   // suspend fun delete(exercise: Exercise)

    @Query("DELETE FROM exercise_table WHERE id = :id")
    suspend fun deleteById(id: Int)
}