LocalStorage

public protocol LocalStorage : StorageInterface

The LocalStorage represents StorageInterfaces that are backed by local files.

  • The NSURL that points to the store file

    Declaration

    Swift

    var fileURL: URL { get }
  • An array of SchemaMappingProviders 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 store

    Declaration

    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! 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)

    Declaration

    Swift

    func cs_eraseStorageAndWait(metadata: [String : Any], soureModelHint: NSManagedObjectModel?) throws