I did manage to save my Entities to CloudKit with SwiftData but the default database is the private database. I need to store some Entities in the private and other Entities in the public CloudKit database. How do I manage that with SwiftData? With CoreData I always used different configurations for both private and public and added the entities to one or the other.
ModelConfiguration
so far lacks an NSPersistentCloudKitContainerOptions.databaseScope
equivalent. Even if you were to divide data into two stores, it seems that the automatic CloudKit sync would still default to .private
for both.
There is some discussion of coexistence between Core Data and SwiftData, with both accessing the same store. It might be possible to setup the Core Data side to perform the public database sync and the SwiftData side to operate as a reader of that store.