Hi Ivan, this is a fairly open ended design question, but I'll do my best to answer it.{#HS:185750878-3524#}
Typically, foreign & primary keys are used to model relationships in a pseudo object graph in relational databases that don't have native object links like Realm does. Because Realm is an object graph database which natively and efficiently represents links between objects, you're best to convert your foreign & primary keys into to-one, to-many and inverse relationships in your Realm models. You can read more about relationship modeling techniques in Realm in the Models/Relationships section of our documentation.
This way, when "updating the foreign keys of A to point to a different B" in your relational database, you could simply update the linked-to value in object A in Realm. This should be fairly similar to how you would model this using pointers and language-level Swift or Objective-C classes and structs. This is part of the design we've aimed for when defining the Realm APIs.
If you'd like us to clarify any of these points, please let us know. If you have some sample data you'd like to share that represents your current relational schema and would like us to assist you in designing an equivalent object graph schema, we're happy to do that too.
Best,
JP
--
JP Simard
![]()
--
You received this message because you are subscribed to the Google Groups "Realm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to realm-cocoa...@googlegroups.com.
To post to this group, send email to realm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/realm-cocoa/5d29b2fb-d3dd-4923-b3d9-3760ffe4ab26%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.