#598 Measures: the SQLite change index for desktop files (#595)
–
- github
- github/openchronology/timeline-app
- github/openchronology/timeline-app#598
- pull request
- state:merged
Phase 3 of #595, stacked on #597: desktop `.och` files keep a change index, so their overviews split summaries' totals across the window and report balances, as the browser and servers do. - **Index:** a `changes` `rational_index` with one row per time at which the measures change, its sums being moments' values and durations' at their starts or ends (an ongoing duration counted at its end adds nothing yet). - **Upkeep:** `save` builds it. A sparse save counts again the times its changes touched (moments' old and new times, durations' old and new starts and ends, including durations anchored to moved moments). Moving a measure's durations between start and end rebuilds it. The index layout is now 4, so older files get one when opened. A file whose `changes` is anything but our virtual table is refused. - **Query:** `kind: "changes"` with `times` (null for after everything) and `inclusive` answers all of an overview's prefixes in one call, through the same tag or separation filter as the overview. - **Editor:** local overviews go through `measuredFrame`, as the server's do. - **Tests:** a Rust test compares every prefix with hand sums after a save, a sparse save (moments and durations moved, changed, removed and added), a measure moved from end to start, and an older file reopened. All Rust tests and the PostgreSQL balance and totals tests pass locally. Merge after #596 and #597. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_011fFY8eruEi1xAkkMBni13B https://github.com/circagraph/timeline-app/pull/598
Related
- #595 Measures: running balances from changes, and one change index per timeline
- #596 Measures: balances, durations at start or end, and totals that split the window (#595)
- #597 Measures: the PostgreSQL change index, balances and split totals (#595)
- #602 Measures: balances in the editor, a balance chart and api.balance (#595)
- Merge pull request #598 from openchronology/feat/595-sqlite-balances
Open #598 Measures: the SQLite change index for desktop files (#595) in the timeline