quickFilterWhereOr method

dynamic quickFilterWhereOr(
  1. String clause,
  2. dynamic value
)

An OR of field ILIKE '%value%' over every comma-separated field in clause — that part is unchanged; multi-field quick search has always been supported here.

Each field is now cast to text first. ILIKE is a text operator, so a numeric or timestamp column made Postgres reject the whole query with operator does not exist: integer ~~* unknown — which is why callers could only ever point quick search at text columns. The cast is a no-op on a text column, and it lets a date be matched by substring ("2026-09-18", or just "09-18").

The value has its single quotes doubled: it is pasted straight into the SQL string, so a search for "O'Brien" used to close the literal early and fail the query.

Implementation

quickFilterWhereOr(String clause, value) {
  final safeValue = value.toString().replaceAll("'", "''");
  final fields =
      clause.split(',').map((f) => f.trim()).where((f) => f.isNotEmpty);
  // Also replaces a substring(length - 3) trim of a trailing " or ".
  return fields.map((f) => '"$f"::text ILIKE \'%$safeValue%\'').join(' or ');
}