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
FetchChainBuilderthatANDs the specifiedWhereclauses. 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
clausesthe
Whereclauses to create aFetchChainBuilderwithReturn Value
a
FetchChainBuilderthatANDs the specifiedWhereclauses -
Creates a
FetchChainBuilderthatORs the specifiedWhereclauses. 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
clausesthe
Whereclauses to create aFetchChainBuilderwithReturn Value
a
FetchChainBuilderthatORs the specifiedWhereclauses -
Adds a
Whereclause to theFetchChainBuilderDeclaration
Swift
public func `where`(format: String, argumentArray: [Any]?) -> FetchChainBuilder<O>Parameters
formatthe format string for the predicate
argumentArraythe arguments for
formatReturn Value
a new
FetchChainBuildercontaining theWhereclause -
Adds a
Tweakclause to theFetchChainBuilderwith a closure where theNSFetchRequestmay be configuredDeclaration
Swift
public func tweak(_ fetchRequest: @escaping (NSFetchRequest<NSFetchRequestResult>) -> Void) -> FetchChainBuilder<O>Parameters
fetchRequestthe block to customize the
NSFetchRequestReturn Value
a new
FetchChainBuildercontaining theTweakclause -
Appends a
FetchClauseto theFetchChainBuilderDeclaration
Swift
public func appending(_ clause: FetchClause) -> FetchChainBuilder<O>Parameters
clausethe
FetchClauseto add to theFetchChainBuilderReturn Value
a new
FetchChainBuildercontaining theFetchClause -
Appends a series of
FetchClauses to theFetchChainBuilderDeclaration
Swift
public func appending<S>(contentsOf clauses: S) -> FetchChainBuilder<O> where S : Sequence, S.Element == FetchClauseParameters
clausesthe
FetchClauses to add to theFetchChainBuilderReturn Value
a new
FetchChainBuildercontaining theFetchClauses
View on GitHub
FetchChainBuilder Structure Reference