get_default_database_address

pyhelpers.dbms.utils.get_default_database_address(db_cls)[source]

Retrieve the database address of a database class given its default parameters.

Parameters:

db_cls (object) – Class representing a database.

Returns:

Address of the database given its default parameters in the format ‘<username>@<host>:<port>/<database_name>’.

Return type:

str

Examples:

>>> from pyhelpers.dbms.utils import get_default_database_address
>>> from pyhelpers.dbms import PostgreSQL
>>> db_addr = get_default_database_address(db_cls=PostgreSQL)
>>> db_addr
'None:***@None:None'