feature: query transformers #97
Labels
No labels
CI/CD
UI/UX
autorelease: pending
bug
docs
duplicate
enhancement
good first issue
help wanted
invalid
question
refactor
size
L
size
M
size
S
size
XL
size
XS
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
noe.trevino/dadbod-ui.nvim#97
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Did you check the docs?
Is your feature request related to a problem? Please describe.
I run a select, get a page of rows back, and then i want to know how many rows there actually are. Or sort by a column. Or see if theres duplicates.
Every one of those means going back to the buffer and hand editing the sql, then running it again.
Describe the solution you'd like
Rewrite the statement under the cursor and run the result.
paginator.luaalready does exactly this. It checks the statement is a plain select, appends a limit clause, runs it. Same move, different clause:SELECT count(*) FROM (...)ORDER BY <col> [DESC]WHERESELECT (...)SELECT col, count(*) FROM (...) GROUP BY colHAVING count(*) > 1Two of these i really want. Evaluate expression means i can visually select
now() - interval '1 day'and just run that, which is the natural thing to want in an editor where you already run a selection. And find duplicates is one line different from group by and answers a question i ask all the time.Uses the statement classifier from #92 rather than its own guard.
Acceptance Criteria
Describe alternatives/other solutions you've considered
Sorting client side only. Doesnt work once you paginate. If we only have page 1 and sort locally you get "the smallest of the first 200 rows", not "the smallest", and it looks right so you dont notice. DBeaver sorts locally only when everything is already fetched and otherwise re-runs with an ORDER BY. Thats the behaviour to copy.
A separate issue per transformer. Theyre all the same mechanism, splitting them into seven issues would be fake granularity.
Blocked by