Masterminds / squirrel

Fluent SQL generation for golang
Other
6.88k stars 465 forks source link

Question about tuple IN condition #354

Open rolancia opened 1 year ago

rolancia commented 1 year ago

i've read #104

Expr("(name, age) IN ((?, ?), (?, ?))", "Alex", 10, "Douglas", 40)

works well, but i wonder why you did not wrap it as below.

var _ Sqlizer = &TupleIn{}

type TupleIn struct {
    Cols []string
    Vals []any
}

func (t TupleIn) ToSql() (string, []interface{}, error) {
        return Expr(...)
}