-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Fix select distinct projection with Panache #29121
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks
Does this need to be backported to |
@geoand as it's a bug I vote for backporting it |
Makes sense |
CI doesn't seem to like it as |
This comment has been minimized.
This comment has been minimized.
When trying to run a select distinct query with projection, Panache will lowercase the field names.
d3f1cba
to
9becd8a
Compare
It should be fixed now. Let's wait until CI agrees. It's annoying that panache allows stuff like this:
even if it's wrong. |
We can compute the list of entity fields at build time, inject it somewhere and check this list in all calls to Sort and Parameters. This will have a slight memory impact for storing the cache, not a lot, but adding the check in all possible place would be some work. But is it really worth it ? Such error will pop up at developement time with a clear error message right ? |
This really should be a compilation error.
Yes.
No. If somebody works an a project with unit tests that can be run quickly, this is not a big deal. But in the real world is not always the case. This is something that a good API shouldn't allow. |
To clarify, I don't mean that we have to change Panache right now (that's why I haven't created a separate issue for it). |
@DavideD if the error message is not explicit, then I agree we should investiguate to make the API more robust (if the cost is not too high). |
Fix #29089