Skip to navigation

Supports:

  • ✅ Models
  • ✅ Model sync destination
  • ✅ Bulk sync source
  • ✅ Bulk sync destination

Connection

Configuration

NameTypeDescriptionRequired
change_detectionbooleanUse replication for bulk syncs

Read changes from the binary log for bulk syncs.
optional
databasestringDatabase (optional)

Database to connect to.
optional
hostnamestringHostname used to connect to the Amazon RDS or Aurora MySQL database.required
iam_role_arnstringIAM role ARN

IAM role Polytomic assumes to sign database authentication tokens.
required
portintegerPort used to connect to the database.required
rds_endpoint_hostnamestringRDS endpoint hostname

RDS hostname used to sign IAM tokens and verify the server certificate; defaults to hostname when omitted.
optional
rds_endpoint_portintegerRDS endpoint port

RDS port used to sign IAM tokens; defaults to port when omitted.
optional
regionstringAWS region of the RDS instance or Aurora cluster.required
sshbooleanConnect over SSH tunnel ↓optional
tagsobjectTags

Session tags applied when assuming the IAM role.
optional
usernamestringUsername

MySQL user that authenticates with IAM database authentication.
required
Read-only propertyTypeDescription
external_idstringExternal ID Polytomic presents when assuming the IAM role.

ssh

When ssh is true:

NameTypeDescriptionRequired
ssh_hoststringSSH hostrequired
ssh_portintegerSSH portrequired
ssh_private_keystringPrivate keyrequired
ssh_userstringSSH userrequired
{
"name": "Amazon RDS MySQL connection",
"type": "amazon_rds_mysql",
"configuration": {
"change_detection": false,
"database": "sampledb",
"hostname": "database.123456789012.us-east-1.rds.amazonaws.com",
"iam_role_arn": "arn:aws:iam::123456789012:role/polytomic-rds",
"port": 3306,
"rds_endpoint_hostname": "database.123456789012.us-east-1.rds.amazonaws.com",
"rds_endpoint_port": 3306,
"region": "us-east-1",
"ssh": true,
"ssh_host": "bastion.example.com",
"ssh_port": 22,
"ssh_private_key": "",
"ssh_user": "root",
"tags": {},
"username": "polytomic"
}
}

Example

{
"name": "Amazon RDS MySQL connection",
"type": "amazon_rds_mysql",
"configuration": {
"change_detection": false,
"database": "sampledb",
"hostname": "database.123456789012.us-east-1.rds.amazonaws.com",
"iam_role_arn": "arn:aws:iam::123456789012:role/polytomic-rds",
"port": 3306,
"rds_endpoint_hostname": "database.123456789012.us-east-1.rds.amazonaws.com",
"rds_endpoint_port": 3306,
"region": "us-east-1",
"ssh": false,
"tags": {},
"username": "polytomic"
}
}

Model Sync

Source

Configuration

NameTypeDescriptionRequired
querystringoptional
tablestringTableoptional
viewstringViewoptional

Example

{
...
"configuration": {
"query": "SELECT * from users",
"table": "users",
"view": "active_users"
}
}

Target

Amazon RDS MySQL connections may be used as the destination in a model sync.

All targets

Configuration
NameTypeDescriptionRequired
created_columnstring’Created at’ timestamp columnoptional
preserve_table_on_resyncbooleanPreserve destination table when resyncingoptional
updated_columnstring’Updated at’ timestamp columnoptional
write_null_valuesbooleanCopy null values

When enabled updates will set fields to NULL when the source value is null
optional
write_record_timestampsbooleanWrite row timestamp metadataoptional
Example
{
...
"target": {
"configuration": {
"created_column": "",
"preserve_table_on_resync": false,
"updated_column": "",
"write_null_values": false,
"write_record_timestamps": false
}
}
}

Target creation

Amazon RDS MySQL connections may be used to create a new target for a model sync. The following parameters are required to create a new target:

NAMEDESCRIPTIONENUM
nameTable namefalse

Bulk Sync

Source

Amazon RDS MySQL connections may be used as a bulk sync source. No additional configuration options are required.

Destination

Configuration

NameTypeDescriptionRequired
advancedobjectoptional
mirror_schemasbooleanMirror databasesoptional
schemastringOutput databaseoptional

Advanced configuration (advanced)

NameTypeDescriptionRequired
empty_strings_nullbooleanWrite empty strings as nulloptional
hard_deletesbooleanPropagate hard deletes instead of soft deletesoptional
initial_executionstringOn first syncoptional
table_prefixstringPrefix table names withoptional
truncate_existingbooleanTruncate destination table when source table does not have a primary keyoptional

Example

{
...
"destination_configuration": {
"advanced": {
"empty_strings_null": true,
"hard_deletes": false,
"initial_execution": "rebuild",
"table_prefix": "",
"truncate_existing": false
},
"mirror_schemas": false,
"schema": "schema"
}
}

Type handling

Destination types

POLYTOMIC TYPEAMAZON RDS MYSQL TYPE
array<>JSON
bigintBIGINT
booleanBOOLEAN
dateDATE
datetimeDATETIME
decimal(precision, scale)DECIMAL(precision,scale)
doubleDOUBLE
intINT
jsonJSON
jsonarrayJSON
numberDECIMAL(65,30)
object{}JSON
singleFLOAT
smallintSMALLINT
stringLONGTEXT
timeTIME

Source types

AMAZON RDS MYSQL TYPEPOLYTOMIC TYPE
BIGINTbigint
BIGINT UNSIGNEDdecimal(precision, scale)
BITnumber
BLOBbinary
BLOBstring
CHARstring
DATEdate
DATETIMEdatetime
DECIMAL(precision, scale)decimal(precision, scale)
DOUBLEdouble
ENUMstring
FLOATsingle
INTint
INT UNSIGNEDbigint
MEDIUMBLOBbinary
MEDIUMINTint
MEDIUMINT UNSIGNEDint
MEDIUMTEXTstring
NUMERIC(precision, scale)decimal(precision, scale)
SMALLINTsmallint
SMALLINT UNSIGNEDint
TEXTstring
TIMEtime
TIMESTAMPdatetime
TINYBLOBbinary
TINYINTsmallint
TINYINT UNSIGNEDsmallint
TINYTEXTstring
UNSIGNED BIGINTdecimal(precision, scale)
UNSIGNED INTbigint
UNSIGNED MEDIUMINTint
UNSIGNED SMALLINTint
UNSIGNED TINYINTsmallint
VARBINARYbinary
VARCHARstring
YEARint