package com.divya.keyspeed.data

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.Query
import kotlinx.coroutines.flow.Flow

@Dao
interface HistoryDao {
    @Insert
    suspend fun insertResult(result: TypingHistory)

    @Query("SELECT * FROM typing_history ORDER BY timestamp DESC")
    fun getAllHistory(): Flow<List<TypingHistory>>

    @Query("DELETE FROM typing_history")
    suspend fun clearHistory()
}
