hdx.database.postgresql
module hdx.database.postgresql
PostgreSQL specific utilities
Classes
Functions
-
wait_for_postgresql — Waits for PostgreSQL database to be up
-
restore_from_pgfile — Restore database from a pg_restore file created by pg_backup using the pg_restore command.
class PostgresError()
Bases : Exception
wait_for_postgresql(db_uri: str) → None
Waits for PostgreSQL database to be up
Parameters
-
db_uri : str — Connection URI
Returns
-
None — None
restore_from_pgfile(db_uri: str, pg_restore_file: Path | str) → str
Restore database from a pg_restore file created by pg_backup using the pg_restore command.
Parameters
-
db_uri : str — Connection URI
-
pg_restore_file : Path | str — Path to the pg_restore database file
Returns
-
str — Output from the pg_restore command
Raises