mirror of
https://github.com/bitechdev/ResolveSpec.git
synced 2026-10-14 01:06:28 +00:00
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:
@@ -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 (?,?)`,
|
||||
|
||||
Reference in New Issue
Block a user