Skip to content

Add SQLite-backed persistent history, replay windowing, and 4 new rea… - #1

Merged
Fayupable merged 1 commit into
mainfrom
dev/#1
Jul 28, 2026
Merged

Add SQLite-backed persistent history, replay windowing, and 4 new rea…#1
Fayupable merged 1 commit into
mainfrom
dev/#1

Conversation

@Fayupable

Copy link
Copy Markdown
Owner

…d-only insights

  • Replace the in-memory ring buffer with a SQLite-backed history store (WAL mode, auto_vacuum, redacted query text, age/count/disk-size-based pruning) so replay survives a restart
  • Recording now follows monitoring automatically instead of a separate time-capped start/stop action; replay window is selectable (1h-24h) with periodic-snapshot downsampling
  • Add prepared transaction, replication slot, long-running query, and unlogged table checks to Insights, plus temp file rate to the live dashboard stats
  • Add table-driven unit tests for every domain file with real decision logic (previously untested)
  • Fix a raw-query-text exposure gap in the new long-running-query collector to match the existing pg_stat_statements-only convention

What does this PR do

Why

How was this tested

  • go build ./... && go vet ./... && go test ./... passes
  • npx tsc -b passes (if frontend changed)
  • Manually tested in the browser (describe what you clicked through, if UI changed)

Checklist

  • New backend code follows the hexagonal architecture rules in CONTRIBUTING.md (no SQL outside infrastructure/postgres, no Postgres vocabulary in domain)
  • Any new Insights category's SQL filter/order matches the domain layer's actual judgment criteria (see CONTRIBUTING.md's note on this recurring bug class)
  • This does not add any capability beyond read-only SELECT against statistics views

…d-only insights

- Replace the in-memory ring buffer with a SQLite-backed history store
  (WAL mode, auto_vacuum, redacted query text, age/count/disk-size-based
  pruning) so replay survives a restart
- Recording now follows monitoring automatically instead of a separate
  time-capped start/stop action; replay window is selectable (1h-24h)
  with periodic-snapshot downsampling
- Add prepared transaction, replication slot, long-running query, and
  unlogged table checks to Insights, plus temp file rate to the live
  dashboard stats
- Add table-driven unit tests for every domain file with real decision
  logic (previously untested)
- Fix a raw-query-text exposure gap in the new long-running-query
  collector to match the existing pg_stat_statements-only convention
@Fayupable
Fayupable merged commit a4ff918 into main Jul 28, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant