add internal utilities to force checkpoint operations on SQLite

This commit is contained in:
John Rommel Estropia
2017-07-01 16:45:11 +09:00
parent 809aa4ff96
commit 3096cb784c
3 changed files with 26 additions and 0 deletions

View File

@@ -141,6 +141,11 @@ public protocol LocalStorage: StorageInterface {
*/
func dictionary(forOptions options: LocalStorageOptions) -> [AnyHashable: Any]?
/**
Called by the `DataStack` to perform checkpoint operations on the storage. (SQLite stores for example, can convert the database's WAL journaling mode to DELETE to force a checkpoint)
*/
func cs_finalizeStorageAndWait(soureModelHint: NSManagedObjectModel) throws
/**
Called by the `DataStack` to perform actual deletion of the store file from disk. **Do not call directly!** The `sourceModel` argument is a hint for the existing store's model version. Implementers can use the `sourceModel` to perform necessary store operations. (SQLite stores for example, can convert WAL journaling mode to DELETE before deleting)
*/