Skip to content

Data model

Storage

  • File: MyWeather.sqlite (constant DEFAULT_DB_FILE_NAME in weather_tools)
  • Location: The directory given by --db-dir (default: current working directory).
  • Engine: SQLite3, table created if missing:
CREATE TABLE IF NOT EXISTS rain_daily (
  date INT NOT NULL UNIQUE PRIMARY KEY,
  rain REAL
)
  • date column: Unix timestamp (seconds) for the end of the 24-hour period, i.e. the day key after normalising to 09:00:00 local time with no fractional seconds (see add / change in the source).

Units

  • rain column: Millimetres (mm).

Semantics

  • One row per logical day (unique date / bucket).
  • get_rain (used by graph) aggregates raw rows according to GraphGrouping (daily, weekly, monthly, yearly, annually).
  • get_rainy-days (used by rainy-days) counts days with rain > 0 inside each aggregated bucket.

Time zone

Bucket boundaries use the host’s local time zone at runtime (LOCAL_TZ in weather_tools).

See also