dbcli / dbcli/pgcli

Feature Request: show service name in prompt

Offen
#1,624 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
13.4k
Forks
612
Ø Merge
6 T. 14 Std.
Gemergte PRs (30 T.)
10

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
postgresql, python
Bereich
cli, databases
Issue-Typ
Feature
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Aktiv
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
68/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.