-
Notifications
You must be signed in to change notification settings - Fork 568
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
statement expects 0 inputs; got 1 while using sql.NamedArgs #22
Comments
Hi, full features Go 1.8 is't supported of current driver version. I'll be add NamedArgs support in the next couple of days thank you |
thanks @kshvakov. I tested the changes on 2 places and it worked. Code is 👍 too. |
The code rows, err = connect.Query("SELECT * FROM example WHERE os_id = @os_id AND browser_id = @os_id", sql.Named("os_id", 10)) fails with
I didn't find any specific recommendation on how this should work and there are no tests for this specific case on the sql package but it feels it should work. |
Thanks @kshvakov that was fast. But this rows, err = connect.Query("SELECT * FROM example WHERE os_id in (@os_id,@browser_id) browser_id = @browser_id", sql.Named("os_id", 10), sql.Named("browser_id", 77)) (note the lack of space between breaks with the message
And with the space between the parameters rows, err = connect.Query("SELECT * FROM example WHERE os_id IN (@os_id, @browser_id) AND browser_id = @browser_id", sql.Named("os_id", 10), sql.Named("browser_id", 77)) I get a different error:
|
Yes, I know. I'll fix this problem in the next couple of days |
I just tested the new code with a bunch of use cases and it looks good. 👍 |
On go 1.8 the sql package started to support NamedArgs.
I just tried to add
to the simple.go example and got the error
The text was updated successfully, but these errors were encountered: