You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a custom query with GROUP BY clause, it will return false number as total
As the current SQL query to get the total number of row is by using a count statement in SQL select, if we are using GROUP BY in our SQL it will return the count in the grouped rows instead of total row count. My workaround solution is by extending the _find function and adding _clearGrouping('group');
in the query for getting count numbers.
Expected behavior
Return count of total row not the count of grouped row.
Actual behavior
It return count of grouped row.
System configuration
Tell us about the applicable parts of your setup.
Module versions (especially the part that's not working): feathers-knex 5.0.4, knex 0.16.3
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Apologies if the issue could not be resolved. FeathersJS ecosystem modules are community maintained so there may be a chance that there isn't anybody available to address the issue at the moment. For other ways to get help see here.
@daffl Are there any plans on fixing this bug anytime soon? If not, are you okay with me making a pull request to fix this? It would be nice to not have to override this service in order to get the correct total. I feel like this should be a fairly easy fix too (I think it's just a matter of adding a clearGroup call when initializing the countQuery variable).
Create a custom query with GROUP BY clause, it will return false number as total
As the current SQL query to get the total number of row is by using a count statement in SQL select, if we are using GROUP BY in our SQL it will return the count in the grouped rows instead of total row count. My workaround solution is by extending the _find function and adding _clearGrouping('group');
in the query for getting count numbers.
Expected behavior
Return count of total row not the count of grouped row.
Actual behavior
It return count of grouped row.
System configuration
Tell us about the applicable parts of your setup.
Module versions (especially the part that's not working): feathers-knex 5.0.4, knex 0.16.3
The text was updated successfully, but these errors were encountered: