CoreStore icon indicating copy to clipboard operation
CoreStore copied to clipboard

Crash when printing model schema, if one of the attributes is of the type URI

Open pawan-joshi opened this issue 1 year ago • 1 comments

I tried to print model schema from data stack

 let dataStack: DataStack
 private init() {
     dataStack = DataStack(
         xcodeModelName: "MyModel",
         bundle: Bundle.main,
         migrationChain: ["MyModel", "MyModel1"]
     )
 }
 
 func initializeCachingEngine() {
     do {
         let store = try dataStack.addStorageAndWait(SQLiteStore(fileName: "MyModel.sqlite", localStorageOptions: .allowSynchronousLightweightMigration))
         print("File URL : \(store.fileURL)")
         let schema = dataStack.modelSchema.printCoreStoreSchema()
         print(" SCHEMA : \(schema)")
     } catch { print("ERROR:  \(error.localizedDescription)") }
 }

On line let schema = dataStack.modelSchema.printCoreStoreSchema() It crashed because In one of the entities in my xcdatamodel file had an attribute with URI type

pawan-joshi avatar May 22 '24 07:05 pawan-joshi

Raise a pull request with fix. https://github.com/JohnEstropia/CoreStore/pull/505

pawan-joshi avatar May 22 '24 07:05 pawan-joshi