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

Open
opened 2025-12-29 15:31:41 +01:00 by adam · 1 comment
Owner

Originally created by @pawan-joshi on GitHub (May 22, 2024).

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

Originally created by @pawan-joshi on GitHub (May 22, 2024). 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
Author
Owner

@pawan-joshi commented on GitHub (May 22, 2024):

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

@pawan-joshi commented on GitHub (May 22, 2024): Raise a pull request with fix. https://github.com/JohnEstropia/CoreStore/pull/505
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/CoreStore#432