QueryCondition
public class QueryCondition<E: EntityInspectable & __EntityRelatable>
where E == E.EntityBindingType.EntityType
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 = try personBox.query {
return alcoholRestriction
|| (Person.firstName == "Johnny" && Person.lastName == "Walker")
}.build()
-
The type of entity this query will return.
Declaration
Swift
public typealias EntityType = E