<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.12.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 3.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreData",
  "identifier" : "/documentation/CoreData/NSPersistentStoreDescription/setValue(_:forPragmaNamed:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Data"
    ],
    "preciseIdentifier" : "c:objc(cs)NSPersistentStoreDescription(im)setValue:forPragmaNamed:"
  },
  "title" : "setValue(_:forPragmaNamed:)"
}
-->

# setValue(_:forPragmaNamed:)

Allows you to set pragmas for the SQLite store.

```
func setValue(_ value: NSObject?, forPragmaNamed name: String)
```

## Parameters

`value`

The value of the pragma to be set.

`name`

The name of the pragma to be set.

## Discussion

Pragma options are for SQLite stores only. All pragma values must be specified as <doc://com.apple.documentation/documentation/Foundation/NSString>objects. The `fullfsync` and `synchronous` pragmas control the tradeoff between write performance (write to disk speed and cache utilization) and durability (data loss/corruption sensitivity to power interruption). For more information on pragma settings, see <http://sqlite.org/pragma.html>.

---

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)