<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "swift: 5.9.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftData",
  "identifier" : "/documentation/SwiftData/ModelContainer/storeIdentifier(forConfigurationNamed:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftData"
    ],
    "preciseIdentifier" : "s:9SwiftData14ModelContainerC15storeIdentifier21forConfigurationNamedSSSgSS_tF"
  },
  "title" : "storeIdentifier(forConfigurationNamed:)"
}
-->

# storeIdentifier(forConfigurationNamed:)

Returns the on-disk store identifier for the given configuration name.

```
func storeIdentifier(forConfigurationNamed name: String) -> String?
```

## Parameters

`name`

The `name` value from the `ModelConfiguration` used to create the store.

## Return Value

The store identifier string, or `nil` if no store is associated with `name` or
if `invalidate()` has been called on this container.

## Discussion

Store identifiers are stable strings derived from the backing file path or the store’s
own initialization — they are *not* the configuration name. Use this function when you
have the name you passed to `ModelConfiguration` and need the corresponding identifier
to filter a `HistoryDescriptor`, interpret `PersistentIdentifier.storeIdentifier`, or
route to a specific store.

If no `ModelConfiguration` was given an explicit name at initialization time, the
default name is `"default"`.

---

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)