Repository navigation
fix(postgrest): enforce array value type for array columns in contains and containedBy - #2793
Roshanraj2580 wants to merge 1 commit into
Conversation
…s and containedBy
|
No actionable comments were generated in the recent review.
|
| Objective | Addressed | Explanation |
|---|---|---|
Make .contains() value types specific to the column type, including array columns [#435] |
✅ |
Priority:
Change: Bug fix · Severity of issue fixed: Low
Merge Risk: 
Minimal · up to d0e5b
-
No merge-blocking issue is identified; the type changes are ready for normal checks.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
Problem
Fixes supabase/postgrest-js#435
In PostgrestFilterBuilder, .contains() and .containedBy() previously accepted string | ReadonlyArray<Row[ColumnName]> | Record<string, unknown>.
When querying an array column (e.g. uuid[] or string[]), passing a single string was accepted by TypeScript without error, but failed at runtime in PostgreSQL with error 22P02: malformed array literal because PostgREST requires array syntax cs.{...}. Additionally, ReadonlyArray<Row[ColumnName]> typed an array-of-arrays ((T[])[]) rather than T[], and the duplicate fallback overload silently masked type mismatches.
Solution
eadonly Element[] (preventing raw strings or objects).
Checklist