overlaps method

PostgrestFilterBuilder overlaps(
  1. String column,
  2. dynamic value
)

Finds all rows whose array or range value on the stated column overlaps (has a value in common) with the specified value.

postgrest.from('users').select().overlaps('age_range', '[2,25)')

Implementation

PostgrestFilterBuilder overlaps(String column, dynamic value) {
  if (value is String) {
    // range types can be inclusive '[', ']' or exclusive '(', ')' so just
    // keep it simple and accept a string
    appendSearchParams(column, 'ov.$value');
  } else if (value is List) {
    // array
    appendSearchParams(column, 'ov.(${_cleanFilterArray(value)})');
  }
  return this;
}