CoreStore
CoreStore copied to clipboard
Crash when printing model schema, if one of the attributes is of the type URI
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
Raise a pull request with fix. https://github.com/JohnEstropia/CoreStore/pull/505