Skip to navigation

Supports:

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

Connection

Configuration

NameTypeDescriptionRequired
ca_certstringCA certificate

Optional PEM root certificate trusted in addition to the system and Amazon RDS roots. Used by verify-ca and verify-full.
optional
change_detectionbooleanUse logical replication for bulk syncs ↓optional
databasestringDatabaserequired
hostnamestringHostname used to connect to the Amazon RDS databaserequired
iam_role_arnstringIAM role ARN

Role that grants rds-db:connect access to this database user
required
portintegerPortrequired
rds_endpoint_hostnamestringRDS endpoint hostname

RDS hostname used to sign IAM tokens and for TLS server name. 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 regionrequired
sshbooleanConnect over SSH tunnel ↓optional
ssl_modestringSSL mode

Accepted values: require, verify-ca, verify-full
optional
tagsobjectTags

Additional tags to apply during role assumption
optional
usernamestringUsernamerequired
Read-only propertyTypeDescription
external_idstringExternal ID for the IAM role

change_detection

When change_detection is true:

NameTypeDescriptionRequired
publicationstringPublicationrequired
{
"name": "Amazon RDS PostgreSQL connection",
"type": "amazon_rds_postgresql",
"configuration": {
"ca_cert": "",
"change_detection": true,
"database": "sampledb",
"hostname": "database.123456789012.us-east-1.rds.amazonaws.com",
"iam_role_arn": "arn:aws:iam::123456789012:role/polytomic-rds",
"port": 5432,
"publication": "polytomic",
"rds_endpoint_hostname": "database.123456789012.us-east-1.rds.amazonaws.com",
"rds_endpoint_port": 5432,
"region": "us-east-1",
"ssh": false,
"ssl_mode": "verify-full",
"tags": {},
"username": "polytomic"
}
}

ssh

When ssh is true:

NameTypeDescriptionRequired
ssh_hoststringSSH hostrequired
ssh_portintegerSSH portrequired
ssh_private_keystringPrivate keyrequired
ssh_userstringSSH userrequired
{
"name": "Amazon RDS PostgreSQL connection",
"type": "amazon_rds_postgresql",
"configuration": {
"ca_cert": "",
"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": 5432,
"rds_endpoint_hostname": "database.123456789012.us-east-1.rds.amazonaws.com",
"rds_endpoint_port": 5432,
"region": "us-east-1",
"ssh": true,
"ssh_host": "bastion.example.com",
"ssh_port": 22,
"ssh_private_key": "",
"ssh_user": "root",
"ssl_mode": "verify-full",
"tags": {},
"username": "polytomic"
}
}

Example

{
"name": "Amazon RDS PostgreSQL connection",
"type": "amazon_rds_postgresql",
"configuration": {
"ca_cert": "",
"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": 5432,
"rds_endpoint_hostname": "database.123456789012.us-east-1.rds.amazonaws.com",
"rds_endpoint_port": 5432,
"region": "us-east-1",
"ssh": false,
"ssl_mode": "verify-full",
"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 PostgreSQL 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 PostgreSQL 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

Configuration

NameTypeDescriptionRequired
automatically_add_new_fieldsbooleanAutomatically add new fields on selected tablesoptional
automatically_add_new_objectsbooleanAutomatically add new tablesoptional
mirror_publication_selectionsbooleanMirror table and column selection with database publicationoptional
mirror_tables_without_unique_idbooleanMirror tables without a unique identifier

If set to true, Polytomic will mirror the table even if it doesn’t have a primary key or unique index.
optional
replication_slotstringReplication slot

Leave blank to allow Polytomic to manage a replication slot for this sync.
optional

Example

{
...
"source_configuration": {
"automatically_add_new_fields": false,
"automatically_add_new_objects": false,
"mirror_publication_selections": false,
"mirror_tables_without_unique_id": false,
"replication_slot": "polytomic"
}
}

Destination

Configuration

NameTypeDescriptionRequired
advancedobjectoptional
mirror_schemasbooleanMirror schemasoptional
schemastringOutput schemaoptional

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 POSTGRESQL TYPE
array<>JSON
bigintINT8
booleanBOOL
dateDATE
datetimeTIMESTAMP
decimal(precision, scale)NUMERIC(precision,scale)
doubleDOUBLE PRECISION
intINT4
jsonJSON
jsonarrayJSON
numberNUMERIC
object{}JSON
singleREAL
smallintINT2
stringTEXT
timeTIME

Source types

AMAZON RDS POSTGRESQL TYPEPOLYTOMIC TYPE
ANYARRAYjsonarray
CIDRstring
CSTRINGstring
DATEdate
DOUBLE PRECISIONdouble
FLOATsingle
FLOAT4single
FLOAT8double
INETstring
INTint
INT2smallint
INT4int
INT8bigint
INTERVALstring
JSONjson
JSONBjson
MACADDRstring
MONEYnumber
NAMEstring
NUMERIC(precision, scale)decimal(precision, scale)
REALsingle
TEXTstring
TIMEtime
TIMESTAMPdatetime
TIMESTAMPTZdatetime_tz
TIMETZtime
UUIDstring
_BOOLjsonarray
_BPCHARjsonarray
_BYTEAjsonarray
_CHARjsonarray
_CSTRINGjsonarray
_DATEjsonarray
_FLOAT4jsonarray
_FLOAT8jsonarray
_INT2jsonarray
_INT2VECTORjsonarray
_INT4jsonarray
_INT8jsonarray
_JSONjsonarray
_JSONBjsonarray
_LSEGjsonarray
_MONEYjsonarray
_NAMEjsonarray
_NUMERICjsonarray
_PATHjsonarray
_TEXTjsonarray
_TIMEjsonarray
_TIMESTAMPjsonarray
_TIMESTAMPTZjsonarray
_TIMETZjsonarray
_UUIDjsonarray
_VARCHARjsonarray
_XMLjsonarray