Skip to content

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

@pawan-joshi

Description

@pawan-joshi

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions