Closed fake-name closed 5 years ago
Hi. You're right it is implemented naively. We simply check if it is an ALTER command display the warning.
I'm open to changing the verbiage, feel free to open a PR. If you want to turn off that warning you can also do that via your config file. Check for the words destructive_warning
.
Adding a constraint isn't destructive. Why am I getting a warning? Is pgcli doing something else when I add a constraint?
Your environment
[x] Please provide your OS and version information.
[x] Please provide your CLI version.
[x] What is the output of
pip freeze
command.I assume this is some sort of "double check on
ALTER
commands" thing, but well, it's sufficently dumb about it that it only serves to be annoying. Why was this even implemented?If you're going to add warning popups with wording that make it sound like you're going to delete stuff, make sure it only happens when you're actually going to delete stuff!
If you can't fully disambiguate if a command is actually destructive, don't call them destructive commands.
I still think this entire feature is dumb, but maybe say "You're about to run a
ALTER/Whatever
command. This may irrevocably delete data. Continue?", or some similar verbiage that at least is aware that not all ALTER commands delete stuff.