Skip to navigation

Supports:

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

Connection

Configuration

NameTypeDescriptionRequired
change_detectionbooleanUse replication for bulk syncsoptional
databasestringDatabaserequired
hostnamestringHostnamerequired
passwordstringPasswordrequired
portintegerPortrequired
sshbooleanConnect over SSH tunnel ↓optional
usernamestringUsernamerequired

ssh

When ssh is true:

NameTypeDescriptionRequired
ssh_hoststringSSH hostrequired
ssh_portintegerSSH portrequired
ssh_private_keystringPrivate keyrequired
ssh_userstringSSH userrequired
{
"name": "PlanetScale Vitess connection",
"type": "planetscale_vitess",
"configuration": {
"change_detection": false,
"database": "mydb",
"hostname": "aws.connect.psdb.cloud",
"password": "",
"port": 3306,
"ssh": true,
"ssh_host": "bastion.example.com",
"ssh_port": 22,
"ssh_private_key": "",
"ssh_user": "root",
"username": ""
}
}

Example

{
"name": "PlanetScale Vitess connection",
"type": "planetscale_vitess",
"configuration": {
"change_detection": false,
"database": "mydb",
"hostname": "aws.connect.psdb.cloud",
"password": "",
"port": 3306,
"ssh": false,
"username": ""
}
}

Model Sync

Source

Configuration

NameTypeDescriptionRequired
querystringoptional
tablestringTableoptional
viewstringViewoptional

Example

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

Target

PlanetScale Vitess 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

PlanetScale Vitess 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

PlanetScale Vitess connections may be used as a bulk sync source. No additional configuration options are required.

Destination

Configuration

NameTypeDescriptionRequired
advancedobjectoptional
schemastringKeyspaceoptional

Example

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

Type handling

Destination types

POLYTOMIC TYPEPLANETSCALE VITESS 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

PLANETSCALE VITESS TYPEPOLYTOMIC TYPE
BIGINTbigint
BITnumber
BLOBbinary
BLOBstring
CHARstring
DATEdate
DATETIMEdatetime
DECIMAL(precision, scale)decimal(precision, scale)
DOUBLEdouble
ENUMstring
FLOATsingle
INTint
MEDIUMBLOBbinary
MEDIUMINTint
MEDIUMTEXTstring
NUMERIC(precision, scale)decimal(precision, scale)
SMALLINTsmallint
TEXTstring
TIMEtime
TIMESTAMPdatetime
TINYBLOBbinary
TINYINTsmallint
TINYTEXTstring
UNSIGNED BIGINTbigint
UNSIGNED INTint
UNSIGNED SMALLINTsmallint
UNSIGNED TINYINTsmallint
VARBINARYbinary
VARCHARstring
YEARint