Repository navigation
Show PostgreSQL service names in the prompt - #1632
Merged
Merged
Conversation
Fixes dbcli#1624. Implemented and validated with Codex.
DiegoDAF
added a commit
to DiegoDAF/pgcli.daf
that referenced
this pull request
Oct 13, 2026
…#1632 conflict preview)
Contributor
|
Thanks @jackwalkerlabs ! |
DiegoDAF
added a commit
to DiegoDAF/pgcli.daf
that referenced
this pull request
Oct 15, 2026
diego-feito-stori
pushed a commit
to DiegoDAF/pgcli.daf
that referenced
this pull request
Oct 15, 2026
diego-feito-stori
pushed a commit
to DiegoDAF/pgcli.daf
that referenced
this pull request
Oct 15, 2026
Conflicts: changelog.rst (their Upcoming layout against ours; the entry moves to our Upcoming Features) and the end of connect(), where their `self.service_name = None` meets our SSL warning. Both kept, the reset right after `self.pgexecute = pgexecute`; connect_service() sets the name after our connect(**params), so the token still shows it. service_name is annotated Optional[str]: upstream assigns None first and mypy, which only our CI runs, rejected the later str.
diego-feito-stori
pushed a commit
to DiegoDAF/pgcli.daf
that referenced
this pull request
Oct 15, 2026
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.
Add a
\serviceprompt token for connections made withservice=...orPGSERVICE. Users can setprompt = '\service> 'to show their familiar service name instead of a long hostname. Direct connections clear the token after a successful connection.Fixes #1624.
Validation: full suite against an isolated PostgreSQL 17 instance: 2,782 passed, 1 xfailed, 1 xpassed. Tests cover explicit/environment service names, an empty token without a service, and clearing it on direct reconnect. Ruff hooks pass. Python 3.12 on macOS.
Implemented and tested using Codex under the submitting account's authorization.
Checklist