CPM History
CPM History Schema
Database
- File:
weather_cache.db - Engine:
expo-sqlite
Table: cpm_history
| Column | Type | Null | Notes |
|---|---|---|---|
cpm | REAL | NOT NULL | One computed CPM value per successful minute tick. |
timestamp | INTEGER | NOT NULL | Epoch milliseconds when the value was recorded. |
Data Invariants
- Each row stores only
cpmandtimestamp. - Values must be finite numbers (
insertCpmRowvalidates inputs). - Retention is capped at 40 rows; oldest rows are removed first on insert overflow.
Access Patterns
- Insert and bounded retention:
insertCpmRow(cpm, timestamp?). - Recent read window:
getRecentCpmRows(sinceTimestamp, limit). - Read ordering: newest first (
ORDER BY timestamp DESC, rowid DESC).