MariaDBDestination
class MariaDBDestination(
uri: str,
destination_table: List[str] | str,
credentials: dict | UserPasswordCredentials = None,
if_table_exists: Literal['append', 'replace'] = 'append',
)
Bases: Output
Categories: destination
Class for managing the configuration of MariaDB-based data outputs.
Attributes: credentials (UserPasswordCredentials): The credentials required to access the MariaDB database. destination_table (str | List[str]): The table(s) to create. If multiple tables are provided, they must be provided as a list. if_table_exists ({'append', 'replace'}): 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. uri (str): The URI of the database where the data is going to be stored.
Methods: to_dict(): Converts the MariaDBDestination object to a dictionary
Initializes the MariaDBDestination with the given URI and destination table, and optionally connection credentials.
Parameters
uristrThe URI of the database where the data is going to be stored.
destination_tableList[str] | strThe tables to create. If multiple tables are provided, they must be provided as a list.
credentialsdict | UserPasswordCredentials, optionalThe credentials required to access the MariaDB database. Can be a dictionary or a UserPasswordCredentials object.
if_table_exists\{'append', 'replace'\}, optionalThe strategy to follow when the table already exists. Defaults to 'append'. - ‘replace’ will create a new database table, overwriting an existing one. - ‘append’ will append to an existing table.
Raises
OutputConfigurationError
Properties
credentialsUserPasswordCredentialsThe credentials required to access the MariaDB database.
destination_tablestr | List[str]The table(s) to create. If multiple tables are provided, they must be provided as a list.
if_table_existsLiteral['append', 'replace']str: The strategy to follow when the table already exists.
uristrThe URI of the database where the data is going to be stored.
Methods
to_dictdef to_dict() -> dict
Converts the MariaDBDestination object to a dictionary with all the relevant information.
Returns:
dict: A dictionary with the relevant information of the MariaDBDestination object.