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
- (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
- (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
- (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
- (MSSyncContextReadResult *)readWithQuery:(MSQuery *)query orError:(NSError **)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.
- (NSDictionary *)readTable:(NSString *)table withItemId:(NSString *)itemId orError:(NSError **)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:(NSArray *)item table:(NSString *)table orError:(NSError **)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:(NSArray *)items table:(NSString *)table orError:(NSError **)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:(MSQuery *)query orError:(NSError **)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:(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