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
{{ message }}
Repository navigation
Aggregate builds an invalid query when using typeorm with mssql #436
Describe the bug
When using the aggregate functionality with typeorm connected to a mssql server, the GROUP BY and ORDER BY are not built in a valid way.
To Reproduce
Steps to reproduce the behavior:
Connect using typeorm with the mssql database driver
Setup a DTO to use the aggregate resolver with nestjs-query
Issue a query that returns a groupBy
An error stating the query had an invalid column name will be reported
Expected behavior
The query runs and returns data
Desktop (please complete the following information):
SELECT
"CustomerEntity"."CUSTOMER_CODE" AS "GROUP_BY_code",
COUNT("CustomerEntity"."CUSTOMER_CODE") AS "COUNT_code"
FROM "CUSTOMER" "CustomerEntity"
GROUP BY "GROUP_BY_code"
ORDER BY "GROUP_BY_code" ASC
Mssql only support actual column names in the 'GROUP BY' clause... subsequently the 'ORDER BY' would also then be invalid. The fix would seem to be using the actual column names here.
Activity