CSSQLiteStore
@objc
public final class CSSQLiteStore : NSObject, CSLocalStorage, CoreStoreObjectiveCType
The CSSQLiteStore serves as the Objective-C bridging type for SQLiteStore.
See also
SQLiteStore
-
Initializes an SQLite store interface from the given SQLite file URL. When this instance is passed to the
CSDataStack‘s-addStorage*:methods, a new SQLite file will be created if it does not exist.Important
InitializingCSSQLiteStores with custom migration mapping models is currently not supported. Create anSQLiteStoreinstance from Swift code and bridge the instance to Objective-C using itsSQLiteStore.bridgeToObjectiveCproperty.Declaration
Swift
@objc public convenience init(fileURL: URL, configuration: ModelConfiguration, localStorageOptions: Int)Parameters
fileURLthe local file URL for the target SQLite persistent store. Note that if you have multiple configurations, you will need to specify a different
fileURLexplicitly for each of them.configurationan optional configuration name from the model file. If not specified, defaults to
nil, theDefault
configuration. Note that if you have multiple configurations, you will need to specify a differentfileURLexplicitly for each of them.localStorageOptionsWhen the
CSSQLiteStoreis passed to theCSDataStack‘saddStorage()methods, tells theCSDataStackhow to setup the persistent store. Defaults toCSLocalStorageOptionsNone. -
Initializes an SQLite store interface from the given SQLite file name. When this instance is passed to the
CSDataStack‘s-addStorage*:methods, a new SQLite file will be created if it does not exist.Important
InitializingCSSQLiteStores with custom migration mapping models is currently not supported. Create anSQLiteStoreinstance from Swift code and bridge the instance to Objective-C using itsSQLiteStore.bridgeToObjectiveCproperty.Declaration
Swift
@objc public convenience init(fileName: String, configuration: ModelConfiguration, localStorageOptions: Int)Parameters
fileNamethe local filename for the SQLite persistent store in the
Application Support/
directory (or theCaches/
directory on tvOS). Note that if you have multiple configurations, you will need to specify a differentfileNameexplicitly for each of them.configurationan optional configuration name from the model file. If not specified, defaults to
nil, theDefault
configuration. Note that if you have multiple configurations, you will need to specify a differentfileNameexplicitly for each of them.localStorageOptionsWhen the
CSSQLiteStoreis passed to theCSDataStack‘saddStorage()methods, tells theCSDataStackhow to setup the persistent store. Defaults to[CSLocalStorageOptions none]. -
Initializes an
CSSQLiteStorewith an all-default settings: afileURLpointing to a
file in the.sqlite Application Support/
directory (or theCaches/
directory on tvOS), anilconfigurationpertaining to theDefault
configuration, andlocalStorageOptionsset to[CSLocalStorageOptions none].Important
InitializingCSSQLiteStores with custom migration mapping models is currently not supported. Create anSQLiteStoreinstance from Swift code and bridge the instance to Objective-C using itsSQLiteStore.bridgeToObjectiveCproperty.Declaration
Swift
@objc public convenience override init() -
The
NSURLthat points to the SQLite fileDeclaration
Swift
@objc public var fileURL: URL { get } -
An array of
SchemaMappingProviders that provides the complete mapping models for custom migrations. This is currently only supported for Swift code.Declaration
Swift
@objc public var migrationMappingProviders: [Any] { get } -
Options that tell the
CSDataStackhow to setup the persistent storeDeclaration
Swift
@objc public var localStorageOptions: Int { get }
-
The string identifier for the
NSPersistentStore‘stypeproperty. ForCSSQLiteStores, this is always set toNSSQLiteStoreType.Declaration
Swift
@objc public static let storeType: String -
The configuration name in the model file
Declaration
Swift
public var configuration: ModelConfiguration { get } -
The options dictionary for the
NSPersistentStore. ForCSSQLiteStores, this is always set to[NSSQLitePragmasOption: ["journal_mode": "WAL"]]Declaration
Swift
@objc public var storeOptions: [AnyHashable : Any]? { get } -
Called by the
CSDataStackto perform actual deletion of the store file from disk. Do not call directly! ThesourceModelargument is a hint for the existing store’s model version. ForCSSQLiteStore, this converts the database’s WAL journaling mode to DELETE before deleting the file.Declaration
Swift
@objc public func cs_eraseStorageAndWait(metadata: NSDictionary, soureModelHint: NSManagedObjectModel?, error: NSErrorPointer) -> Bool
-
Declaration
Swift
public let bridgeToSwift: SQLiteStore -
Declaration
Swift
public required init(_ swiftValue: SQLiteStore)
View on GitHub
CSSQLiteStore Class Reference