dbcli / dbcli/pgcli

Feature Request: show service name in prompt

Đang mở
#1,624 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
13.4k
Fork
612
Merge trung bình
6 ngày 14 giờ
Pull request đã merge (30 ngày)
10

Mô tả

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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Start at the PGCli entry point and trace how prompt_dsn is supplied and rendered, then inspect the handling of the service=svc_name connection option. Done means a connection launched with a pg_service.conf service displays svc_name in the prompt while existing prompt behavior remains unchanged.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
postgresql, python
Lĩnh vực
cli, databases
Loại issue
Tính năng
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
68/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.