You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using CoreStore and while we love it, there is one thing that is causing us a bit of trouble. When wanting to clear the whole database, we need to go through all the entities and do calls to deleteAll for each entity.
For large datasets this is fairly time consuming.
I am wondering if we could have something which is faster like using NSBatchDeleteRequest or a call to destroyPersistentStore on each store and recreating them afterwards.
The text was updated successfully, but these errors were encountered:
@alinpetrus Thanks. Should be simple enough to expose a safe method for it (since cs_eraseStorageAndWait() already exists for the purpose of migrations). The hard part is ensuring that the existing observers are notified of the deletions. I'll try to push a prototype into develop this weekend and let you play with it before we merge it to main.
In the mean time, if you can ensure that all references to the DataStack can be initialized, you can just replace your DataStack with a new one, delete the files related to the old SQLiteStore().fileURL, and re-add the SQLiteStore to the new DataStack. I have two projects that does this safely, but yeah we should have a supported safe way to remove stores in the API.
We are using CoreStore and while we love it, there is one thing that is causing us a bit of trouble. When wanting to clear the whole database, we need to go through all the entities and do calls to deleteAll for each entity.
For large datasets this is fairly time consuming.
I am wondering if we could have something which is faster like using NSBatchDeleteRequest or a call to destroyPersistentStore on each store and recreating them afterwards.
The text was updated successfully, but these errors were encountered: