gpf_entrepot_toolbelt.orchestrator.models.database module

Model definition for GPF database connection.

Author: Gwendoline Andres (Oslandia)

class gpf_entrepot_toolbelt.orchestrator.models.database.PgDatabase(host: str = 'localhost', port: str = '5432', database_name: str = 'ign', user: str = 'ign', password: str = 'ign', schema_name: str | None = None)

Bases : object

Object definition for GPF database parameters for interface with Postgres.

__init__(host: str = 'localhost', port: str = '5432', database_name: str = 'ign', user: str = 'ign', password: str = 'ign', schema_name: str | None = None)

Object initialization.

Paramètres:
  • host (str, optional) – DBMS host address. Defaults to « localhost ».

  • port (str, optional) – DBMS port. Defaults to « 5432 ».

  • database_name (str, optional) – name to the database to connect. Defaults to « ign ».

  • user (str, optional) – user name to connect. Defaults to « ign ».

  • password (str, optional) – user password to connect. Defaults to « ign ».

  • schema_name (str, optional) – name of schema. Defaults to None.

property pg_connection_string: str

Get PostgreSQL connection string as documented here: https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING.

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

Renvoie:

Connection string for PostgreSQL

Type renvoyé:

str

property pg_connection_uri: str

Get PostgreSQL connection URI as documented here: https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING.

Structure: postgresql://[userspec@][hostspec][/dbname][?paramspec]

Renvoie:

Connection URI for PostgreSQL

Type renvoyé:

str