I'm using Go-pg and when I use the following way to execute sql query:
db.Query(&result, sqlQuery, params)
where params
is a structure like the following:
type MyParams struct {
Codes []int
}
and sqlQuery
is
SELECT id FROM bar WHERE code_id IN (?codes)
in the actual SQL query I get query like this:
SELECT id FROM bar WHERE code_id IN ('[7,45]')
Is it possible to have int array placeholder passed properly to have a query:
SELECT id FROM bar WHERE code_id IN (7,45)