How to create a foreign key array
About foreign key arrays
Unfortunately, Postgres does not support arrays of foreign keys. Some of the other apps we connect with (e.g. Airtable) do, so we've tried to build a workaround for this. With this workaround you'll be able to sync Airtable linked records with a fake Postgres foreign key array.
How it works
At a high-level, you can configure a Postgres column to be an array BUT signal to Whalesync that you'd like us to treat it as a foreign key array.
Since Postgres just sees this as an array, the field no longer has the same validation, but it will sync.
Note: a bad value here will not break Whalesync, that value will simply not sync until you correct it.
How do I implement this?
Imagine you have two tables:
Contacts
Company
To create a foreign key array you can:
Ensure both tables have a primary key (e.g. uuid)
In Company, create an array column "People_fk_Contacts" with type uuid[] to match the type of the table id.
The "_fk" designates to Whalesync that you want this to be a foreign key.
The "_Contacts" designates that it should point to the Contacts table.
(*note - must match capitlization)
Set up your sync in Whalesync as normal, mapping your fields.
Example snippet
Last updated
Was this helpful?