optional<RS> method

QueryBuilder<OBJ, OBJ, RS> optional<RS>(
  1. bool enabled,
  2. QueryOption<OBJ, S, RS> option
)

Only apply a part of the query if enabled is true.

Implementation

QueryBuilder<OBJ, OBJ, RS> optional<RS>(
  bool enabled,
  QueryOption<OBJ, S, RS> option,
) {
  if (enabled) {
    return option(this);
  } else {
    return QueryBuilder._(_query);
  }
}