<!--
{
  "documentType" : "article",
  "framework" : "CoreData",
  "identifier" : "/documentation/CoreData/store-options",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Store options"
}
-->

# Store options

The options keys that configure the behavior and characteristics of a persistent store.

## Topics

### Constants

[`NSReadOnlyPersistentStoreOption`](/documentation/CoreData/NSReadOnlyPersistentStoreOption)

A flag that indicates whether a store is treated as read-only or not.

[`NSValidateXMLStoreOption`](/documentation/CoreData/NSValidateXMLStoreOption)

A flag that indicates whether an XML file should be validated with the DTD while opening.

[`NSPersistentStoreTimeoutOption`](/documentation/CoreData/NSPersistentStoreTimeoutOption)

Options key that specifies the connection timeout for Core Data stores.

[`NSSQLitePragmasOption`](/documentation/CoreData/NSSQLitePragmasOption)

Options key for a dictionary of SQLite pragma settings with pragma values indexed by pragma names as keys.

[`NSSQLiteAnalyzeOption`](/documentation/CoreData/NSSQLiteAnalyzeOption)

Option key to run an analysis of the store data to optimize indices based on statistical information when the store is added to the coordinator.

[`NSSQLiteManualVacuumOption`](/documentation/CoreData/NSSQLiteManualVacuumOption)

Option key to rebuild the store file, forcing a database wide defragmentation when the store is added to the coordinator.

[`NSPersistentStoreFileProtectionKey`](/documentation/CoreData/NSPersistentStoreFileProtectionKey)

Key to represent the protection class for the persistent store.

[`NSPersistentStoreForceDestroyOption`](/documentation/CoreData/NSPersistentStoreForceDestroyOption)

A flag that indicates the coordinator destroys the store file even if the operation might be unsafe, overriding locks, if necessary.

### Deprecated

[`NSExternalRecordsDirectoryOption`](/documentation/CoreData/NSExternalRecordsDirectoryOption)

Option indicating the directory where Spotlight external record files should be written to.

[`NSExternalRecordExtensionOption`](/documentation/CoreData/NSExternalRecordExtensionOption)

Option indicating the file extension to use for Spotlight external record files.

[`NSExternalRecordsFileFormatOption`](/documentation/CoreData/NSExternalRecordsFileFormatOption)

Option to specify the file format of a Spotlight external records.

[`NSPersistentStoreUbiquitousContentNameKey`](/documentation/CoreData/NSPersistentStoreUbiquitousContentNameKey)

Option to specify that a persistent store has a given name in ubiquity.

[`NSPersistentStoreUbiquitousContentURLKey`](/documentation/CoreData/NSPersistentStoreUbiquitousContentURLKey)

Option to specify the log path to use for ubiquitous content logs.

[`NSPersistentStoreUbiquitousPeerTokenOption`](/documentation/CoreData/NSPersistentStoreUbiquitousPeerTokenOption)

The corresponding value is an optionally specified string which will be mixed in to Core Data’s identifier for each iCloud peer. The value must be an alphanumeric string without any special characters, whitespace or punctuation. The primary use for this option is to allow multiple applications on the same peer (device) to share a Core Data store integrated with iCloud. Each application will require its own store file.

[`NSPersistentStoreRemoveUbiquitousMetadataOption`](/documentation/CoreData/NSPersistentStoreRemoveUbiquitousMetadataOption)

The corresponding value is an `NSNumber` object representing a boolean that indicates whether the receiver should remove all associated ubiquity metadata from a persistent store. You typically use this option during migration or copying to disassociate a persistent store file from an iCloud account.

[`NSPersistentStoreUbiquitousContainerIdentifierKey`](/documentation/CoreData/NSPersistentStoreUbiquitousContainerIdentifierKey)

The a string specifying the iCloud container identifier.

[`NSPersistentStoreRebuildFromUbiquitousContentOption`](/documentation/CoreData/NSPersistentStoreRebuildFromUbiquitousContentOption)

The corresponding value is an `NSNumber` object representing a boolean that indicates whether the receiver should erase the local store file and rebuild it from the iCloud data in Mobile Documents.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)