Cache
public class Cache
Undocumented
-
PodAPI object
Declaration
Swift
var podAPI: PodAPI
-
Object that schedules with the POD
Declaration
Swift
var sync: Sync
-
Undocumented
Declaration
Swift
public var scheduleUIUpdate: ((((_ context: MemriContext) -> Bool)?) -> Void)?
-
Starts the local realm database, which is created if it does not exist, sets the api and initializes the sync from them.
Declaration
Swift
public init(_ api: PodAPI) throws
Parameters
api
api object
-
gets default item from database, and adds them to realm
Declaration
Swift
public func install(_ dbName: String, _ callback: @escaping (Error?) -> Void) throws
-
Undocumented
Declaration
Swift
public func query(_ datasource: Datasource) throws -> [Item]
-
This function does two things 1) executes a query on the local realm database with given querOptions, and executes callback on the result. 2) calls the syncer with the same datasource to execute the query on the pod.
Declaration
Swift
public func query( _ datasource: Datasource, syncWithRemote: Bool = true, _ callback: @escaping (_ error: Error?, _ items: [Item]?) throws -> Void ) throws
-
Parses the query string, which whould be of format <type><space><filter-text>
Declaration
Swift
public func parseQuery(_ query: String) -> (type: String, filter: String?)
Parameters
query
query string
Return Value
(type to query, filter to apply)
-
Undocumented
Declaration
Swift
public func getResultSet(_ datasource: Datasource) -> ResultSet
-
marks an item to be deleted
Remark
All methods and properties must throw when deleted = true;Declaration
Swift
public func delete(_ item: Item) throws
Parameters
item
item to be deleted
-
marks a set of items to be deleted
Declaration
Swift
public func delete(_ items: [Item]) throws
Parameters
items
items to be deleted
-
Undocumented
Declaration
Swift
public class func getDeviceID() throws -> Int
-
Undocumented
Declaration
Swift
static var cacheUIDCounter: Int
-
Undocumented
Declaration
Swift
public class func incrementUID() throws -> Int
-
Undocumented
Declaration
Swift
public class func createItem<T: Item>( _ type: T.Type, values: [String: Any?] = [:], unique: String? = nil ) throws -> T
-
Undocumented
See moreDeclaration
Swift
enum ItemChange
-
Undocumented
Declaration
Swift
func isOnRemote(_ item: Item, _ retries: Int = 0, _ callback: @escaping (Error?) -> Void)
-
Undocumented
Declaration
Swift
func subscribe( query: String, on events: ItemChange = .all, wait: Double = 0.5 ) -> QueryPublisher
-
Undocumented
Declaration
Swift
func subscribe( to item: Item, on events: ItemChange = .all, wait: Double = 0.5 ) -> ItemPublisher<Item>