mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-03-12 05:21:56 +01:00
WIP: objective C storages
This commit is contained in:
@@ -40,27 +40,39 @@ public protocol CSStorageInterface {
|
||||
The `CSLocalStorageOptions` provides settings that tells the `CSDataStack` how to setup the persistent store for `CSLocalStorage` implementers.
|
||||
*/
|
||||
@objc
|
||||
public enum CSLocalStorageOptions: Int {
|
||||
public final class CSLocalStorageOptions: NSObject {
|
||||
|
||||
/**
|
||||
Tells the `DataStack` that the store should not be migrated or recreated, and should simply fail on model mismatch
|
||||
*/
|
||||
case None = 0
|
||||
@objc
|
||||
public static let none = 0
|
||||
|
||||
/**
|
||||
Tells the `DataStack` to delete and recreate the store on model mismatch, otherwise exceptions will be thrown on failure instead
|
||||
*/
|
||||
case RecreateStoreOnModelMismatch = 1
|
||||
@objc
|
||||
public static let recreateStoreOnModelMismatch = 1
|
||||
|
||||
/**
|
||||
Tells the `DataStack` to prevent progressive migrations for the store
|
||||
*/
|
||||
case PreventProgressiveMigration = 2
|
||||
@objc
|
||||
public static let preventProgressiveMigration = 2
|
||||
|
||||
/**
|
||||
Tells the `DataStack` to allow lightweight migration for the store when added synchronously
|
||||
*/
|
||||
case AllowSynchronousLightweightMigration = 4
|
||||
@objc
|
||||
public static let allowSynchronousLightweightMigration = 4
|
||||
|
||||
|
||||
// MARK: Private
|
||||
|
||||
private override init() {
|
||||
|
||||
fatalError()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -88,7 +100,7 @@ public protocol CSLocalStorage: CSStorageInterface {
|
||||
Options that tell the `DataStack` how to setup the persistent store
|
||||
*/
|
||||
@objc
|
||||
var localStorageOptions: CSLocalStorageOptions { get }
|
||||
var localStorageOptions: Int { get }
|
||||
|
||||
/**
|
||||
Called by the `CSDataStack` 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)
|
||||
|
||||
Reference in New Issue
Block a user