mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-05-02 13:34:16 +02:00
WIP: clean up persistent store setup
This commit is contained in:
@@ -34,8 +34,6 @@ public protocol StorageInterface: class {
|
||||
|
||||
var configuration: String? { get }
|
||||
var storeOptions: [String: AnyObject]? { get }
|
||||
|
||||
var internalStore: NSPersistentStore? { get set }
|
||||
}
|
||||
|
||||
|
||||
@@ -57,3 +55,16 @@ public protocol LocalStorage: StorageInterface {
|
||||
|
||||
func eraseStorageAndWait(soureModel soureModel: NSManagedObjectModel) throws
|
||||
}
|
||||
|
||||
|
||||
// MARK: Internal
|
||||
|
||||
internal extension LocalStorage {
|
||||
|
||||
internal func matchesPersistentStore(persistentStore: NSPersistentStore) -> Bool {
|
||||
|
||||
return persistentStore.type == self.dynamicType.storeType
|
||||
&& persistentStore.configurationName == (self.configuration ?? Into.defaultConfigurationName)
|
||||
&& persistentStore.URL == self.fileURL
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user