will be deprecated in favor of these @propertyWrapper implementations:
Field.Stored (replacement for Value.Required andValue.Optional)
Field.Virtual (new, equivalent to transient versions of Value.Required andValue.Optional)
Field.Coded (replacement for Transformable.Required andTransformable.Optional, with additional support for custom encoders such as JSON)
Field.Identifier (new)
Field.Relationship (replacement for Relationship.ToOne, Relationship.ToManyOrdered, and Relationship.ToManyUnordered)
Field types that are marked above as "replacement"s will be able to migrate directly from their old counterparts. So if you have a property declared now as
when you are ready. They will be effectively equal to Core Data, and your VersionLocks will remain intact.
Note that this effectively forces you to use a different syntax for queries:
Before: From<Person>.where(\.title == "Mr.")
After: From<Person>.where(\.$title == "Mr.")
Also a couple of advantages:
The @propertyWrapper versions will be magnitudes performant and efficient than their current implementations. Currently Mirror reflection is used a lot to inject the NSManagedObject reference into the properties. With @propertyWrappers this will be synthesized by the compiler for us. (See https://github.com/apple/swift/pull/25884)
The @propertyWrapper versions, being structs, will give the compiler a lot more room for optimizations which were not possible before due to the need for mutable classes.
The only disadvantage will be
You need to update your code by hand to migrate to the new @propertyWrappers
(But the legacy ones will remain available for quite a while, so while it is recommended to migrate soon, no need to panic)
Post implementation ideas:
Blob support (background fetched)
Compound keys
Traits (ReadOnly, etc.)
Originally created by @JohnEstropia on GitHub (Jan 10, 2020).
Originally assigned to: @JohnEstropia on GitHub.
In a future update, these `CoreStoreObject` properties
- `Value.Required`, `Value.Optional`
- `Transformable.Required`, `Transformable.Optional`
- `Relationship.ToOne`, `Relationship.ToManyOrdered`, `Relationship.ToManyUnordered`
will be deprecated in favor of these `@propertyWrapper` implementations:
- `Field.Stored` (replacement for `Value.Required` and`Value.Optional`)
- `Field.Virtual` (new, equivalent to `transient` versions of `Value.Required` and`Value.Optional`)
- `Field.Coded` (replacement for `Transformable.Required` and`Transformable.Optional`, with additional support for custom encoders such as JSON)
- `Field.Identifier` (new)
- `Field.Relationship` (replacement for `Relationship.ToOne`, `Relationship.ToManyOrdered`, and `Relationship.ToManyUnordered`)
`Field` types that are marked above as "replacement"s will be able to migrate directly from their old counterparts. So if you have a property declared now as
```swift
let title = Value.Optional<String?>("title", initial: "Mr.")
```
you can directly convert it to
```swift
@Field.Stored("title")
var title: String? = "Mr."
```
when you are ready. They will be effectively equal to Core Data, and your `VersionLock`s will remain intact.
Note that this effectively forces you to use a different syntax for queries:
- Before: `From<Person>.where(\.title == "Mr.")`
- After: `From<Person>.where(\.$title == "Mr.")`
Also a couple of advantages:
- The `@propertyWrapper` versions will be magnitudes performant and efficient than their current implementations. Currently `Mirror` reflection is used a lot to inject the `NSManagedObject` reference into the properties. With `@propertyWrapper`s this will be synthesized by the compiler for us. (See https://github.com/apple/swift/pull/25884)
- The `@propertyWrapper` versions, being `struct`s, will give the compiler a lot more room for optimizations which were not possible before due to the need for mutable classes.
The only disadvantage will be
- You need to update your code by hand to migrate to the new `@propertyWrapper`s
(But the legacy ones will remain available for quite a while, so while it is recommended to migrate soon, no need to panic)
Post implementation ideas:
- Blob support (background fetched)
- Compound keys
- Traits (ReadOnly, etc.)
@JohnEstropia commented on GitHub (Mar 27, 2020):
Released now for version `7.1.0`!
Please check the release notes: https://github.com/JohnEstropia/CoreStore/releases/tag/7.1.0
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @JohnEstropia on GitHub (Jan 10, 2020).
Originally assigned to: @JohnEstropia on GitHub.
In a future update, these
CoreStoreObjectpropertiesValue.Required,Value.OptionalTransformable.Required,Transformable.OptionalRelationship.ToOne,Relationship.ToManyOrdered,Relationship.ToManyUnorderedwill be deprecated in favor of these
@propertyWrapperimplementations:Field.Stored(replacement forValue.RequiredandValue.Optional)Field.Virtual(new, equivalent totransientversions ofValue.RequiredandValue.Optional)Field.Coded(replacement forTransformable.RequiredandTransformable.Optional, with additional support for custom encoders such as JSON)Field.Identifier(new)Field.Relationship(replacement forRelationship.ToOne,Relationship.ToManyOrdered, andRelationship.ToManyUnordered)Fieldtypes that are marked above as "replacement"s will be able to migrate directly from their old counterparts. So if you have a property declared now asyou can directly convert it to
when you are ready. They will be effectively equal to Core Data, and your
VersionLocks will remain intact.Note that this effectively forces you to use a different syntax for queries:
From<Person>.where(\.title == "Mr.")From<Person>.where(\.$title == "Mr.")Also a couple of advantages:
@propertyWrapperversions will be magnitudes performant and efficient than their current implementations. CurrentlyMirrorreflection is used a lot to inject theNSManagedObjectreference into the properties. With@propertyWrappers this will be synthesized by the compiler for us. (See https://github.com/apple/swift/pull/25884)@propertyWrapperversions, beingstructs, will give the compiler a lot more room for optimizations which were not possible before due to the need for mutable classes.The only disadvantage will be
@propertyWrappers(But the legacy ones will remain available for quite a while, so while it is recommended to migrate soon, no need to panic)
Post implementation ideas:
@JohnEstropia commented on GitHub (Mar 27, 2020):
Released now for version
7.1.0!Please check the release notes: https://github.com/JohnEstropia/CoreStore/releases/tag/7.1.0