Database
MySQL
Connector Details
Name | Value |
---|---|
Platform | MySQL |
Auth Type | API Keys |
Direction | Bidirectional |
Tap Repo | https://github.com/transferwise/pipelinewise-tap-mysql |
Target Repo | https://github.com/hotgluexyz/target-mysql-v2 |
Tap Metrics | Usage: |
Target Metrics | Usage: |
Target MySQL
Config
target-mysql
requires the standard 5 connection parameters to be specified in the config:
Example ETL Script
Optional config flags
Property | Description | Default |
---|---|---|
table_name_pattern | MySQL table name pattern to use when creating tables | ”${TABLE_NAME}“ |
lower_case_table_names | Use lowercase for table names or not | true |
allow_column_alter | Allow column alterations or not | false |
replace_null | Replace null values with others or not | false |
table_config | Dictionary with specifications on insert/upsert/truncate |
The replace_null
Option (Experimental)
By enabling the replace_null
option, null values are replaced with ‘empty’ equivalents based on their data type. Use with caution as it may alter data semantics.
When replace_null
is true
, null values are replaced as follows:
JSON Schema Data Type | Null Value Replacement |
---|---|
string | Empty string("" ) |
number | 0 |
object | Empty object({} ) |
array | Empty array([] ) |
boolean | false |
null | null |
The table_config
option
By default, target-mysql will upsert your payload into each table. This means it will insert all new data into your table, but perform an update on primary key collision.
The table_config
allows you to override this behavior with one of two insertion methods:
truncate
: Delete the existing table and replace it with the new datainsert
: Attempt to insert all records as new rows, throwing an error on primary key collision
If you want to use the truncate
or insert
methods, you can specify which tables should use the method using the table_config
flag: