-
-
Notifications
You must be signed in to change notification settings - Fork 246
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
removed simple+incorrect IN expansion #524
Conversation
in `sql_builder.go` line 91 already calls out to `sqlx.In` to do an expansion that supports multiple IN statements. The removed section duplicated behavior and has a bug between the regex selection and what `strings.Replace` replaces (selects `\(\s*\?\s*\)` but only replaces `\(\?\)`
This constitutes a breaking change. I think it is worth it, but I am There is a work around for people that want the behavior that you can use |
Hello @truesilver92, thanks for your contribution! The description of the PR looks nice but the patch is somewhat odd to me. I will take care of the code tomorrow and will update the result. Also, I am not sure if you want to work on this PR now. Please let me know if you have interest in it, otherwise, I will take it over and will fix it. |
Although the direction of supporting slice as an argument for
Roughly, they look the same, but we need to see them in a logical context. The "removed section" basically do a similar job, but the target statement is totally different. In the SQL Builder, the function takes a whole generated SQL statement so the statement could have multiple
This is a valid point, I would like to file a new PR for this to fix this bug.
Yes, this could be a big breaking change since
Since the method still working smoothly (except for the regex bug), it could be fine if we do not change the current behavior of parsing the statement one more time here. Anyway, I would like to keep this idea for the next major release. Some references:
|
in
sql_builder.go
line 91 already calls out tosqlx.In
to do anexpansion that supports multiple IN statements. The removed section
duplicated behavior and has a bug between the regex selection and what
strings.Replace
replaces (selects\(\s*\?\s*\)
but only replaces\(\?\)