<!--
{
  "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/ModelConfiguration/init(_:schema:isStoredInMemoryOnly:allowsSave:groupContainer:cloudKitDatabase:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftData"
    ],
    "preciseIdentifier" : "s:9SwiftData18ModelConfigurationV_6schema20isStoredInMemoryOnly10allowsSave14groupContainer16cloudKitDatabaseACSSSg_AA6SchemaCSgS2bAC05GroupN0VAC05CloudpQ0Vtcfc"
  },
  "title" : "init(_:schema:isStoredInMemoryOnly:allowsSave:groupContainer:cloudKitDatabase:)"
}
-->

# init(_:schema:isStoredInMemoryOnly:allowsSave:groupContainer:cloudKitDatabase:)

Creates a named model configuration for the specified schema.

```
init(_ name: String? = nil, schema: Schema? = nil, isStoredInMemoryOnly: Bool = false, allowsSave: Bool = true, groupContainer: ModelConfiguration.GroupContainer = .automatic, cloudKitDatabase: ModelConfiguration.CloudKitDatabase = .automatic)
```

## Parameters

`name`

An optional name for the model configuration.

`schema`

A schema that maps model classes to the associated data in the
persistent storage. For more information, see [`Schema`](/documentation/SwiftData/Schema).

`isStoredInMemoryOnly`

A Boolean value that determines whether the
associated persistent storage is ephemeral and exists only in memory. The
default value is `false`.

`allowsSave`

A Boolean value that determines whether the associated
persistent storage is writable. The default value is `true`.

`groupContainer`

The option to use for detecting the configuration’s group
container. For possible values, see [`ModelConfiguration.GroupContainer`](/documentation/SwiftData/ModelConfiguration/GroupContainer-swift.struct).

`cloudKitDatabase`

The option to use for detecting the configuration’s
CloudKit database. For possible values, see [`ModelConfiguration.CloudKitDatabase`](/documentation/SwiftData/ModelConfiguration/CloudKitDatabase-swift.struct).

---

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)