How to Toggle iCloud sync during runtime in SwiftData

My iCloud sync feature is an in-app purchase. I want to know how to switch iCloud sync without restarting the app. https://developer.apple.com/documentation/swiftdata/modelconfiguration/cloudkitdatabase-swift.property I haven't found a method to modify the CloudKitDatabase.

How to Toggle iCloud sync during runtime in SwiftData
 
 
Q