Feature Request: show service name in prompt
- 主要语言
- Python
- 星标
- 13.4k
- 派生
- 612
- 平均合并
- 6 天 14 小时
- 30 天内合并 PR
- 10
描述
I primarily use `pgcli service=svc_name` to start pgcli with everything defined in `~/.pg_service.conf`. I would like the ability for that service name to appear in the prompt. I currently use `\h` to show the hostname, but but our hosts are things like `psql-dept-tier-azflexdb-application`, and I'd much prefer to just see my `svc_name` in the prompt.
It looks like `prompt_dsn` is only provided to the `PGCli` class for the purpose of displaying in the prompt. If we're connecting to a service name, **that** value could be provided instead, perhaps?
I could just redefine the services as `alias_dsn`, but we use other tools that use the standard pg_service file, so I really don't want to define them twice.
贡献指南
调研方向
从 PGCli 入口点开始,跟踪 prompt_dsn 的提供和渲染方式,然后检查连接选项 service=svc_name 的处理。完成的标准是:使用 pg_service.conf 中的服务启动的连接会在提示符中显示 svc_name,同时现有的提示符行为保持不变。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- postgresql, python
- 领域
- cli, databases
- Issue 类型
- 功能
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 活跃
- 描述清晰度
- 基本清楚
- 新手友好度
- 68/100