Repository navigation
feat(history): filter, sort and export the history - #598
Merged
Merged
Conversation
This was referenced Sep 9, 2026
The panel matched a substring of the SQL and nothing else, so everything else recorded on an entry was unusable for finding it. "What did I run against staging yesterday that failed" and "what were my slowest queries" are both ordinary questions it could not answer, and both are standard in DBeaver's Query Manager and DataGrip (#589, #326). Filters by connection, database, status, date range and minimum duration; sorts by recency, duration or row count; exports what matches as CSV or as a runnable SQL file. All of it is a WHERE clause against history.db rather than an array scan, which is the other half of why history moved there. Several things are load-bearing and easy to get wrong: An empty filter list means "all", not "none". Sending [] would empty the panel the moment someone unticked the last checkbox. Every filter value is bound, never interpolated. Connection names come from rows the app wrote, but a name is still data, and this would otherwise be the one place in the app building SQL by concatenation. A connection called `prod' OR '1'='1` has a test. An absent limit now means every match. It used to default to 500 inside list(), which would have silently capped an export at 500 rows. The end date is taken as the end of that day. Midnight would exclude the whole day the user just named. Facets are read from the history rather than from the connection list, so the filter only offers values that would return something. The panel says "50 of 812" — without the unpaged count, a full page and a last page look identical. CSV quotes per RFC 4180: a comma inside a statement would otherwise shift every later column by one. The SQL export flattens newlines in an error message, because one would end the comment and leave the rest of the message sitting in the file as SQL. Closes #589 Closes #326 Co-Authored-By: Claude Opus 5 <[email protected]>
Missed in the previous commit: the table had been reflowed by an earlier dprint pass, so the edit matched nothing and went in silently unapplied. Co-Authored-By: Claude Opus 5 <[email protected]>
EVWorth
force-pushed
the
feat/history-filters-export
branch
from
September 10, 2026 00:04
bef24d6 to
0fd9966
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #589, closes #326.
The panel matched a substring of the SQL and nothing else, so everything else recorded on an entry was unusable for finding it. "What did I run against staging yesterday that failed" and "what were my slowest queries" are both ordinary questions it couldn't answer, and both are standard in DBeaver's Query Manager and DataGrip.
Filters by connection, database, status, date range and minimum duration; sorts by recency, duration or row count; exports what matches as CSV or as a runnable SQL file. All of it is a
WHEREclause againsthistory.db— the other half of why history moved there.The parts that are easy to get wrong, and are tested
[]would empty the panel the moment someone unticked the last checkbox.prod' OR '1'='1has a test.list(), which would have silently capped an export at 500 rows. Caught while wiring the export; fixed with a test.--comment and leave the rest of the message in the file as SQL. There's a test asserting no line of the output starts withDROP TABLE.Verification
25 new Rust tests (46 in the history module), 8 new store tests, 16 new panel tests. Full suites green (1864 frontend, all Rust crates), clippy clean, 0 lint errors.
The second commit fixes a doc edit that silently didn't apply — the requirements table had been reflowed by an earlier dprint pass, so the pattern matched nothing. Worth noting because the failure mode was quiet.