ADR-0006: In-memory filtering
- Status: Accepted
- Date: 2026-08-11
- Deciders: maintainers
- Related: ADR-0009
Context
The transactions screen filters a month's list by direction, category, and a merchant search query. Filtering can happen in SQL or in memory.
Decision
Filtering is in-memory: a pure TransactionFilter applied to a month
list fetched by a simple range query. Dead SQL filter variants were removed.
Consequences
- Month lists are small (tens to a few hundred rows) — in-memory filtering is imperceptible and trivially testable.
- The ViewModel owns the filter state (
direction,categoryId,query) asMutableStateFlows; the DB layer stays a thin range reader (observeMonth/observeMonthIncludingHidden). - No SQL fragmentation: queries are the same regardless of active filters.
Alternatives considered
- Parameterized SQL filters per combination — rejected: combinatorial query surface, harder to test, no perf win at this scale.