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
Consider 3 examples:
[]int64
.OrderBy(db.Raw("CASE WHEN id IN ? THEN 0 ELSE 1 END", []int64{1000, 2000})
.OrderBy(db.Raw("CASE WHEN id IN ? THEN 0 ELSE 1 END", []int64{1000})
.OrderBy(db.Raw("CASE WHEN id IN ? THEN 0 ELSE 1 END", []int64{})
All 3 generate the same, correct SQL: ORDER BY CASE WHEN id IN $3 THEN 0 ELSE 1 END
ORDER BY CASE WHEN id IN $3 THEN 0 ELSE 1 END
1st example is correct and works
2nd example passes the only element of the slice instead of the slice
3rd example does not pass the argument at all
The text was updated successfully, but these errors were encountered:
Fix handling of slice parameters. Closes #279
ddf461a
Merge pull request #281 from upper/issue-279
c267726
Merge pull request #290 from upper/issue-279
f5ea7a4
No branches or pull requests
Consider 3 examples:
[]int64
with 2 elements as argument.OrderBy(db.Raw("CASE WHEN id IN ? THEN 0 ELSE 1 END", []int64{1000, 2000})
[]int64
with 1 element as argument.OrderBy(db.Raw("CASE WHEN id IN ? THEN 0 ELSE 1 END", []int64{1000})
[]int64
with 0 elements as argument.OrderBy(db.Raw("CASE WHEN id IN ? THEN 0 ELSE 1 END", []int64{})
All 3 generate the same, correct SQL:
ORDER BY CASE WHEN id IN $3 THEN 0 ELSE 1 END
1st example is correct and works
2nd example passes the only element of the slice instead of the slice
3rd example does not pass the argument at all
The text was updated successfully, but these errors were encountered: