How to wire SwiftData up to external data sources?

In one of the WWDC 2023 videos a presenter said in passing that you can connect SwiftData to whatever complicated setup you have. I haven't been able to find any documentation or connection points for this though.

Obviously I can fetch the data myself and call context.insert(...) for every item, but what about refreshes, deletes, inserts, updates? Where can I wire up these external calls and their responses?

Thanks!

Post not yet marked as solved Up vote post of xike Down vote post of xike
651 views

Replies

Apple added docs about read-only server side data: https://developer.apple.com/documentation/swiftdata/maintaining-a-local-copy-of-server-data

I'm still not sure how one would integrate for read/write.