LocalStorage
public protocol LocalStorage : StorageInterface
The LocalStorage
represents StorageInterface
s that are backed by local files.
-
The
NSURL
that points to the store fileDeclaration
Swift
var fileURL: URL { get }
-
An array of
SchemaMappingProvider
s that provide the complete mapping models for custom migrations.Declaration
Swift
var migrationMappingProviders: [SchemaMappingProvider] { get }
-
Options that tell the
DataStack
how to setup the persistent storeDeclaration
Swift
var localStorageOptions: LocalStorageOptions { get }
-
The options dictionary for the specified
LocalStorageOptions
Declaration
Swift
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)Declaration
Swift
func cs_finalizeStorageAndWait(soureModelHint: NSManagedObjectModel) throws
-
Called by the
DataStack
to perform actual deletion of the store file from disk. Do not call directly! ThesourceModel
argument is a hint for the existing store’s model version. Implementers can use thesourceModel
to perform necessary store operations. (SQLite stores for example, can convert WAL journaling mode to DELETE before deleting)Declaration
Swift
func cs_eraseStorageAndWait(metadata: [String : Any], soureModelHint: NSManagedObjectModel?) throws