Answer the question
In order to leave comments, you need to log in
GO array in WHERE id IN()?
There is a query db.Query("SELECT * FROM words WHERE id IN ($1);", list)
And also a list slice - []int{75929,77348}
The script gives an error: converting argument $1 type: unsupported type [] int, a slice of int
How to solve the problem?
Answer the question
In order to leave comments, you need to log in
I recommend using an ORM like gorm. He definitely knows how to substitute arrays. Well, with plain queries, the chances of catching sql injection are high
. Otherwise, something like this
https://stackoverflow.com/a/38037586
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question