actio_python_utils.database_functions.get_pg_config¶
- actio_python_utils.database_functions.get_pg_config(service=None, service_fn=None, pgpass_fn='/Users/nick/.pgpass')[source]¶
Locates the PostgreSQL login credentials given a service name. Uses
service = $PGSERVICE
orcfg["db"]["service"]
if not specified.- Parameters:
service (
Optional
[str
], default:None
) – The PostgreSQL service name to getservice_fn (
Optional
[str
], default:None
) – The path to the file containing service definitions. Will usepgtoolkit.service.find()
if not specifiedpgpass_fn (
str
, default:'/Users/nick/.pgpass'
) – The path to the file containing database login data
- Return type:
PassEntry
- Returns:
The database login credentials corresponding to the given service