-
Notifications
You must be signed in to change notification settings - Fork 180
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
Issue with any.between and unnest #501
Comments
@strokyl the extension method I can't find a way to disable it just for |
I also use this method. When I need to apply a "like" filter to an array of strings.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello
My need was to do a filter on a array of integer asserting that one of this integer should be between two values.
My first naive attempt was to use
any.between(start, end)
which compile but result in invalid SQL (postgres does not support between in combination with any).After I tried (also naively)
_.value.unnest.between(start, end)
which even if it doesn't really make sens (missingexists
part) still compile and but therefore result in an invalid SQL query.Then I tried
Query(line.value.unnest).map(_.between(start, end))
which for me make sens and should be the slick translation of how I would handle this issue in RAW SQL. But this also does not translate into correct SQL.I had to go for
Query(line.value.unnest).subquery.map(_.between(start, end))
which compile and work! But the documentation ofsubquery
specify that if one need to use it, it means there is bug in Slick, therefore my ticket. Also I think in a ideal word my first and second naive try should not have compile. But after using slick for a while I have accepted and I think that it would be really hard to make sure that all slick expressions that compile result in valid SQL without killing it expressiveness.Also I open this ticket in
slick-pg| and not
slick` but I am not sure which side is the bug.Here a pseudo test to help understanding the issue better:
The text was updated successfully, but these errors were encountered: