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))
)

FetchChainableBuilderType

FetchChainBuilder

  • Adds a Where clause to the FetchChainBuilder

    Declaration

    Swift

    public func `where`(_ clause: Where<O>) -> FetchChainBuilder<O>

    Parameters

    clause

    a Where clause to add to the fetch builder

    Return Value

    a new FetchChainBuilder containing the Where clause

  • Creates a FetchChainBuilder that ANDs the specified Where 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 a FetchChainBuilder with

    Return Value

    a FetchChainBuilder that ANDs the specified Where clauses

  • Creates a FetchChainBuilder that ORs the specified Where 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 a FetchChainBuilder with

    Return Value

    a FetchChainBuilder that ORs the specified Where clauses

  • Adds a Where clause to the FetchChainBuilder

    Declaration

    Swift

    public func `where`(format: String, _ args: Any...) -> FetchChainBuilder<O>

    Parameters

    format

    the format string for the predicate

    args

    the arguments for format

    Return Value

    a new FetchChainBuilder containing the Where clause

  • Adds a Where clause to the FetchChainBuilder

    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 the Where clause

  • Adds an OrderBy clause to the FetchChainBuilder

    Declaration

    Swift

    public func orderBy(_ clause: OrderBy<O>) -> FetchChainBuilder<O>

    Parameters

    clause

    the OrderBy clause to add

    Return Value

    a new FetchChainBuilder containing the OrderBy clause

  • Adds an OrderBy clause to the FetchChainBuilder

    Declaration

    Swift

    public func orderBy(_ sortKey: OrderBy<O>.SortKey, _ sortKeys: OrderBy<O>.SortKey...) -> FetchChainBuilder<O>

    Parameters

    sortKey

    a single SortKey

    sortKeys

    a series of other SortKeys

    Return Value

    a new FetchChainBuilder containing the OrderBy clause

  • Adds an OrderBy clause to the FetchChainBuilder

    Declaration

    Swift

    public func orderBy(_ sortKeys: [OrderBy<O>.SortKey]) -> FetchChainBuilder<O>

    Parameters

    sortKeys

    a series of SortKeys

    Return Value

    a new FetchChainBuilder containing the OrderBy clause

  • Adds a Tweak clause to the FetchChainBuilder with a closure where the NSFetchRequest may be configured

    Declaration

    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 the Tweak clause

  • Appends a FetchClause to the FetchChainBuilder

    Declaration

    Swift

    public func appending(_ clause: FetchClause) -> FetchChainBuilder<O>

    Parameters

    clause

    the FetchClause to add to the FetchChainBuilder

    Return Value

    a new FetchChainBuilder containing the FetchClause

  • Appends a series of FetchClauses to the FetchChainBuilder

    Declaration

    Swift

    public func appending<S>(contentsOf clauses: S) -> FetchChainBuilder<O> where S : Sequence, S.Element == FetchClause

    Parameters

    clauses

    the FetchClauses to add to the FetchChainBuilder

    Return Value

    a new FetchChainBuilder containing the FetchClauses