-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Columns names required in sql during struct batch insert #746
Comments
Mentioned in https://github.com/jmoiron/sqlx/pull/734/files/4b6b69ec278c1fbfafba4336f8c84065b0911029 |
Yes, I have the same error message when using |
Based on @QuangTung97 link in TestFixBounds so i'll have to change how to write it. From |
We see the same issue. Surprising as it seems to be a regression caused by #734 .
There was a #734 (comment) by @w1ck3dg0ph3r which suggested fixing the regex. That sounds like a good solution to me. If not at some kind of usage error would be helpful when teh guard is triggered Lines 247 to 250 in a62bc60
In any case thank you very much for sqlx! |
After some search in repo, i found the solution doing to things: 1 - Remove ";" if exists in query (#690 (comment)) 2 - Do the downgrade to version 1.3.0 |
Inserting single struct without providing columns names in sql works properly:
https://github.com/graaphscom/dbmigrat/blob/7bcb3998b1160ab1a7cd72eeccdfd4d092ae16c1/integrity_test.go#L38-L47
But inserting array of structs without providing columns names will end with error
got 15 parameters but the statement requires 5
. Adding columns names to the sql solves error:https://github.com/graaphscom/dbmigrat/blob/7bcb3998b1160ab1a7cd72eeccdfd4d092ae16c1/integrity_test.go#L85-L90
The text was updated successfully, but these errors were encountered: