mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-16 22:16:53 +01:00
comment documentations
This commit is contained in:
@@ -78,6 +78,7 @@ public extension CoreStore {
|
||||
```
|
||||
|
||||
- parameter storeType: the `StorageInterface` type
|
||||
- throws: a `CoreStoreError` value indicating the failure
|
||||
- returns: the `StorageInterface` added to the `defaultStack`
|
||||
*/
|
||||
public static func addStorageAndWait<T: StorageInterface where T: DefaultInitializableStore>(storeType: T.Type) throws -> T {
|
||||
@@ -92,6 +93,7 @@ public extension CoreStore {
|
||||
```
|
||||
|
||||
- parameter storage: the `StorageInterface`
|
||||
- throws: a `CoreStoreError` value indicating the failure
|
||||
- returns: the `StorageInterface` added to the `defaultStack`
|
||||
*/
|
||||
public static func addStorageAndWait<T: StorageInterface>(storage: T) throws -> T {
|
||||
@@ -106,6 +108,7 @@ public extension CoreStore {
|
||||
```
|
||||
|
||||
- parameter storeType: the `LocalStorageface` type
|
||||
- throws: a `CoreStoreError` value indicating the failure
|
||||
- returns: the local storage added to the `defaultStack`
|
||||
*/
|
||||
public static func addStorageAndWait<T: LocalStorage where T: DefaultInitializableStore>(storageType: T.Type) throws -> T {
|
||||
@@ -120,6 +123,7 @@ public extension CoreStore {
|
||||
```
|
||||
|
||||
- parameter storage: the local storage
|
||||
- throws: a `CoreStoreError` value indicating the failure
|
||||
- returns: the local storage added to the `defaultStack`. Note that this may not always be the same instance as the parameter argument if a previous `LocalStorage` was already added at the same URL and with the same configuration.
|
||||
*/
|
||||
public static func addStorageAndWait<T: LocalStorage>(storage: T) throws -> T {
|
||||
|
||||
@@ -117,6 +117,7 @@ public final class DataStack {
|
||||
try dataStack.addStorageAndWait()
|
||||
```
|
||||
|
||||
- throws: a `CoreStoreError` value indicating the failure
|
||||
- returns: the local SQLite storage added to the stack
|
||||
*/
|
||||
public func addStorageAndWait() throws -> SQLiteStore {
|
||||
@@ -131,6 +132,7 @@ public final class DataStack {
|
||||
```
|
||||
|
||||
- parameter storeType: the `StorageInterface` type
|
||||
- throws: a `CoreStoreError` value indicating the failure
|
||||
- returns: the `StorageInterface` added to the stack
|
||||
*/
|
||||
public func addStorageAndWait<T: StorageInterface where T: DefaultInitializableStore>(storeType: T.Type) throws -> T {
|
||||
@@ -145,6 +147,7 @@ public final class DataStack {
|
||||
```
|
||||
|
||||
- parameter storage: the `StorageInterface`
|
||||
- throws: a `CoreStoreError` value indicating the failure
|
||||
- returns: the `StorageInterface` added to the stack
|
||||
*/
|
||||
public func addStorageAndWait<T: StorageInterface>(storage: T) throws -> T {
|
||||
@@ -184,6 +187,7 @@ public final class DataStack {
|
||||
```
|
||||
|
||||
- parameter storeType: the `LocalStorageface` type
|
||||
- throws: a `CoreStoreError` value indicating the failure
|
||||
- returns: the local storage added to the stack
|
||||
*/
|
||||
public func addStorageAndWait<T: LocalStorage where T: DefaultInitializableStore>(storageType: T.Type) throws -> T {
|
||||
@@ -198,6 +202,7 @@ public final class DataStack {
|
||||
```
|
||||
|
||||
- parameter storage: the local storage
|
||||
- throws: a `CoreStoreError` value indicating the failure
|
||||
- returns: the local storage added to the stack. Note that this may not always be the same instance as the parameter argument if a previous `LocalStorage` was already added at the same URL and with the same configuration.
|
||||
*/
|
||||
public func addStorageAndWait<T: LocalStorage>(storage: T) throws -> T {
|
||||
|
||||
@@ -35,7 +35,6 @@ public final class InMemoryStore: StorageInterface, DefaultInitializableStore {
|
||||
|
||||
/**
|
||||
Initializes an `InMemoryStore` for the specified configuration
|
||||
|
||||
- parameter configuration: an optional configuration name from the model file. If not specified, defaults to `nil`, the "Default" configuration.
|
||||
*/
|
||||
public init(configuration: String?) {
|
||||
|
||||
@@ -30,6 +30,7 @@ import Foundation
|
||||
|
||||
/**
|
||||
A storage interface backed by an SQLite database that was created before CoreStore 2.0.0.
|
||||
|
||||
- Warning: The default SQLite file location for the `LegacySQLiteStore` and `SQLiteStore` are different. If the app was depending on CoreStore's default directories prior to 2.0.0, make sure to use `LegacySQLiteStore` instead of `SQLiteStore`.
|
||||
*/
|
||||
public final class LegacySQLiteStore: LocalStorage, DefaultInitializableStore {
|
||||
@@ -52,8 +53,8 @@ public final class LegacySQLiteStore: LocalStorage, DefaultInitializableStore {
|
||||
|
||||
/**
|
||||
Initializes an SQLite store interface from the given SQLite file name. When this instance is passed to the `DataStack`'s `addStorage()` methods, a new SQLite file will be created if it does not exist.
|
||||
- Warning: The default SQLite file location for the `LegacySQLiteStore` and `SQLiteStore` are different. If the app was depending on CoreStore's default directories prior to 2.0.0, make sure to use `LegacySQLiteStore` instead of `SQLiteStore`.
|
||||
|
||||
- Warning: The default SQLite file location for the `LegacySQLiteStore` and `SQLiteStore` are different. If the app was depending on CoreStore's default directories prior to 2.0.0, make sure to use `LegacySQLiteStore` instead of `SQLiteStore`.
|
||||
- parameter fileName: the local filename for the SQLite persistent store in the "Application Support" directory (or the "Caches" directory on tvOS). Note that if you have multiple configurations, you will need to specify a different `fileName` explicitly for each of them.
|
||||
- parameter configuration: an optional configuration name from the model file. If not specified, defaults to `nil`, the "Default" configuration. Note that if you have multiple configurations, you will need to specify a different `fileName` explicitly for each of them.
|
||||
- parameter mappingModelBundles: a list of `NSBundle`s from which to search mapping models for migration.
|
||||
@@ -75,6 +76,7 @@ public final class LegacySQLiteStore: LocalStorage, DefaultInitializableStore {
|
||||
|
||||
/**
|
||||
Initializes an `LegacySQLiteStore` with an all-default settings: a `fileURL` pointing to a "<Application name>.sqlite" file in the "Application Support" directory (or the "Caches" directory on tvOS), a `nil` `configuration` pertaining to the "Default" configuration, a `mappingModelBundles` set to search all `NSBundle`s, and `localStorageOptions` set to `.AllowProgresiveMigration`.
|
||||
|
||||
- Warning: The default SQLite file location for the `LegacySQLiteStore` and `SQLiteStore` are different. If the app was depending on CoreStore's default directories prior to 2.0.0, make sure to use `LegacySQLiteStore` instead of `SQLiteStore`.
|
||||
*/
|
||||
public init() {
|
||||
|
||||
@@ -30,6 +30,7 @@ import CoreData
|
||||
|
||||
/**
|
||||
A storage interface that is backed by an SQLite database.
|
||||
|
||||
- Warning: The default SQLite file location for the `LegacySQLiteStore` and `SQLiteStore` are different. If the app was depending on CoreStore's default directories prior to 2.0.0, make sure to use `LegacySQLiteStore` instead of `SQLiteStore`.
|
||||
*/
|
||||
public final class SQLiteStore: LocalStorage, DefaultInitializableStore {
|
||||
@@ -52,8 +53,8 @@ public final class SQLiteStore: LocalStorage, DefaultInitializableStore {
|
||||
|
||||
/**
|
||||
Initializes an SQLite store interface from the given SQLite file name. When this instance is passed to the `DataStack`'s `addStorage()` methods, a new SQLite file will be created if it does not exist.
|
||||
- Warning: The default SQLite file location for the `LegacySQLiteStore` and `SQLiteStore` are different. If the app was depending on CoreStore's default directories prior to 2.0.0, make sure to use `LegacySQLiteStore` instead of `SQLiteStore`.
|
||||
|
||||
- Warning: The default SQLite file location for the `LegacySQLiteStore` and `SQLiteStore` are different. If the app was depending on CoreStore's default directories prior to 2.0.0, make sure to use `LegacySQLiteStore` instead of `SQLiteStore`.
|
||||
- parameter fileName: the local filename for the SQLite persistent store in the "Application Support/<bundle id>" directory (or the "Caches/<bundle id>" directory on tvOS). Note that if you have multiple configurations, you will need to specify a different `fileName` explicitly for each of them.
|
||||
- parameter configuration: an optional configuration name from the model file. If not specified, defaults to `nil`, the "Default" configuration. Note that if you have multiple configurations, you will need to specify a different `fileName` explicitly for each of them.
|
||||
- parameter mappingModelBundles: a list of `NSBundle`s from which to search mapping models for migration
|
||||
@@ -73,6 +74,7 @@ public final class SQLiteStore: LocalStorage, DefaultInitializableStore {
|
||||
|
||||
/**
|
||||
Initializes an `SQLiteStore` with an all-default settings: a `fileURL` pointing to a "<Application name>.sqlite" file in the "Application Support/<bundle id>" directory (or the "Caches/<bundle id>" directory on tvOS), a `nil` `configuration` pertaining to the "Default" configuration, a `mappingModelBundles` set to search all `NSBundle`s, and `localStorageOptions` set to `.AllowProgresiveMigration`.
|
||||
|
||||
- Warning: The default SQLite file location for the `LegacySQLiteStore` and `SQLiteStore` are different. If the app was depending on CoreStore's default directories prior to 2.0.0, make sure to use `LegacySQLiteStore` instead of `SQLiteStore`.
|
||||
*/
|
||||
public init() {
|
||||
|
||||
@@ -137,7 +137,7 @@ public protocol LocalStorage: StorageInterface {
|
||||
var localStorageOptions: LocalStorageOptions { get }
|
||||
|
||||
/**
|
||||
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)
|
||||
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)
|
||||
*/
|
||||
func eraseStorageAndWait(soureModel soureModel: NSManagedObjectModel) throws
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user