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

# init(_:schema:url:allowsSave:cloudKitDatabase:)

Creates a named model configuration that specifies the on-disk location of the
schema’s persistent storage.

```
init(_ name: String? = nil, schema: Schema? = nil, url: URL, allowsSave: Bool = true, 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).

`url`

The on-disk location of the schema’s persistent storage.

`allowsSave`

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

`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)