tabsdata.MySQLDestination#

class MySQLDestination(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 MySQL-based data outputs.

credentials#

The credentials required to access the MySQL database.

Type:

UserPasswordCredentials

destination_table#

The table(s) to create. If multiple tables are provided, they must be provided as a list.

Type:

str | List[str]

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’}

uri#

The URI of the database where the data is going to be stored.

Type:

str

to_dict()[source]#

Converts the MySQLDestination object to a dictionary

__init__(uri: str, destination_table: List[str] | str, credentials: dict | 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 (dict | UserPasswordCredentials, optional) – The credentials required to access the MySQL database. Can be a dictionary or a UserPasswordCredentials object.

Raises:

OutputConfigurationError

Methods

__init__(uri, destination_table[, ...])

Initializes the MySQLDestination with the given URI and destination table, and optionally connection credentials.

Attributes

credentials

The credentials required to access the MySQLDatabase.

destination_table

The table(s) to create.

if_table_exists

The strategy to follow when the table already exists.

uri

The URI of the database where the data is going to be stored.