Creating models with list properties from PostgreSQL


#1

Hello,

I’m working on a project that intends to sync Realm with PostgreSQL via the adapter, and was curious about how lists would be handled. I understand that the adapter is capable of creating a table with a subtable on PostgreSQL to handle list properties - is it possible that that could work the other way as well? Suppose I create my own table + subtable in PostgreSQL, could the Realm adapter pick that up and make a model with a list property. Just curious, thanks!


#2

@kalex Not really because there is no concept of ordinality in SQL - what you could do is look at the subtable the Realm Adapter creates and follow the same pattern to insert after the adapter creates the meta table however I’d probably encourage you to just use one of our Server SDKs to make inserts into the Realm List.
https://docs.realm.io/sync/backend-integration/data-integration

Likely you need to make edits from some server-side application so using our Server SDKs, you make a List edit, and then the Postgres Adapter makes the change in PG for you