Google Cloud PostgreSQL

Supports:

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

Connection

Configuration

NameTypeDescriptionRequired
change_detectionbooleanUse logical replication for bulk syncsfalse
connection_namestringCloud SQL connection name

Takes the form of project:region:instance
true
credentialsstringService account keytrue
databasestringDatabasetrue
passwordstringPassword

May be omitted when authenticating to Postgres using the service account key.
false
publicationstringPublicationfalse
usernamestringUsernamefalse

Example

1{
2 "name": "Google Cloud PostgreSQL connection",
3 "type": "googlecloudsql",
4 "configuration": {
5 "change_detection": false,
6 "connection_name": "project:region:instance",
7 "credentials": "",
8 "database": "sampledb",
9 "password": "secret",
10 "publication": "polytomic",
11 "username": "cloudsql"
12 }
13}

Model Sync

Source

Configuration

NameTypeDescriptionRequired
querystringfalse
tablestringTablefalse
viewstringViewfalse

Example

1{
2 ...
3 "configuration": {
4 "query": "SELECT * from users",
5 "table": "users",
6 "view": "active_users"
7 }
8}

Target

Google Cloud PostgreSQL connections may be used as the destination in a model sync.

All targets

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

When enabled updates will set fields to NULL when the source value is null
false
write_record_timestampsbooleanWrite row timestamp metadatafalse
Example
1{
2 ...
3 "target": {
4 "configuration": {
5 "created_column": "",
6 "preserve_table_on_resync": false,
7 "updated_column": "",
8 "write_null_values": false,
9 "write_record_timestamps": false
10 }
11 }
12}

Bulk Sync

Source

Configuration

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

If set to true
false
replication_slotstringReplication slot

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

Example

1{
2 ...
3 "source_configuration": {
4 "automatically_add_new_fields": false,
5 "automatically_add_new_objects": false,
6 "mirror_publication_selections": false,
7 "mirror_tables_without_unique_id": false,
8 "replication_slot": "polytomic"
9 }
10}

Destination

Configuration

NameTypeDescriptionRequired
advancedobjectfalse
mirror_schemasbooleanMirror schemasfalse
schemastringOutput schemafalse

Example

1{
2 ...
3 "destination_configuration": {
4 "advanced": {
5 "empty_strings_null": false,
6 "hard_deletes": false,
7 "initial_execution": "",
8 "table_prefix": "",
9 "truncate_existing": false
10 },
11 "mirror_schemas": false,
12 "schema": "schema"
13 }
14}

Type handling

Destination types

POLYTOMIC TYPEGOOGLE CLOUD 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

GOOGLE CLOUD POSTGRESQL TYPEPOLYTOMIC TYPE
ANYARRAYjsonarray
BPCHARstring
CHARstring
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
VARCHARstring
_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