Skip to content

Instantly share code, notes, and snippets.

@jemai
Created June 1, 2019 18:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jemai/1bb83fcc5804f0b2c3cf0a937a706c54 to your computer and use it in GitHub Desktop.
Save jemai/1bb83fcc5804f0b2c3cf0a937a706c54 to your computer and use it in GitHub Desktop.
Persister is a protocol that holds all the queries logic
protocol Persister {
static func select<T: CodableObject>(type: T.Type, filter: NSPredicate?) -> Results<T>
static func insert(object: CodableObject, update: Bool?)
static func insert(objects: [CodableObject], update: Bool?)
static func delete(object: CodableObject)
static func delete<T: CodableObject>(type: T.Type, filter: NSPredicate?)
static func deleteAll<T: CodableObject>(type: T.Type)
static func resetDB()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment