rapidloop / pgmetrics

Collect and display information and stats from a running PostgreSQL server
https://pgmetrics.io
Apache License 2.0
960 stars 65 forks source link

[Feature] Support connect by Keyword/Value Connection Strings #65

Closed patsevanton closed 2 months ago

patsevanton commented 1 year ago

Hello! Thanks for pgmetrics. Please add connect by Keyword/Value Connection Strings

In the keyword/value format, each parameter setting is in the form keyword = value, with space(s) between settings. Spaces around a setting's equal sign are optional. To write an empty value, or a value containing spaces, surround it with single quotes, for example keyword = 'a value'. Single quotes and backslashes within a value must be escaped with a backslash, i.e., \' and \.

Example:

host=localhost port=5432 dbname=mydb connect_timeout=10

https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING

For example my cloud:

pgmetrics "host=host \
    port=6432 \
    sslmode=verify-full \
    dbname=dbname \
    user=user \
    target_session_attrs=read-write"
mdevan commented 2 months ago

Available in v1.17.