We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello,
This is a note for people with similar problems in future. I used the sqlx.In helper with a postgres driver,
rows, err := db.Query("SELECT * FROM users WHERE level IN ($);", levels)
and kept getting an error
number of bindVars less than number arguments
I only had 1 bindVar so it was puzzling and it seemed correct because I had to use ($1) ($2) etc syntax for postgres.
But it turns out I had to use (?) instead of postgres syntax for bindVar.
So for anyone having this same error and using postgres (or think that doing it is correct), switch to (?) instead for the bindVars.
If it helps I'd be happy to do a PR to add this as a footnote to the user documentation.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello,
This is a note for people with similar problems in future. I used the sqlx.In helper with a postgres driver,
and kept getting an error
I only had 1 bindVar so it was puzzling and it seemed correct because I had to use ($1) ($2) etc syntax for postgres.
But it turns out I had to use (?) instead of postgres syntax for bindVar.
So for anyone having this same error and using postgres (or think that doing it is correct), switch to (?) instead for the bindVars.
If it helps I'd be happy to do a PR to add this as a footnote to the user documentation.
The text was updated successfully, but these errors were encountered: