feat(restheadspec): add x-searchop-notcontain operator

Maps notcontain/notcontains/notlike to a not_ilike filter rendered as
(col IS NULL OR CAST(col AS TEXT) NOT ILIKE ?), so NULL rows are kept.
This commit is contained in:
Hein
2026-10-12 15:56:42 +02:00
parent d3252f3d02
commit 5dbe187915
6 changed files with 55 additions and 2 deletions
+5
View File
@@ -93,6 +93,11 @@ func TestBuildJSONFilterCondition(t *testing.T) {
wantCond: `("data" #>> ?::text[]) ILIKE ?`,
wantArgs: []interface{}{"{city}", "%la%"},
},
{
name: "not_ilike repeats bound path", token: "data->>'city'", operator: "not_ilike", value: "%la%",
wantCond: `(("data" #>> ?::text[]) IS NULL OR ("data" #>> ?::text[]) NOT ILIKE ?)`,
wantArgs: []interface{}{"{city}", "{city}", "%la%"},
},
{
name: "in", token: "data->>'tier'", operator: "in", value: []string{"a", "b"},
wantCond: `("data" #>> ?::text[]) IN (?,?)`,