Skip to content

Commit

Permalink
add more test case
Browse files Browse the repository at this point in the history
  • Loading branch information
acoshift committed Feb 15, 2024
1 parent 3abf5ae commit 21ea180
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions pgstmt/select_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,22 @@ func TestSelect(t *testing.T) {
`,
[]any{1},
},
{
"array overlap",
pgstmt.Select(func(b pgstmt.SelectStatement) {
b.Columns("*")
b.From("table1")
b.Where(func(b pgstmt.Cond) {
b.Op("tags", "&&", pq.Array([]string{"a", "b"}))
})
}),
`
select *
from table1
where (tags && $1)
`,
[]any{pq.Array([]string{"a", "b"})},
},
}

for _, tC := range cases {
Expand Down

0 comments on commit 21ea180

Please sign in to comment.