Bot releases are hidden (Show)
Published by 3lvis over 7 years ago
@objc public enum CompatibleOperationOptions: Int {
case insert = 0
case update = 1
case delete = 2
case insertUpdate = 3
case insertDelete = 4
case updateDelete = 5
case all = 6
}
class func compatibleChanges(_ changes: [[String: Any]], inEntityNamed entityName: String, dataStack: DataStack, operations: CompatibleOperationOptions, completion: ((_ error: NSError?) -> Void)?)
class func compatibleChanges(_ changes: [[String: Any]], inEntityNamed entityName: String, predicate: NSPredicate?, dataStack: DataStack, operations: CompatibleOperationOptions, completion: ((_ error: NSError?) -> Void)?)
Published by 3lvis over 7 years ago
Published by 3lvis over 7 years ago
Published by 3lvis over 7 years ago
Published by 3lvis over 7 years ago
Added support for:
This is backwards compatible, the hyper
ones still work.
Besides hyp_dictionary
now you'll get a export()
method.
More info about exporting here.
Published by 3lvis over 7 years ago
// For example now you can do
dataStack.sync(objectsB, inEntityNamed: "User", operations: [.update], completion: nil)
// Instead of
Sync.changes(objectsB, inEntityNamed: "User", dataStack: dataStack, operations: [.update], completion: nil)
Improved performance when using operations
filtering will be done only in the requested operations (https://github.com/SyncDB/Sync/pull/384)
Added support for deep-mapping for to-many
relationships (https://github.com/SyncDB/Sync/pull/385)
Added support for sync.isPrimaryKey
as an alternative to hyper.isPrimaryKey
and sync.remoteKey
to be used instead of hyper.remoteKey
. All of this without breaking backward compatibility so you don't have to change anything. (https://github.com/SyncDB/Sync/pull/388 and https://github.com/SyncDB/Sync/pull/390)
Published by 3lvis over 7 years ago
DATAStack
renamed to DataStack
import DATAStack
and replace it with import Sync
.Insert
, .Update
, .Delete
and .All
, now .insert
, .update
, .delete
and .all
Published by 3lvis almost 8 years ago
Published by 3lvis almost 8 years ago
https://github.com/SyncDB/Sync/commit/34a90cc37c6695b85fb54e05f1a890bb0d21c208
Published by 3lvis almost 8 years ago
persistentContainer.insertOrUpdate(json, inEntityNamed: "User") { result in
switch result {
case .success:
// be happy
case .failure(let error):
// do something with error
}
}
Published by 3lvis almost 8 years ago
persistentContainer.insertOrUpdate(json, inEntityNamed: "User") { id, error in
//...
}
persistentContainer.update("id", with: ["name": "bossy"], inEntityNamed: "User") { id, error in
//...
}
persistentContainer.delete("id", inEntityNamed: "User") { error in
//...
}
Published by 3lvis almost 8 years ago
persistentContainer.sync(objects, inEntityNamed: "NormalUser") { error in
//....
}
Published by 3lvis almost 8 years ago
let fetched = try! Sync.fetch("id", inEntityNamed: "User", using: dataStack.mainContext)
try! Sync.insertOrUpdate(["id": "id", "name": "name"], inEntityNamed: "User", using: context)
try! Sync.update("id", with: ["name": "Elvis"], inEntityNamed: "User", using: context)
try! Sync.delete("id", inEntityNamed: "User", using: context)
Published by 3lvis almost 8 years ago
This one couldn't be possible without the help from the fantastic @dersvenhesse! Thanks <3
willInsert
delegate. Called before the JSON is used to create a new NSManagedObject.public class func changes(_ changes: [[String : Any]], inEntityNamed entityName: String, predicate: NSPredicate?, persistentContainer: NSPersistentContainer, completion: ((_ error: NSError?) -> Void)?) {
Published by 3lvis almost 8 years ago
Published by 3lvis almost 8 years ago
Add date format: 2016-10-10 07:00:00
Published by 3lvis almost 8 years ago
DATAFilter.Operation
is Sync.Operation
Published by 3lvis almost 8 years ago
hyper.nonExportable
on attributes to exclude them from hyp_dictionary
. https://github.com/SyncDB/SYNCPropertyMapper/pull/130
💐 🎉 Thanks @ricardo0100 🎉 💐
Published by 3lvis almost 8 years ago
hyper.nonExportable
on attributes to exclude them from hyp_dictionary
. https://github.com/SyncDB/SYNCPropertyMapper/pull/130
💐 🎉 Thanks @ricardo0100 🎉 💐
Published by 3lvis almost 8 years ago
You might need to replace any:
import NSManagedObject_HYPPropertyMapper
With:
import SYNCPropertyMapper
And:
// Before
hyp_remote
// After
hyp_snakeCase
// Before
hyp_local
// After
hyp_camelCase