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 or cfg["db"]["service"] if not specified.

Parameters:
  • service (Optional[str], default: None) – The PostgreSQL service name to get

  • service_fn (Optional[str], default: None) – The path to the file containing service definitions. Will use pgtoolkit.service.find() if not specified

  • pgpass_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