whereExists method

  1. @override
QueryBuilder whereExists(
  1. QueryCallback callback, {
  2. String boolean = 'and',
  3. bool not = false,
})
inherited

Implementation

@override
QueryBuilder whereExists(
  QueryCallback callback, {
  String boolean = 'and',
  bool not = false,
}) {
  QueryBuilder subQuery = QueryBuilderImpl();
  callback(subQuery);
  String condition = "${not ? 'NOT EXISTS' : 'EXISTS'} (${subQuery.toSql()})";
  _appendCondition(
    condition,
    isOr: (boolean.toLowerCase() == 'or'),
  );
  bindings.addAll(subQuery.getBindings());
  return this;
}