-
Notifications
You must be signed in to change notification settings - Fork 461
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
Where condition placeholder #363
Comments
Hey! For example: testQuery := sq.Select("test").
From("test").
Where("? = ?", 1, 2)
query, args, err := testQuery.ToSql()
fmt.Printf("query: %s\n", query)
fmt.Printf("args: %v\n", args) query: SELECT test FROM test WHERE ? = ?
args: [1 2] This is the error I get. *errors.errorString have no arg for param ? at position 1 This doesn't happen with |
Turns out I was not passing |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I noticed something weird why can't we use ? in column name?
sql, args, err := sb.Select("test").Where("y = ?", 2).ToSql()
OKbut
sql, args, err := sb.Select("test").Where("? = ?","y", 2).ToSql()
error
this also happens in sq.Expr
The text was updated successfully, but these errors were encountered: