-
Notifications
You must be signed in to change notification settings - Fork 40
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
Query orderBy property gets overridden by buildPaginator #63
Comments
From a brief check on the
|
@benjamin658 do you have any suggestions on how to tackle this one? |
Hi @DiogoBatista , |
This PR tries to fix the issue: #42 I haven't merged it since it doesn't have a test case, but maybe you can try it to see if it works. PR is welcome. |
Thank you for the response @benjamin658 I created a PR with a test for the @ruifernando7 fix. Do let me know if the test makes sense and hope @ruifernando7 merges it. PR: ruifernando7#1 |
@benjamin658 I just tested @ruifernando7 and I'm not sure if the fix addresses my issue.
@ruifernand7 code is still using the
@ruifernando7 code allows for column order bys to be passed but not when you have an order by like I will investigate a bit more what we could do to support this use case but do let me know if you have an idea on how to support this. |
Are you using the |
Yes, I am. Below you can find the query I'm trying to use with the paginator.
If I remove them I don't have the error anymore and I can see a SQL command with the But this error makes me think that you shouldn't merge ruifernandes code because it seems that is breaking core functionality. |
It seems to have something to do with the TypeORM bug I mentioned above. |
Hi @benjamin658 Thanks |
There still seems to be issues related to the ordering being overwritten by I don't have time to reproduce an example unfortunately but for now I have ported most of the library to my own custom solution to handle the ordering of built queries. On that note, thanks for library. It has served me well for a long time! |
Hello Benjamin,
First I want to thank you for this awesome library it really speeds up the process of pagination and I've been using for some time.
I have a weird case where the library is overriding the
orderBy
defined in the query.If I log the SQL that this query will create it gives me the intended SQL with the
ORDER BY LOWER("name") ASC
in the end of the SQL.But when I pass the query to the paginator It gets overridden with
ORDER BY "name" ASC
In our case, our database is sorted with case sensitive so we need to introduce the LOWER on the order to ensure that we have a proper order.
I tested this on the new v0.9.1 thinking that your latest release might have fixed it but I still have it.
Is there anything that I'm missing here? Is there a way to make the paginator not override the
orderBy
from the query?The text was updated successfully, but these errors were encountered: