<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "swift: 5.9.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftData",
  "identifier" : "/documentation/SwiftData/Schema/Attribute/Option",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "SwiftData"
    ],
    "preciseIdentifier" : "s:9SwiftData6SchemaC9AttributeC6OptionV"
  },
  "title" : "Schema.Attribute.Option"
}
-->

# Schema.Attribute.Option

```
struct Option
```

## Topics

### Accessing property options

[`allowsCloudEncryption`](/documentation/SwiftData/Schema/Attribute/Option/allowsCloudEncryption)

Stores the property’s value in an encrypted form.

[`externalStorage`](/documentation/SwiftData/Schema/Attribute/Option/externalStorage)

Stores the property’s value as binary data adjacent to the model storage.

[`preserveValueOnDeletion`](/documentation/SwiftData/Schema/Attribute/Option/preserveValueOnDeletion)

Preserves the property’s value in the persistent history when the context deletes the owning model.

[`spotlight`](/documentation/SwiftData/Schema/Attribute/Option/spotlight)

Indexes the property’s value so it can appear in Spotlight search results.

[`unique`](/documentation/SwiftData/Schema/Attribute/Option/unique)

Ensures the property’s value is unique across all models of the same type.

[`transformable(by:)`](/documentation/SwiftData/Schema/Attribute/Option/transformable(by:)-9d4xh)

Transforms the property’s value between an in-memory form and a persisted form.

[`transformable(by:)`](/documentation/SwiftData/Schema/Attribute/Option/transformable(by:)-lunz)

[`ephemeral`](/documentation/SwiftData/Schema/Attribute/Option/ephemeral)

Track changes to this property but do not persist

[`codable`](/documentation/SwiftData/Schema/Attribute/Option/codable)

Uses the property’s codable representation to store the property.

## Relationships

### Conforms To

[`Decodable`](/documentation/Swift/Decodable)

[`Copyable`](/documentation/Swift/Copyable)

[`Equatable`](/documentation/Swift/Equatable)

[`Escapable`](/documentation/Swift/Escapable)

[`Encodable`](/documentation/Swift/Encodable)

[`Hashable`](/documentation/Swift/Hashable)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Sendable`](/documentation/Swift/Sendable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

---

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)