Add named query quiet mode to hide query text during execution#1551
Merged
j-bennet merged 3 commits intodbcli:mainfrom Jan 17, 2026
Merged
Add named query quiet mode to hide query text during execution#1551j-bennet merged 3 commits intodbcli:mainfrom
j-bennet merged 3 commits intodbcli:mainfrom
Conversation
j-bennet
reviewed
Jan 10, 2026
pgcli/main.py
Outdated
| self.output_file = None | ||
| self.pgspecial = PGSpecial() | ||
|
|
||
| self.hide_named_query_text = ( |
Contributor
There was a problem hiding this comment.
Your use case could be solved by just adding \nq that would do the same as \n but quietly and not complicating things with another config option. WDYT?
Contributor
Author
There was a problem hiding this comment.
n and q are far apart on the keyboard, which makes repeated input tiring and inefficient.
Also, users are already accustomed to using the \n command. Even if a new command is added that behaves the same way (a quiet mode), it would still introduce friction and inconvenience in everyday use.
For these reasons, I chose to add a toggle-style option instead.
Contributor
There was a problem hiding this comment.
You'd most likely use arrow up for repeated input. But I'm not totally opposed to \nq.
Contributor
|
Thanks for the PR. Going to merge! 🍒 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds a "quiet mode" for named query execution that hides the query text
and only shows the results.
Changes:
hide_named_query_textconfiguration option in pgclirc\nqcommand to toggle quiet mode at runtime\n <name>)\o), and log filesUse case: When executing saved named queries, users may want to see only the
results without the query text cluttering the output. This is especially useful
for lengthy queries or when running queries repeatedly, making the output cleaner
and more focused on the actual results.