MSSyncContextDataSource Protocol Reference
Conforms to | NSObject |
---|---|
Declared in | MSSyncContext.h |
Overview
The MSSyncContextDataSource controls how data is stored and retrieved on the device. Errors returned from here will abort any given sync operation and will be surfaced to the mobile service through push or the delegate.
Controlling Where Data is Stored
– operationTableName
required method
Provides the name of the table to track all table operation meta data
- (nonnull NSString *)operationTableName
Discussion
Provides the name of the table to track all table operation meta data
Declared In
MSSyncContext.h
– errorTableName
required method
Provides the name of the table to track all table operation errors until they have been resolved
- (nonnull NSString *)errorTableName
Discussion
Provides the name of the table to track all table operation errors until they have been resolved
Declared In
MSSyncContext.h
– configTableName
required method
Provides the name of the table to track configuration data
- (nonnull NSString *)configTableName
Discussion
Provides the name of the table to track configuration data
Declared In
MSSyncContext.h
handlesSyncTableOperations
required method
Indicates if the items passed to a sync table call should be saved by the SDK, if disabled, the local store will only recieve upserts/deletes for data calls originating from the server (pulls & pushes) plus the state tracking on the operation queue.
@property (nonatomic) BOOL handlesSyncTableOperations
Discussion
Indicates if the items passed to a sync table call should be saved by the SDK, if disabled, the local store will only recieve upserts/deletes for data calls originating from the server (pulls & pushes) plus the state tracking on the operation queue.
Declared In
MSSyncContext.h
Fetching and Retrieving Data
– readWithQuery:orError:
required method
Returns a dictionary containing the items and totalCount
- (nullable MSSyncContextReadResult *)readWithQuery:(nullable MSQuery *)query orError:(NSError *__nullable *__nullable)error
Discussion
Returns a dictionary containing the items and totalCount
Declared In
MSSyncContext.h
– readTable:withItemId:orError:
required method
Should retrieve a single item from the local store or nil if item with the given ID does not exist.
- (nullable NSDictionary *)readTable:(nonnull NSString *)table withItemId:(nonnull NSString *)itemId orError:(NSError *__nullable *__nullable)error
Discussion
Should retrieve a single item from the local store or nil if item with the given ID does not exist.
Declared In
MSSyncContext.h
– upsertItems:table:orError:
required method
Should insert/update the given item in the local store as appropriate
- (BOOL)upsertItems:(nullable NSArray *)item table:(nonnull NSString *)table orError:(NSError *__nullable *__nullable)error
Discussion
Should insert/update the given item in the local store as appropriate
Declared In
MSSyncContext.h
– deleteItemsWithIds:table:orError:
required method
Should remove the provided item from the local store
- (BOOL)deleteItemsWithIds:(nonnull NSArray *)items table:(nonnull NSString *)table orError:(NSError *__nullable *__nullable)error
Discussion
Should remove the provided item from the local store
Declared In
MSSyncContext.h
– deleteUsingQuery:orError:
required method
Should remove all entries from the specified table in the local store
- (BOOL)deleteUsingQuery:(nonnull MSQuery *)query orError:(NSError *__nullable *__nullable)error
Discussion
Should remove all entries from the specified table in the local store
Declared In
MSSyncContext.h
– systemPropertiesForTable:
Returns the MSSystemProperties that should be stored locally (example: createdAt, updatedAt) If not implemented, the default of __version will be asked for from the server
- (NSUInteger)systemPropertiesForTable:(nonnull NSString *)table
Discussion
Returns the MSSystemProperties that should be stored locally (example: createdAt, updatedAt) If not implemented, the default of __version will be asked for from the server
Declared In
MSSyncContext.h