Expression
public struct Expression<T, V> : CustomStringConvertible, KeyPathStringConvertible where T : WhereExpressionTrait
Type-safe keyPath chain usable in query/fetch expressions.
let expression: Where<Pet>.Expression = (\.master ~ \.name)
let owner = dataStack.fetchOne(
From<Pet>().where(expression == "John")
)
-
Currently supports
SingleTarget
andCollectionTarget
.Declaration
Swift
public typealias Trait = T
-
Declaration
Swift
public let cs_keyPathString: String
-
Declaration
Swift
public typealias ObjectType = O
-
Declaration
Swift
public typealias DestinationValueType = V
-
Declaration
Swift
public var description: String { get }
Available where O
: NSManagedObject
, T
== Where<O>.CollectionTarget
, V
: AllowedObjectiveCToManyRelationshipKeyPathValue
-
Creates a
Where.Expression
clause for COUNTlet dogsWithPlaymates = dataStack.fetchAll(From<Dog>().where((\.master ~ \.pets).count() > 1))
Declaration
Swift
public func count() -> Where<O>.Expression<T, Int>
Available where O
: NSManagedObject
, T
== Where<O>.CollectionTarget
, V
: AllowedObjectiveCKeyPathValue
-
Creates a
Where.Expression
clause for ANYlet dogsWithBadNamingSense = dataStack.fetchAll(From<Dog>().where((\.master ~ \.pets ~ \.name).any() > "Spot"))
Declaration
Swift
public func any() -> Where<O>.Expression<T, V>
-
Creates a
Where.Expression
clause for ALLlet allPlaymatePuppies = dataStack.fetchAll(From<Dog>().where((\.master ~ \.pets ~ \.age).all() > 5))
Declaration
Swift
public func all() -> Where<O>.Expression<T, V>
-
Creates a
Where.Expression
clause for NONElet dogs = dataStack.fetchAll(From<Dog>().where((\.master ~ \.pets ~ \.name).any() > "Spot"))
Declaration
Swift
public func none() -> Where<O>.Expression<T, V>
-
Creates a
Where.Expression
clause for COUNTlet dogsWithPlaymates = dataStack.fetchAll(From<Dog>().where((\.master ~ \.pets).count() > 1))
Declaration
Swift
public func count() -> Where<O>.Expression<T, Int>
-
Creates a
Where.Expression
clause for ANYlet dogsWithBadNamingSense = dataStack.fetchAll(From<Dog>().where((\.master ~ \.pets ~ \.name).any() > "Spot"))
Declaration
Swift
public func any() -> Where<O>.Expression<T, V>
-
Creates a
Where.Expression
clause for ALLlet allPlaymatePuppies = dataStack.fetchAll(From<Dog>().where((\.master ~ \.pets ~ \.age).all() > 5))
Declaration
Swift
public func all() -> Where<O>.Expression<T, V>
-
Creates a
Where.Expression
clause for NONElet dogs = dataStack.fetchAll(From<Dog>().where((\.master ~ \.pets ~ \.name).any() > "Spot"))
Declaration
Swift
public func none() -> Where<O>.Expression<T, V>