Should solve https://github.com/bitemyapp/esqueleto/issues/277.
Code assembling DISTINCT ON clause was stripping important part of important nested expressions. It worked well without nested expressions but with them it just cuts by spaces parts with arguments. So for example with COALESCE(val, ?) ASC it splits assembled expression into ["COALESCE(val,", "?)", "ASC"] which causes bad sql for some cases.
I am not sure it is a good solution because I actually don't know is it possible to have other expressions here or not? Please, let me know if you see any other possible issues with that fix. :)
A related test-case is added.
Before submitting your PR, check that you've:
[x] Bumped the version number.
[ ] Ran stylish-haskell and otherwise adhered to the style guide.
After submitting your PR:
[x] Update the Changelog.md file with a link to your PR.
[ ] Check that CI passes (or if it fails, for reasons unrelated to your change, like CI timeouts).
Should solve https://github.com/bitemyapp/esqueleto/issues/277. Code assembling
DISTINCT ON
clause was stripping important part of important nested expressions. It worked well without nested expressions but with them it just cuts by spaces parts with arguments. So for example withCOALESCE(val, ?) ASC
it splits assembled expression into["COALESCE(val,", "?)", "ASC"]
which causes bad sql for some cases.I am not sure it is a good solution because I actually don't know is it possible to have other expressions here or not? Please, let me know if you see any other possible issues with that fix. :)
A related test-case is added.
Before submitting your PR, check that you've:
stylish-haskell
and otherwise adhered to the style guide.After submitting your PR: