Skip to content

Commit

Permalink
confirm_destructive_query: Use confirm rather than prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
sharonyogev committed Jul 2, 2023
1 parent 69dcceb commit 6e13409
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ Contributors:
* Anna Glasgall (annathyst)
* Andy Schoenberger (andyscho)
* Damien Baty (dbaty)
* Sharon Yogev (sharonyogev)

Creator:
--------
Expand Down
1 change: 1 addition & 0 deletions changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Bug fixes:
* Fix 'invalid connection option "dsn"' ([issue 1373](https://github.com/dbcli/pgcli/issues/1373)).
* Fix explain mode when used with `expand`, `auto_expand`, or `--explain-vertical-output` ([issue 1393](https://github.com/dbcli/pgcli/issues/1393)).
* Fix sql-insert format emits NULL as 'None' ([issue 1408](https://github.com/dbcli/pgcli/issues/1408)).
* Fix wrong usage of prompt instead of confirm when confirm execution of destructive query

3.5.0 (2022/09/15):
===================
Expand Down
4 changes: 2 additions & 2 deletions pgcli/packages/prompt_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ def confirm_destructive_query(queries, keywords, alias):
if alias:
info += f" in {click.style(alias, fg='red')}"

prompt_text = f"{info}.\nDo you want to proceed? (y/n)"
prompt_text = f"{info}.\nDo you want to proceed?"
if is_destructive(queries, keywords) and sys.stdin.isatty():
return prompt(prompt_text, type=bool)
return confirm(prompt_text)


def confirm(*args, **kwargs):
Expand Down

0 comments on commit 6e13409

Please sign in to comment.