You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Automatically support "IN" clause and parameter expansion in select, exec, namedSelect, and namedExec methods #18
Currently, when using the select, exec, namedSelect, and namedExec methods with an "IN" clause, we need to manually call a function to handle the parameter expansion. This can be cumbersome and less user-friendly compared to other ORM libraries like GORM, which automatically handle this.
It would be great if SQLx could automatically support the "IN" clause and parameter expansion in these methods, making it more convenient and easier to use.
Example:
Current usage:
query, args, err:=sqlx.In("SELECT * FROM users WHERE id IN (?)", []int{1, 2, 3})
iferr!=nil {
// handle error
}
query=db.Rebind(query)
rows, err:=db.Query(query, args...)
Desired usage:
rows, err:=db.Select("SELECT * FROM users WHERE id IN (?)", []int{1, 2, 3})
This enhancement would improve the developer experience and make SQLx more competitive with other ORM libraries.
Activity
uvulpos commentedon Aug 18, 2023
Hi @suiriass,
thank you for approaching that, I'll take a look into it later and see what I can do ;)