feature: dangerous statement detection #96
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#96
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.
Nothing stops me from running
delete from userswhen i meant to type a where clause. Or a drop i thought was pointed somewhere else. One keystroke and its gone.Describe the solution you'd like
Look at the statement before it runs. If its a DROP, or an UPDATE or DELETE with no WHERE, confirm with
vim.ui.confirmfirst.Builds on the statement classifier from #92. Patterns come from the adapter spec since dialects differ.
The nice thing about this one is it needs no setup. No flag to remember to set, no connection to mark. It protects everything the moment it exists, which is exactly what you want for someone who just installed the plugin.
Acceptance Criteria
vim.ui.confirmDescribe alternatives/other solutions you've considered
DBeaver ties their version to a connection type, so you only get it on connections you marked prod. Its also weaker than it sounds, it skips selects entirely, you can yes-to-all it, and saying no just continues to the next statement in the script. The version that isnt tied to any config is the better one.
Relying on read only connections (#92) instead. That only protects connections i remembered to mark. This protects everything with no setup. They do different jobs.
Whether you can turn it off per connection or only globally isnt decided yet. Patterns are per adapter for sure.
Blocked by