QueryCondition

public class QueryCondition<E> where E : Entity

Base representation of conditions of a Query when you use the block-based variant.

The boolean operators && and || use this type directly. You combine two QueryConditions with the boolean operators into a combined condition, forming a tree structure. Conditions that target entity properties, like value comparisons and equality checks, are of type PropertyQueryCondition.

You can form conditions and use them later, like:

let alcoholRestriction: QueryCondition<Person> = Person.age > 18 && Person.age < 80
// ...
let alcoholAllowedQuery = personBox.query {
    return alcoholRestriction
        || (Person.firstName == "Johnny" && Person.lastName == "Walker")
}
  • Undocumented

    Declaration

    Swift

    public typealias EntityType = E