mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-11 20:00:30 +01:00
Synchronous lightweight data migration #32
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @plamenterziev on GitHub (Jan 21, 2016).
I am using addSQLiteStoreAndWait to setup my data stack. My model is very simple and the objects are with limited count (only 22) so any migration will work fast. However the current API I cannot perform lightweight migration and have to use the asynchronous addSQLiteStore method which will make my code more complex than needed.
An option to perform lightweight data migration even using the addSQLiteStoreAndWait method will be useful.
@JohnEstropia commented on GitHub (Jan 21, 2016):
@plamenterziev Thanks for the feedback!
I understand the convenience of having a synchronous migration method, but I find little merit to writing a separate API for it for several reasons:
Sorry, I don't think there's enough good reasons to support this. I suggest you give your app a startup screen and then switch to your main view controller once addSQLiteStore's completion runs.
@plamenterziev commented on GitHub (Jan 22, 2016):
Hi @JohnEstropia
I understand your point, so what about the following:
Just allow user to be able to supply options when opening the persistent store, i.e. to provide custom options in optionsForSQLiteStore() dictionary?
@JohnEstropia commented on GitHub (Jan 26, 2016):
@plamenterziev
Hi, sorry for the late reply.
I'm sorry but I'm not fond of supporting API's that I won't encourage using. Adding a synchronous method that provide the option for migration provides more risk than the simplicity it provides.
Of course you are free to fork CoreStore and implement your method :)