Skip to content

Commit

Permalink
ilike parameter escape workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
danicc097 committed Jun 17, 2023
1 parent 8528d37 commit cb4da11
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions internal/repos/postgresql/xo-templates/tests/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ func TestTrigram_Filters(t *testing.T) {

ctx := context.Background()

// FIXME: replacing $i
ww, err := db.WorkItems(ctx, testPool, db.WithWorkItemFilters(map[string][]any{"description ILIKE '%rome%'": {}}))
ww, err := db.WorkItems(ctx, testPool, db.WithWorkItemFilters(map[string][]any{"description ILIKE '%' || $1 || '%'": {"rome"}}))
assert.NoError(t, err)
assert.Len(t, ww, 1)
assert.Contains(t, *ww[0].Description, "Rome")
Expand Down

0 comments on commit cb4da11

Please sign in to comment.