tabsdata.MySQLDestination#
- class MySQLDestination(uri: str, destination_table: List[str] | str, credentials: UserPasswordCredentials = None, if_table_exists: Literal['append', 'replace'] = 'append')[source]#
Bases:
DestinationPluginClass for managing the configuration of MySQL-based data outputs.
- credentials#
The credentials required to access the MySQL 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: UserPasswordCredentials = None, if_table_exists: Literal['append', 'replace'] = 'append')[source]#
Initializes the MySQLDestination 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 (UserPasswordCredentials, optional) – The credentials required to access the MySQL database. Must be a UserPasswordCredentials object.
- Raises:
OutputConfigurationError –
Methods
__init__(uri, destination_table[, ...])Initializes the MySQLDestination with the given URI and destination table, and optionally connection credentials.
chunk(working_dir, *results)Store the results in the SQL destination.
stream(working_dir, *results)Trigger the exporting of the data. This method will receive the resulting data
write(files)Given a file or a list of files, write to the desired destination. Note: this
Attributes
The credentials required to access the MySQLDatabase.
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.