Refactor weather module

This commit is contained in:
MM20
2023-12-22 00:25:41 +01:00
parent bba805ccd6
commit eb1123ab73
21 changed files with 734 additions and 882 deletions
@@ -6,8 +6,8 @@ import kotlinx.coroutines.flow.Flow
@Dao
interface WeatherDao {
@Query("SELECT * FROM ${ForecastEntity.TABLE_NAME} ORDER BY timestamp ASC")
fun getForecasts(): Flow<List<ForecastEntity>>
@Query("SELECT * FROM ${ForecastEntity.TABLE_NAME} ORDER BY timestamp ASC LIMIT :limit")
fun getForecasts(limit: Int = 99999): Flow<List<ForecastEntity>>
@Insert(onConflict = OnConflictStrategy.REPLACE)
fun insertAll(forecasts: List<ForecastEntity>)