tabsdata.PostgresDestination#
- class PostgresDestination(uri: str, destination_table: List[str] | str, credentials: dict | UserPasswordCredentials = None, if_table_exists: Literal['append', 'replace'] = 'append')[source]#
Bases:
Output
Class for managing the configuration of Postgres-based data outputs.
- credentials#
The credentials required to access the Postgres database.
- Type:
- destination_table#
The table(s) to create. If multiple tables are provided, they must be provided as a list.
- if_table_exists#
The strategy to follow when the table already exists. - ‘replace’ will create a new database table, overwriting an existing one. - ‘append’ will append to an existing table.
- Type:
{‘append’, ‘replace’}
- __init__(uri: str, destination_table: List[str] | str, credentials: dict | UserPasswordCredentials = None, if_table_exists: Literal['append', 'replace'] = 'append')[source]#
Initializes the PostgresDestination with the given URI and destination table, and optionally connection credentials.
- Parameters:
uri (str) – The URI of the database where the data is going to be stored.
destination_table (List[str] | str) – The tables to create. If multiple tables are provided, they must be provided as a list.
credentials (dict | UserPasswordCredentials, optional) – The credentials required to access the Postgres database. Can be a dictionary or a UserPasswordCredentials object.
- Raises:
OutputConfigurationError –
Methods
__init__
(uri, destination_table[, ...])Initializes the PostgresDestination with the given URI and destination table, and optionally connection credentials.
Attributes
The credentials required to access the Postgres database.
The table(s) to create.
The strategy to follow when the table already exists.
The URI of the database where the data is going to be stored.