Currently, our application requires the following features with respect to data persistence:
- Adding a new temperature to the database when it is recorded.
- Fetching historical temperature results so that our charts don't go blank. This can be rephrased as fetching the past 10 temperature results to initially populate our chart.
- Fetching temperatures for a particular date range.
- Fetching the average of temperatures in a date range.
In order to implement these features, we need to create a new module. In this module, each of the four points listed is implemented as separate methods of the singleton returned by the module.