mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-03-26 19:31:29 +01:00
Deprecation of legacy ValueContainer and RelationshipContainer properties in favor of @Field propertyWrapper counterpart
This commit is contained in:
@@ -296,12 +296,6 @@ public enum SelectTerm<O: DynamicObject>: ExpressibleByStringLiteral, Hashable {
|
||||
case ._identity(let alias, _): return alias
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// MARK: Deprecated
|
||||
|
||||
@available(*, deprecated, renamed: "O")
|
||||
public typealias D = O
|
||||
}
|
||||
|
||||
|
||||
@@ -611,12 +605,6 @@ public struct Select<O: DynamicObject, T: SelectResultType>: SelectClause, Hasha
|
||||
|
||||
fetchRequest.propertiesToFetch = propertiesToFetch
|
||||
}
|
||||
|
||||
|
||||
// MARK: Deprecated
|
||||
|
||||
@available(*, deprecated, renamed: "O")
|
||||
public typealias D = O
|
||||
}
|
||||
|
||||
extension Select where T: NSManagedObjectID {
|
||||
@@ -642,48 +630,6 @@ extension Select where O: NSManagedObject {
|
||||
}
|
||||
}
|
||||
|
||||
extension Select where O: CoreStoreObject, T: ImportableAttributeType {
|
||||
|
||||
/**
|
||||
Initializes a `Select` that queries the value of an attribute pertained by a keyPath
|
||||
- parameter keyPath: the keyPath for the attribute
|
||||
*/
|
||||
public init(_ keyPath: KeyPath<O, ValueContainer<O>.Required<T>>) {
|
||||
|
||||
self.init(.attribute(keyPath))
|
||||
}
|
||||
|
||||
/**
|
||||
Initializes a `Select` that queries the value of an attribute pertained by a keyPath
|
||||
- parameter keyPath: the keyPath for the attribute
|
||||
*/
|
||||
public init(_ keyPath: KeyPath<O, ValueContainer<O>.Optional<T>>) {
|
||||
|
||||
self.init(.attribute(keyPath))
|
||||
}
|
||||
}
|
||||
|
||||
extension Select where O: CoreStoreObject, T: ImportableAttributeType & NSCoding & NSCopying {
|
||||
|
||||
/**
|
||||
Initializes a `Select` that queries the value of an attribute pertained by a keyPath
|
||||
- parameter keyPath: the keyPath for the attribute
|
||||
*/
|
||||
public init(_ keyPath: KeyPath<O, TransformableContainer<O>.Required<T>>) {
|
||||
|
||||
self.init(.attribute(keyPath))
|
||||
}
|
||||
|
||||
/**
|
||||
Initializes a `Select` that queries the value of an attribute pertained by a keyPath
|
||||
- parameter keyPath: the keyPath for the attribute
|
||||
*/
|
||||
public init(_ keyPath: KeyPath<O, TransformableContainer<O>.Optional<T>>) {
|
||||
|
||||
self.init(.attribute(keyPath))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// MARK: - SelectClause
|
||||
|
||||
@@ -720,3 +666,38 @@ extension NSDictionary: SelectAttributesResultType {
|
||||
return result as! [[String: Any]]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// MARK: - Deprecated
|
||||
|
||||
@available(*, deprecated, message: """
|
||||
Legacy `Value.*`, `Transformable.*`, and `Relationship.*` declarations will soon be obsoleted. Please migrate your models and stores to new models that use `@Field.*` property wrappers. See: https://github.com/JohnEstropia/CoreStore?tab=readme-ov-file#new-field-property-wrapper-syntax
|
||||
""")
|
||||
extension Select where O: CoreStoreObject, T: ImportableAttributeType {
|
||||
|
||||
public init(_ keyPath: KeyPath<O, ValueContainer<O>.Required<T>>) {
|
||||
|
||||
self.init(.attribute(keyPath))
|
||||
}
|
||||
|
||||
public init(_ keyPath: KeyPath<O, ValueContainer<O>.Optional<T>>) {
|
||||
|
||||
self.init(.attribute(keyPath))
|
||||
}
|
||||
}
|
||||
|
||||
@available(*, deprecated, message: """
|
||||
Legacy `Value.*`, `Transformable.*`, and `Relationship.*` declarations will soon be obsoleted. Please migrate your models and stores to new models that use `@Field.*` property wrappers. See: https://github.com/JohnEstropia/CoreStore?tab=readme-ov-file#new-field-property-wrapper-syntax
|
||||
""")
|
||||
extension Select where O: CoreStoreObject, T: ImportableAttributeType & NSCoding & NSCopying {
|
||||
|
||||
public init(_ keyPath: KeyPath<O, TransformableContainer<O>.Required<T>>) {
|
||||
|
||||
self.init(.attribute(keyPath))
|
||||
}
|
||||
|
||||
public init(_ keyPath: KeyPath<O, TransformableContainer<O>.Optional<T>>) {
|
||||
|
||||
self.init(.attribute(keyPath))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user