Query

public final class Query : NSObject, BuilderType
extension Query: Mappable

Class that represents a query including filters and sorts.

  • Fields to be included in the results of the query.

    Declaration

    Swift

    public var fields: Set<String>?
  • NSPredicate used to filter records.

    Declaration

    Swift

    public var predicate: NSPredicate? { get set }
  • Array of NSSortDescriptors used to sort records.

    Declaration

    Swift

    public var sortDescriptors: [NSSortDescriptor]?
  • Skip a certain amount of records in the results of the query.

    Declaration

    Swift

    public var skip: Int?
  • Impose a limit of records in the results of the query.

    Declaration

    Swift

    public var limit: Int?
  • Undocumented

    Declaration

    Swift

    public override var description: String { get }
  • Undocumented

    Declaration

    Swift

    public var booleanExpression: BooleanExpression? { get set }
  • Undocumented

    Declaration

    Swift

    public init(_ booleanExpression: BooleanExpression)
  • Default Constructor.

    Declaration

    Swift

    public override convenience required init()
  • Constructor using a NSPredicate to filter records, an array of NSSortDescriptors to sort records and the fields that should be returned.

    Declaration

    Swift

    public convenience init(
        predicate: NSPredicate? = nil,
        sortDescriptors: [NSSortDescriptor]? = nil,
        fields: Set<String>? = nil
    )
  • Constructor using a similar way to construct a NSPredicate.

    Declaration

    Swift

    public convenience init(format: String, _ args: Any...)
  • Constructor using a similar way to construct a NSPredicate.

    Declaration

    Swift

    public convenience init(format: String, args: CVarArg)
  • Constructor using a similar way to construct a NSPredicate.

    Declaration

    Swift

    public convenience init(format: String, argumentArray: [Any]?)
  • Constructor using a similar way to construct a NSPredicate.

    Declaration

    Swift

    public convenience init(format: String, arguments: CVaListPointer)
  • Copy Constructor.

    Declaration

    Swift

    public convenience init(_ query: Query)
  • Copy Constructor.

    Declaration

    Swift

    public convenience init(_ query: Query, _ block: ((Query) -> Void))
  • Declaration

    Swift

    public init?(map: Map)
  • Adds ascending properties to be sorted.

    Declaration

    Swift

    @discardableResult
    public func ascending(_ properties: String...) -> Query
  • Adds descending properties to be sorted.

    Declaration

    Swift

    @discardableResult
    public func descending(_ properties: String...) -> Query
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func sort<Root, Value>(_ keyPath: KeyPath<Root, Value>, ascending: Bool) -> Query
  • Adds ascending properties to be sorted.

    Declaration

    Swift

    @discardableResult
    public func ascending<Root, Value>(_ keyPaths: KeyPath<Root, Value>...) -> Query
  • Adds ascending properties to be sorted.

    Declaration

    Swift

    @discardableResult
    public func descending<Root, Value>(_ keyPaths: KeyPath<Root, Value>...) -> Query
  • Declaration

    Swift

    public func mapping(map: Map)