sqrl
sqrl copied to clipboard
Enable placeholders support in all query builder methods
Currently only Where
method accepts args
as placeholder values
func (b *SelectBuilder) Where(pred interface{}, args ...interface{}) *SelectBuilder {
b.whereParts = append(b.whereParts, newWherePart(pred, args...))
return b
}
Other methods like GroupBy
can not accept placeholdered data
// GroupBy adds GROUP BY expressions to the query.
func (b *SelectBuilder) GroupBy(groupBys ...string) *SelectBuilder {
b.groupBys = append(b.groupBys, groupBys...)
return b
}
Please add placeholders support to these methods to provide means for building rich SQL statements.
Can you list all methods that need it? I will try to implement it.
I'm also desperately in need of args support in GROUP BY and ORDER statements
I'll look into that :-)
On Thu, Apr 20, 2017, 5:23 PM bbrodriges [email protected] wrote:
I'm also desperately in need of args support in GROUP BY and ORDER statements
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/elgris/sqrl/issues/1#issuecomment-295648788, or mute the thread https://github.com/notifications/unsubscribe-auth/AE_mfVka4ne-Fe9A6y5H9wKfK6MbT309ks5rxyQsgaJpZM4H-vC5 .
@bbrodriges @vearutop How do you see placeholders usage? It would be nice if you provide a couple of examples.
From my point of view GROUP BY
clause (for instance) receives a list of columns and additional options (like ASC
or DESC
). And those can be passed as strings.
Group by is often used with aggregate functions.
On Mon, May 15, 2017, 12:55 AM Ivan Kirichenko [email protected] wrote:
@bbrodriges https://github.com/bbrodriges @vearutop https://github.com/vearutop How do you see placeholders usage? It would be nice if you provide a couple of examples.
From my point of view GROUP BY clause (for instance) receives a list of columns and additional options (like ASC or DESC). And those can be passed as strings.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/elgris/sqrl/issues/1#issuecomment-301325125, or mute the thread https://github.com/notifications/unsubscribe-auth/AE_mfWM9ykhLK7ki8rEPxcFhShUu4XXJks5r5zIDgaJpZM4H-vC5 .
How about the FROM clause? E.g. when using derived tables (subqueries in the FROM clause)
Missing placeholders' support for FROM clause.