feat(resolvespec): add 'contains' operator for array overlap

* Implemented 'contains' operator using BuildArrayOverlapCondition for real array containment.
* Updated documentation to clarify differences between text-cast ILIKE and array overlap.
This commit is contained in:
2026-08-10 15:01:23 +02:00
parent 16cc7d350e
commit c60565e4e0
6 changed files with 208 additions and 90 deletions
+1 -1
View File
@@ -88,7 +88,7 @@ This will match any records where the column contains the search term (case-inse
Search with specific operators (AND logic).
**Supported Operators:**
- `contains` - Contains substring (case-insensitive)
- `contains` - Contains substring (case-insensitive). Implemented as `CAST(col AS TEXT) ILIKE '%value%'` for every column type, including arrays (stringifies the array, then substring-matches). **Not** array containment — no GIN index use, and can false-positive on partial matches within array elements. resolvespec (a different spec package in this repo) defines `contains` differently: real PostgreSQL array-overlap (`&&`). Don't assume the two behave the same.
- `beginswith` / `startswith` - Starts with (case-insensitive)
- `endswith` - Ends with (case-insensitive)
- `equals` / `eq` - Exact match
+2
View File
@@ -96,6 +96,8 @@ X-Limit: 50
**Available Operators**: `eq`, `neq`, `gt`, `gte`, `lt`, `lte`, `contains`, `startswith`, `endswith`, `between`, `betweeninclusive`, `in`, `empty`, `notempty`
> Note: `contains` here is a text-cast ILIKE substring match (works on any column type, including arrays, by stringifying first) — not array containment. resolvespec's `contains` operator has different semantics (real array overlap). See [HEADERS.md](HEADERS.md) for details.
For complete header documentation, see [HEADERS.md](HEADERS.md).
## Lifecycle Hooks