FetchChainBuilder
public struct FetchChainBuilder<O> : FetchChainableBuilderType where O : DynamicObject
The fetch builder type used for fetches. A FetchChainBuilder
is created from a From
clause.
let people = source.fetchAll(
From<MyPersonEntity>()
.where(\.age > 18)
.orderBy(.ascending(\.age))
)
-
Declaration
Swift
public typealias ObjectType = O
-
Declaration
Swift
public var from: From<O>
-
Declaration
Swift
public var fetchClauses: [FetchClause]
-
Creates a
FetchChainBuilder
thatAND
s the specifiedWhere
clauses. Use this overload if the compiler cannot infer the types when chaining multiple&&
operators.Declaration
Swift
public func `where`(combineByAnd clauses: Where<O>...) -> FetchChainBuilder<O>
Parameters
clauses
the
Where
clauses to create aFetchChainBuilder
withReturn Value
a
FetchChainBuilder
thatAND
s the specifiedWhere
clauses -
Creates a
FetchChainBuilder
thatOR
s the specifiedWhere
clauses. Use this overload if the compiler cannot infer the types when chaining multiple||
operators.Declaration
Swift
public func `where`(combineByOr clauses: Where<O>...) -> FetchChainBuilder<O>
Parameters
clauses
the
Where
clauses to create aFetchChainBuilder
withReturn Value
a
FetchChainBuilder
thatOR
s the specifiedWhere
clauses -
Adds a
Where
clause to theFetchChainBuilder
Declaration
Swift
public func `where`(format: String, argumentArray: [Any]?) -> FetchChainBuilder<O>
Parameters
format
the format string for the predicate
argumentArray
the arguments for
format
Return Value
a new
FetchChainBuilder
containing theWhere
clause -
Adds a
Tweak
clause to theFetchChainBuilder
with a closure where theNSFetchRequest
may be configuredDeclaration
Swift
public func tweak(_ fetchRequest: @escaping (NSFetchRequest<NSFetchRequestResult>) -> Void) -> FetchChainBuilder<O>
Parameters
fetchRequest
the block to customize the
NSFetchRequest
Return Value
a new
FetchChainBuilder
containing theTweak
clause -
Appends a
FetchClause
to theFetchChainBuilder
Declaration
Swift
public func appending(_ clause: FetchClause) -> FetchChainBuilder<O>
Parameters
clause
the
FetchClause
to add to theFetchChainBuilder
Return Value
a new
FetchChainBuilder
containing theFetchClause
-
Appends a series of
FetchClause
s to theFetchChainBuilder
Declaration
Swift
public func appending<S>(contentsOf clauses: S) -> FetchChainBuilder<O> where S : Sequence, S.Element == FetchClause
Parameters
clauses
the
FetchClause
s to add to theFetchChainBuilder
Return Value
a new
FetchChainBuilder
containing theFetchClause
s