Version: a6b9300 Where statements aren't being transformed into "WHERE IN (?, ...)" statements if the value of a `squirrel.Eq` key is of type `[]uint8`. ### Correct: ```go package main import ( "fmt" "github.com/Masterminds/squirrel" ) func main() { query, args, err := squirrel.Select("*").Where(squirrel.Eq{"test": []uint32{1, 2, 3}}).ToSql() if err != nil { panic(err) } fmt.Println(query) // SELECT * WHERE test IN (?,?,?) fmt.Println(args) // [1 2 3] } ``` ### Bug: ```go package main import ( "fmt" "github.com/Masterminds/squirrel" ) func main() { query, args, err := squirrel.Select("*").Where(squirrel.Eq{"test": []uint8{1, 2, 3}}).ToSql() if err != nil { panic(err) } fmt.Println(query) // SELECT * WHERE test = ? fmt.Println(args) // [[1 2 3]] } ```
Activity
lann commentedon Jan 11, 2018
Squirrel doesn't touch values when
driver.IsValue(value)is true. It looks likebyteis really just an alias foruint8, anddriver.IsValue([]byte{})is true.I don't think this can be fixed backward-compatibly.
hahanein commentedon Jan 11, 2018
Thank you! Maybe you should warn about this pitfall in the README and the docs.
lann commentedon Jan 11, 2018
Good idea. Added an FAQ section with this.
sundowndev commentedon Jun 30, 2026
Wouldn't it be possible to introduce a
squirrel.In{}type ?