1package com.pdelong.speedwagon23import androidx.room.Dao4import androidx.room.Insert5import androidx.room.Query6import kotlinx.coroutines.flow.Flow78@Dao9interface LocationReadingDao {10 @Query("SELECT * FROM readings")11 suspend fun getAll(): List<LocationReading>1213 @Insert14 suspend fun insert(vararg locations: LocationReading)1516 @Query("SELECT AVG(speed) AS avg, MAX(speed) AS max FROM readings WHERE recording_id = :recordingId")17 suspend fun recordingStats(recordingId: Long): RecordingStats1819 @Query("SELECT * FROM readings WHERE recording_id = :recordingId ORDER BY timestamp DESC LIMIT 1")20 fun latestForRecording(recordingId: Long): Flow<LocationReading?>21}