feature: generate sql from a result row #100

Open
opened 2026-07-15 17:49:07 -05:00 by noe.trevino · 0 comments
Owner

Did you check the docs?

  • I have read all the dadbod-ui.nvim docs

I see a row in a result and i want to update it. Right now i write the whole UPDATE by hand, including the where clause, off what i can see on screen.

Describe the solution you'd like

Cursor on a result row, generate the UPDATE into a query buffer, edit it, run it.

This is the honest version of editable result grids. You get review-before-execute for free, which i actually want on an update, and theres no grid model or dirty state to keep track of.

Bottom of the list, dont start this before the rest of the roadmap.

Acceptance Criteria

  • generate UPDATE from the row under the cursor
  • generate INSERT from the row under the cursor
  • generate DELETE from the row under the cursor
  • uses the primary key in the where clause when theres one
  • with no unique key, emits a where naming every column
  • lands in a query buffer bound to the same connection, does not execute
  • keymaps are configurable
  • implemented in all adapters where their cli allows
    • postgres
    • MySQL
    • MariaDB
    • SQL Server
    • SQLite

Describe alternatives/other solutions you've considered

Editable result grids, like DBeaver. Already decided against. The hard part isnt the sql, its working out which columns identify the row, handling a join that touches several tables, and cascade deletes. Big machinery for something we can mostly get by generating text and letting you read it.

Doing nothing and writing them by hand. Fine for one row, annoying for anything past that.

Only generating the SELECT, which is easier since it needs no key. Half the value, the update is the bit thats annoying to type.

### Did you check the docs? - [X] I have read all the dadbod-ui.nvim docs ### Is your feature request related to a problem? Please describe. I see a row in a result and i want to update it. Right now i write the whole UPDATE by hand, including the where clause, off what i can see on screen. ### Describe the solution you'd like Cursor on a result row, generate the UPDATE into a query buffer, edit it, run it. This is the honest version of editable result grids. You get review-before-execute for free, which i actually want on an update, and theres no grid model or dirty state to keep track of. Bottom of the list, dont start this before the rest of the roadmap. ### Acceptance Criteria - [ ] generate UPDATE from the row under the cursor - [ ] generate INSERT from the row under the cursor - [ ] generate DELETE from the row under the cursor - [ ] uses the primary key in the where clause when theres one - [ ] with no unique key, emits a where naming every column - [ ] lands in a query buffer bound to the same connection, does not execute - [ ] keymaps are configurable - [ ] implemented in all adapters where their cli allows - [ ] postgres - [ ] MySQL - [ ] MariaDB - [ ] SQL Server - [ ] SQLite ### Describe alternatives/other solutions you've considered Editable result grids, like DBeaver. Already decided against. The hard part isnt the sql, its working out which columns identify the row, handling a join that touches several tables, and cascade deletes. Big machinery for something we can mostly get by generating text and letting you read it. Doing nothing and writing them by hand. Fine for one row, annoying for anything past that. Only generating the SELECT, which is easier since it needs no key. Half the value, the update is the bit thats annoying to type.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
noe.trevino/dadbod-ui.nvim#100
No description provided.