Releases: Data-swift/ManagedModels
MOMs
Fixes Issue #20, the persistent model types do not generate a cached entity anymore. Multiple ManagedObjectModel
s can be built from a single type and the deprecated init's for that are available again.
MOMs themselves are still cached for other methods that take PersistentModel types (like .modelContainer(for: Item.self)
).
Also, the attributeValueClassName
of NSAttributeDescription
s isn't filled anymore w/ the corresponding Foundation types. That produced issues w/ optional attributes (NSNull
not matching the set type) and doesn't seem to be required either.
Importing
Configurable
Doesn't require a configuration anymore. Will create a default one if the array is empty.
Also expose the store descriptions under the configurations
property. Though that might change.
Stored
Details
Codable Keys and Values
Thanks to @radianttap hints, the use of @NSManaged
could be dropped. The way property storage works is now more similar to SwiftData and supports Codable Swift types (untested), RawRepresentables and a lot more Swift base types (like Int?
and such.)
Also the initial value can now be provided inline.