diff --git a/Sources/KeyPath+Querying.swift b/Sources/KeyPath+Querying.swift index 3082303..16ac974 100644 --- a/Sources/KeyPath+Querying.swift +++ b/Sources/KeyPath+Querying.swift @@ -76,17 +76,6 @@ public func == (_ key return Where(keyPath._kvcKeyPathString!, isEqualTo: value) } -/** - Creates a `Where` clause by comparing if a property is equal to a value - ``` - let person = CoreStore.fetchOne(From().where(\.nickname == nil)) - ``` - */ -public func == (_ keyPath: KeyPath>, _ null: Void?) -> Where { - - return Where("%K == nil", keyPath._kvcKeyPathString!) -} - /** Creates a `Where` clause by comparing if a property is not equal to a value ``` @@ -98,17 +87,6 @@ public func != (_ key return !Where(keyPath._kvcKeyPathString!, isEqualTo: value) } -/** - Creates a `Where` clause by comparing if a property is not equal to a value - ``` - let person = CoreStore.fetchOne(From().where(\.nickname != nil)) - ``` - */ -public func != (_ keyPath: KeyPath>, _ null: Void?) -> Where { - - return Where("%K != nil", keyPath._kvcKeyPathString!) -} - /** Creates a `Where` clause by checking if a sequence contains the value of a property ``` @@ -188,17 +166,6 @@ public func < (_ key } } -/** - Creates a `Where` clause by comparing if a property is less than a value - ``` - let person = CoreStore.fetchOne(From().where(\.age < 20)) - ``` - */ -public func < (_ keyPath: KeyPath>, _ null: Void?) -> Where { - - return Where("%K < nil", keyPath._kvcKeyPathString!) -} - /** Creates a `Where` clause by comparing if a property is greater than a value ``` @@ -217,17 +184,6 @@ public func > (_ key } } -/** - Creates a `Where` clause by comparing if a property is greater than a value - ``` - let person = CoreStore.fetchOne(From().where(\.age > nil)) - ``` - */ -public func > (_ keyPath: KeyPath>, _ null: Void?) -> Where { - - return Where("%K > nil", keyPath._kvcKeyPathString!) -} - /** Creates a `Where` clause by comparing if a property is less than or equal to a value ``` @@ -246,17 +202,6 @@ public func <= (_ ke } } -/** - Creates a `Where` clause by comparing if a property is less than or equal to a value - ``` - let person = CoreStore.fetchOne(From().where(\.age <= nil)) - ``` - */ -public func <= (_ keyPath: KeyPath>, _ null: Void?) -> Where { - - return Where("%K <= nil", keyPath._kvcKeyPathString!) -} - /** Creates a `Where` clause by comparing if a property is greater than or equal to a value ``` @@ -275,17 +220,6 @@ public func >= (_ ke } } -/** - Creates a `Where` clause by comparing if a property is greater than or equal to a value - ``` - let person = CoreStore.fetchOne(From().where(\.age >= nil)) - ``` - */ -public func >= (_ keyPath: KeyPath>, _ null: Void?) -> Where { - - return Where("%K >= nil", keyPath._kvcKeyPathString!) -} - // MARK: - KeyPath where Root: NSManagedObject, Value: NSManagedObject @@ -328,7 +262,7 @@ public func ~= (_ sequence: let dog = CoreStore.fetchOne(From().where(\.master == john)) ``` */ -public func == (_ keyPath: KeyPath, _ objectID: NSManagedObjectID?) -> Where { +public func == (_ keyPath: KeyPath, _ objectID: NSManagedObjectID) -> Where { return Where(keyPath._kvcKeyPathString!, isEqualTo: objectID) } @@ -339,7 +273,7 @@ public func == (_ keyPath: KeyPath let dog = CoreStore.fetchOne(From().where(\.master != john)) ``` */ -public func != (_ keyPath: KeyPath, _ objectID: NSManagedObjectID?) -> Where { +public func != (_ keyPath: KeyPath, _ objectID: NSManagedObjectID) -> Where { return !Where(keyPath._kvcKeyPathString!, isEqualTo: objectID) } @@ -369,17 +303,6 @@ public func == (_ keyPath: KeyPath(keyPath._kvcKeyPathString!, isEqualTo: object) } -/** - Creates a `Where` clause by comparing if a property is equal to a value - ``` - let dog = CoreStore.fetchOne(From().where(\.master == nil)) - ``` - */ -public func == (_ keyPath: KeyPath>, _ null: Void?) -> Where { - - return Where("%K == nil", keyPath._kvcKeyPathString!) -} - /** Creates a `Where` clause by comparing if a property is not equal to a value ``` @@ -391,17 +314,6 @@ public func != (_ keyPath: KeyPath(keyPath._kvcKeyPathString!, isEqualTo: object) } -/** - Creates a `Where` clause by comparing if a property is not equal to a value - ``` - let dog = CoreStore.fetchOne(From().where(\.master != nil)) - ``` - */ -public func != (_ keyPath: KeyPath>, _ null: Void?) -> Where { - - return Where("%K != nil", keyPath._kvcKeyPathString!) -} - /** Creates a `Where` clause by checking if a sequence contains a value of a property ``` @@ -419,7 +331,7 @@ public func ~= (_ sequence: let dog = CoreStore.fetchOne(From().where(\.master == john)) ``` */ -public func == (_ keyPath: KeyPath>, _ objectID: NSManagedObjectID?) -> Where { +public func == (_ keyPath: KeyPath>, _ objectID: NSManagedObjectID) -> Where { return Where(keyPath._kvcKeyPathString!, isEqualTo: objectID) } @@ -430,7 +342,7 @@ public func == (_ keyPath: KeyPath().where(\.master != john)) ``` */ -public func != (_ keyPath: KeyPath>, _ objectID: NSManagedObjectID?) -> Where { +public func != (_ keyPath: KeyPath>, _ objectID: NSManagedObjectID) -> Where { return !Where(keyPath._kvcKeyPathString!, isEqualTo: objectID) } @@ -496,17 +408,6 @@ public func == (_ keyPath: KeyPath.Optional>, _ va return Where(O.meta[keyPath: keyPath].keyPath, isEqualTo: value) } -/** - Creates a `Where` clause by comparing if a property is equal to a value - ``` - let person = CoreStore.fetchOne(From().where(\.nickname == nil)) - ``` - */ -public func == (_ keyPath: KeyPath.Optional>, _ null: Void?) -> Where { - - return Where("%K == nil", O.meta[keyPath: keyPath].keyPath) -} - /** Creates a `Where` clause by comparing if a property is not equal to a value ``` @@ -518,17 +419,6 @@ public func != (_ keyPath: KeyPath.Optional>, _ va return !Where(O.meta[keyPath: keyPath].keyPath, isEqualTo: value) } -/** - Creates a `Where` clause by comparing if a property is not equal to a value - ``` - let person = CoreStore.fetchOne(From().where(\.nickname != nil)) - ``` - */ -public func != (_ keyPath: KeyPath.Optional>, _ null: Void?) -> Where { - - return Where("%K != nil", O.meta[keyPath: keyPath].keyPath) -} - /** Creates a `Where` clause by checking if a sequence contains the value of a property ``` @@ -608,17 +498,6 @@ public func < (_ keyPath: KeyPath.Optional>, _ val } } -/** - Creates a `Where` clause by comparing if a property is less than a value - ``` - let person = CoreStore.fetchOne(From().where(\.age < nil)) - ``` - */ -public func < (_ keyPath: KeyPath.Optional>, _ null: Void?) -> Where { - - return Where("%K < nil", O.meta[keyPath: keyPath].keyPath) -} - /** Creates a `Where` clause by comparing if a property is greater than a value ``` @@ -637,17 +516,6 @@ public func > (_ keyPath: KeyPath.Optional>, _ val } } -/** - Creates a `Where` clause by comparing if a property is greater than a value - ``` - let person = CoreStore.fetchOne(From().where(\.age > nil)) - ``` - */ -public func > (_ keyPath: KeyPath.Optional>, _ null: Void?) -> Where { - - return Where("%K > nil", O.meta[keyPath: keyPath].keyPath) -} - /** Creates a `Where` clause by comparing if a property is less than or equal to a value ``` @@ -666,17 +534,6 @@ public func <= (_ keyPath: KeyPath.Optional>, _ va } } -/** - Creates a `Where` clause by comparing if a property is less than or equal to a value - ``` - let person = CoreStore.fetchOne(From().where(\.age <= nil)) - ``` - */ -public func <= (_ keyPath: KeyPath.Optional>, _ null: Void?) -> Where { - - return Where("%K <= nil", O.meta[keyPath: keyPath].keyPath) -} - /** Creates a `Where` clause by comparing if a property is greater than or equal to a value ``` @@ -695,17 +552,6 @@ public func >= (_ keyPath: KeyPath.Optional>, _ va } } -/** - Creates a `Where` clause by comparing if a property is greater than or equal to a value - ``` - let person = CoreStore.fetchOne(From().where(\.age >= nil)) - ``` - */ -public func >= (_ keyPath: KeyPath.Optional>, _ null: Void?) -> Where { - - return Where("%K >= nil", O.meta[keyPath: keyPath].keyPath) -} - // MARK: - KeyPath where Root: CoreStoreObject, Value: RelationshipContainer.ToOne @@ -731,17 +577,6 @@ public func == (_ keyPath: KeyPath.ToOne>, return Where(O.meta[keyPath: keyPath].keyPath, isEqualTo: object) } -/** - Creates a `Where` clause by comparing if a property is equal to a value - ``` - let dog = CoreStore.fetchOne(From().where(\.master == nil)) - ``` - */ -public func == (_ keyPath: KeyPath.ToOne>, _ null: Void?) -> Where { - - return Where("%K == nil", O.meta[keyPath: keyPath].keyPath) -} - /** Creates a `Where` clause by comparing if a property is not equal to a value ``` @@ -764,17 +599,6 @@ public func != (_ keyPath: KeyPath.ToOne>, return !Where(O.meta[keyPath: keyPath].keyPath, isEqualTo: object) } -/** - Creates a `Where` clause by comparing if a property is not equal to a value - ``` - let dog = CoreStore.fetchOne(From().where(\.master != nil)) - ``` - */ -public func != (_ keyPath: KeyPath.ToOne>, _ null: Void?) -> Where { - - return Where("%K != nil", O.meta[keyPath: keyPath].keyPath) -} - /** Creates a `Where` clause by checking if a sequence contains a value of a property ```