Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable placeholders support in all query builder methods #1

Open
vearutop opened this issue Apr 4, 2016 · 7 comments
Open

Enable placeholders support in all query builder methods #1

vearutop opened this issue Apr 4, 2016 · 7 comments

Comments

@vearutop
Copy link

vearutop commented Apr 4, 2016

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.

@shaxbee
Copy link

shaxbee commented Oct 14, 2016

Can you list all methods that need it? I will try to implement it.

@bbrodriges
Copy link

I'm also desperately in need of args support in GROUP BY and ORDER statements

@shaxbee
Copy link

shaxbee commented May 4, 2017 via email

@elgris
Copy link
Owner

elgris commented May 14, 2017

@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.

@shaxbee
Copy link

shaxbee commented May 14, 2017 via email

@michael2m
Copy link

michael2m commented Sep 6, 2017

How about the FROM clause? E.g. when using derived tables (subqueries in the FROM clause)

@Scukerman
Copy link

Missing placeholders' support for FROM clause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants