Where
public struct Where<O> : WhereClauseType, FetchClause, QueryClause, DeleteClause, Hashable where O : DynamicObject
extension Where: CustomDebugStringConvertible, CoreStoreDebugStringConvertible
The Where
clause specifies the conditions for a fetch or a query.
-
Combines two
Where
predicates together usingAND
operatorDeclaration
Swift
public static func && (left: Where<O>, right: Where<O>) -> Where<O>
-
Combines two
Where
predicates together usingOR
operatorDeclaration
Swift
public static func || (left: Where<O>, right: Where<O>) -> Where<O>
-
Inverts the predicate of a
Where
clause usingNOT
operatorDeclaration
Swift
public prefix static func ! (clause: Where<O>) -> Where<O>
-
Combines two
Where
predicates together usingAND
operator.Declaration
Swift
public static func &&? (left: Where<O>, right: Where<O>?) -> Where<O>
Return Value
left
ifright
isnil
, otherwise equivalent to(left && right)
-
Combines two
Where
predicates together usingAND
operator.Declaration
Swift
public static func &&? (left: Where<O>?, right: Where<O>) -> Where<O>
Return Value
right
ifleft
isnil
, otherwise equivalent to(left && right)
-
Combines two
Where
predicates together usingOR
operator.Declaration
Swift
public static func ||? (left: Where<O>, right: Where<O>?) -> Where<O>
Return Value
left
ifright
isnil
, otherwise equivalent to(left || right)
-
Combines two
Where
predicates together usingOR
operator.Declaration
Swift
public static func ||? (left: Where<O>?, right: Where<O>) -> Where<O>
Return Value
right
ifleft
isnil
, otherwise equivalent to(left || right)
-
Initializes a
Where
clause with a predicate that always evaluates totrue
Declaration
Swift
public init()
-
Initializes a
Where
clause with an existingWhere
clause.Declaration
Swift
public init(_ clause: Where<O>)
Parameters
clause
the existing
Where
clause. -
Initializes a
Where
clause with a predicate that always evaluates to the specified boolean valueDeclaration
Swift
public init(_ value: Bool)
Parameters
value
the boolean value for the predicate
-
Initializes a
Where
clause with a predicate using the specified string format and argumentsDeclaration
Swift
public init(_ format: String, _ args: Any...)
Parameters
format
the format string for the predicate
args
the arguments for
format
-
Initializes a
Where
clause with a predicate using the specified string format and argumentsDeclaration
Swift
public init(_ format: String, argumentArray: [Any]?)
Parameters
format
the format string for the predicate
argumentArray
the arguments for
format
-
Initializes a
Where
clause that compares equality tonil
Declaration
Swift
public init(_ keyPath: KeyPathString, isEqualTo null: Void?)
Parameters
keyPath
the keyPath to compare with
null
the arguments for the
==
operator -
Initializes a
Where
clause that compares equalityDeclaration
Swift
public init<V>(_ keyPath: KeyPathString, isEqualTo value: V) where V : FieldStorableType
Parameters
keyPath
the keyPath to compare with
value
the arguments for the
==
operator -
Initializes a
Where
clause that compares equalityDeclaration
Swift
@_disfavoredOverload public init<U>(_ keyPath: KeyPathString, isEqualTo value: U?) where U : QueryableAttributeType
Parameters
keyPath
the keyPath to compare with
value
the arguments for the
==
operator -
Initializes a
Where
clause that compares equalityDeclaration
Swift
public init<Other>(_ keyPath: KeyPathString, isEqualTo object: Other?) where Other : DynamicObject
Parameters
keyPath
the keyPath to compare with
object
the arguments for the
==
operator -
Initializes a
Where
clause that compares equalityDeclaration
Swift
public init(_ keyPath: KeyPathString, isEqualTo objectID: NSManagedObjectID)
Parameters
keyPath
the keyPath to compare with
objectID
the arguments for the
==
operator -
Initializes a
Where
clause that compares membershipDeclaration
Swift
public init<S>(_ keyPath: KeyPathString, isMemberOf list: S) where S : Sequence, S.Element : FieldStorableType
Parameters
keyPath
the keyPath to compare with
list
the sequence to check membership of
-
Initializes a
Where
clause that compares membershipDeclaration
Swift
@_disfavoredOverload public init<S>(_ keyPath: KeyPathString, isMemberOf list: S) where S : Sequence, S.Element : QueryableAttributeType
Parameters
keyPath
the keyPath to compare with
list
the sequence to check membership of
-
Initializes a
Where
clause that compares membershipDeclaration
Swift
public init<S>(_ keyPath: KeyPathString, isMemberOf list: S) where S : Sequence, S.Element : DynamicObject
Parameters
keyPath
the keyPath to compare with
list
the sequence to check membership of
-
Initializes a
Where
clause that compares membershipDeclaration
Swift
public init<S>(_ keyPath: KeyPathString, isMemberOf list: S) where S : Sequence, S.Element : NSManagedObjectID
Parameters
keyPath
the keyPath to compare with
list
the sequence to check membership of
-
Declaration
Swift
public let predicate: NSPredicate
-
Declaration
Swift
public init(_ predicate: NSPredicate)
-
Declaration
Swift
public typealias ObjectType = O
-
Declaration
Swift
public static func == (lhs: Where, rhs: Where) -> Bool
-
Declaration
Swift
public func hash(into hasher: inout Hasher)
-
Declaration
Swift
public var debugDescription: String { get }
-
Type-safe keyPath chain usable in query/fetch expressions.
See morelet expression: Where<Pet>.Expression = (\.master ~ \.name) let owner = dataStack.fetchOne( From<Pet>().where(expression == "John") )
Declaration
Swift
public struct Expression<T, V> : CustomStringConvertible, KeyPathStringConvertible where T : WhereExpressionTrait
-
Used only for
Where.Expression
type constraints. Specifies that thisWhere.Expression
type pertains to an attribute property expression.Declaration
Swift
public enum SingleTarget : WhereExpressionTrait
-
Used only for
Where.Expression
type constraints. Specifies that thisWhere.Expression
type pertains to a to-many relationship expression.Declaration
Swift
public enum CollectionTarget : WhereExpressionTrait
-
Initializes a
Where
clause that compares equality tonil
Declaration
Swift
public init<V>(_ keyPath: KeyPath<O, V>, isEqualTo null: Void?) where V : QueryableAttributeType
Parameters
keyPath
the keyPath to compare with
null
the arguments for the
==
operator -
Initializes a
Where
clause that compares equality tonil
Declaration
Swift
public init<D>(_ keyPath: KeyPath<O, D>, isEqualTo null: Void?) where D : DynamicObject
Parameters
keyPath
the keyPath to compare with
null
the arguments for the
==
operator -
Initializes a
Where
clause that compares equalityDeclaration
Swift
public init<V>(_ keyPath: KeyPath<O, V>, isEqualTo value: V?) where V : QueryableAttributeType
Parameters
keyPath
the keyPath to compare with
value
the arguments for the
==
operator -
Initializes a
Where
clause that compares equalityDeclaration
Swift
public init<D>(_ keyPath: KeyPath<O, D>, isEqualTo value: D?) where D : DynamicObject
Parameters
keyPath
the keyPath to compare with
value
the arguments for the
==
operator -
Initializes a
Where
clause that compares equalityDeclaration
Swift
public init<D>(_ keyPath: KeyPath<O, D>, isEqualTo objectID: NSManagedObjectID) where D : DynamicObject
Parameters
keyPath
the keyPath to compare with
objectID
the arguments for the
==
operator -
Initializes a
Where
clause that compares membershipDeclaration
Swift
public init<V, S>(_ keyPath: KeyPath<O, V>, isMemberOf list: S) where V : QueryableAttributeType, V == S.Element, S : Sequence
Parameters
keyPath
the keyPath to compare with
list
the sequence to check membership of
-
Initializes a
Where
clause that compares membershipDeclaration
Swift
public init<D, S>(_ keyPath: KeyPath<O, D>, isMemberOf list: S) where D : DynamicObject, D == S.Element, S : Sequence
Parameters
keyPath
the keyPath to compare with
list
the sequence to check membership of
-
Initializes a
Where
clause that compares membershipDeclaration
Swift
public init<D, S>(_ keyPath: KeyPath<D, O>, isMemberOf list: S) where D : DynamicObject, S : Sequence, S.Element : NSManagedObjectID
Parameters
keyPath
the keyPath to compare with
list
the sequence to check membership of
-
Initializes a
Where
clause that compares equalityDeclaration
Swift
public init<V>(_ keyPath: KeyPath<O, FieldContainer<O>.Stored<V>>, isEqualTo value: V) where V : FieldStorableType
Parameters
keyPath
the keyPath to compare with
value
the arguments for the
==
operator -
Initializes a
Where
clause that compares equalityDeclaration
Swift
public init<V>(_ keyPath: KeyPath<O, FieldContainer<O>.Relationship<V>>, isEqualTo value: V.DestinationObjectType?) where V : FieldRelationshipToOneType
Parameters
keyPath
the keyPath to compare with
value
the arguments for the
==
operator -
Initializes a
Where
clause that compares equality tonil
Declaration
Swift
public init<V>(_ keyPath: KeyPath<O, FieldContainer<O>.Stored<V>>, isEqualTo null: Void?) where V : FieldStorableType
Parameters
keyPath
the keyPath to compare with
null
the arguments for the
==
operator -
Initializes a
Where
clause that compares equality tonil
Declaration
Swift
public init<V>(_ keyPath: KeyPath<O, FieldContainer<O>.Relationship<V>>, isEqualTo null: Void?) where V : FieldRelationshipToOneType
Parameters
keyPath
the keyPath to compare with
null
the arguments for the
==
operator -
Initializes a
Where
clause that compares membershipDeclaration
Swift
public init<V, S>(_ keyPath: KeyPath<O, FieldContainer<O>.Stored<V>>, isMemberOf list: S) where V : FieldStorableType, V == S.Element, S : Sequence
Parameters
keyPath
the keyPath to compare with
list
the sequence to check membership of
-
Initializes a
Where
clause that compares membershipDeclaration
Swift
public init<V, S>(_ keyPath: KeyPath<O, FieldContainer<O>.Relationship<V>>, isMemberOf list: S) where V : FieldRelationshipToOneType, S : Sequence, V.DestinationObjectType == S.Element
Parameters
keyPath
the keyPath to compare with
list
the sequence to check membership of
-
Initializes a
Where
clause that compares membershipDeclaration
Swift
public init<V, S>(_ keyPath: KeyPath<O, FieldContainer<O>.Relationship<V>>, isMemberOf list: S) where V : FieldRelationshipToOneType, S : Sequence, S.Element : NSManagedObjectID
Parameters
keyPath
the keyPath to compare with
list
the sequence to check membership of
-
Initializes a
Where
clause that compares equalityDeclaration
Swift
public init<V>(_ keyPath: KeyPath<O, ValueContainer<O>.Required<V>>, isEqualTo value: V?) where V : ImportableAttributeType
Parameters
keyPath
the keyPath to compare with
value
the arguments for the
==
operator -
Initializes a
Where
clause that compares equalityDeclaration
Swift
public init<V>(_ keyPath: KeyPath<O, ValueContainer<O>.Optional<V>>, isEqualTo value: V?) where V : ImportableAttributeType
Parameters
keyPath
the keyPath to compare with
value
the arguments for the
==
operator -
Initializes a
Where
clause that compares equality tonil
Declaration
Swift
public init<V>(_ keyPath: KeyPath<O, ValueContainer<O>.Optional<V>>, isEqualTo null: Void?) where V : ImportableAttributeType
Parameters
keyPath
the keyPath to compare with
null
the arguments for the
==
operator -
Initializes a
Where
clause that compares equality tonil
Declaration
Swift
public init<D>(_ keyPath: KeyPath<O, RelationshipContainer<O>.ToOne<D>>, isEqualTo null: Void?) where D : CoreStoreObject
Parameters
keyPath
the keyPath to compare with
null
the arguments for the
==
operator -
Initializes a
Where
clause that compares equalityDeclaration
Swift
public init<D>(_ keyPath: KeyPath<O, RelationshipContainer<O>.ToOne<D>>, isEqualTo value: D?) where D : CoreStoreObject
Parameters
keyPath
the keyPath to compare with
value
the arguments for the
==
operator -
Initializes a
Where
clause that compares equalityDeclaration
Swift
public init<D>(_ keyPath: KeyPath<O, RelationshipContainer<O>.ToOne<D>>, isEqualTo objectID: NSManagedObjectID) where D : CoreStoreObject
Parameters
keyPath
the keyPath to compare with
objectID
the arguments for the
==
operator -
Initializes a
Where
clause that compares membershipDeclaration
Swift
public init<V, S>(_ keyPath: KeyPath<O, ValueContainer<O>.Required<V>>, isMemberOf list: S) where V : ImportableAttributeType, V == S.Element, S : Sequence
Parameters
keyPath
the keyPath to compare with
list
the sequence to check membership of
-
Initializes a
Where
clause that compares membershipDeclaration
Swift
public init<V, S>(_ keyPath: KeyPath<O, ValueContainer<O>.Optional<V>>, isMemberOf list: S) where V : ImportableAttributeType, V == S.Element, S : Sequence
Parameters
keyPath
the keyPath to compare with
list
the sequence to check membership of
-
Initializes a
Where
clause that compares membershipDeclaration
Swift
public init<D, S>(_ keyPath: KeyPath<O, RelationshipContainer<O>.ToOne<D>>, isMemberOf list: S) where D : CoreStoreObject, D == S.Element, S : Sequence
Parameters
keyPath
the keyPath to compare with
list
the sequence to check membership of
-
Initializes a
Where
clause that compares membershipDeclaration
Swift
public init<D, S>(_ keyPath: KeyPath<O, RelationshipContainer<O>.ToOne<D>>, isMemberOf list: S) where D : CoreStoreObject, S : Sequence, S.Element : NSManagedObjectID
Parameters
keyPath
the keyPath to compare with
list
the sequence to check membership of
-
Initializes a
Where
clause from a closureDeclaration
Swift
public init(_ condition: (O) -> Where<O>)
Parameters
condition
closure that returns the
Where
clause