JSON to Core Data and back. Swift Core Data Sync.
public class func changes...
(@petkrein)Before you could set insert
, update
and delete
operations and that worked for both parents and children, now you have more control and can also decide if children follow these rules using insertRelationships
, updateRelationships
and deleteRelationships
.
If you were using the .insert
, .update
, or .delete
options now you'll also need to set .insertRelationships
, .updateRelationships
or . deleteRelationships
based on what are your needs.
.all
It's a feature that allows you to have more control over what happens when using Sync, you can then tell sync to only do inserts and updates, or only do inserts and deletes and so on.
Looks like this:
dataStack.sync(updated, inEntityNamed: "User", operations: [.insert, .update, .delete, .deleteRelationships], completion: nil)
Extended operations was a breaking change, it didn't break the compilation but it broke functionality, this release aims for fix that, I'll reintroduce the feature in a separate major release: https://github.com/3lvis/Sync/issues/497
Fixes an issue with forcing all requests to work in "isTesting" mode, meaning synchronously. https://github.com/3lvis/Sync/pull/522
Introduced an extension to FileManager
to get the directory URL where the sqlite file is stored. Since it can be different when running on device or in unit tests (because of sandboxing reasons we switch between caches folder and directory when needed). https://github.com/3lvis/Sync/commit/d970043d47b92b8be01d38b499ba7df7e1e2368c
FileManager.sqliteDirectoryURL