where method

Relation<R, F> where(
  1. Expr<bool?> predicate(
    1. F
    )
)

Adds a SQL predicate to the related rows, ANDed with earlier filters.

A selected relationship filters its returned children, not its parent rows. Use any, none, every, or count in the parent query's where to filter parents. Captured fields must belong to the enclosing SQL scope.

Implementation

Relation<R, F> where(Expr<bool?> Function(F) predicate) {
  final next = predicate(queryFields);
  return copyQuery(
    queryState.copy(predicate: allOf([?queryState.predicate, next])),
  );
}