-
-
Notifications
You must be signed in to change notification settings - Fork 538
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
Duplicate column in getMany with join + pagination #788
Comments
Same #777 |
+1 same here. |
https://github.com/rewiko/crud let go repo |
Didn't solve for me, using
But it is working on |
Query: { exclude: ['id'] , join: {} } |
Working thx @jongomes !
|
@jongomes -> https://www.npmjs.com/package/@rewiko/crud |
@rodrigo1991 yes, I use him |
This is because in typeorm-service.ts:
one from allowed, one from this.entityPrimaryColumns. |
This is work for me. Thx :) |
Bug Report
getMany throws SQL error when join, limit is used together
it's only throwing an error when trying to get relational data with pagination
Current behavior
throwing SQL error: Duplicate column name:-
"SELECT DISTINCT 'distinctAlias'.'Roles_id' AS 'ids_Roles_id' FROM (SELECT
'Roles'.'id' AS 'Roles_id', 'Roles'.'id' AS 'Roles_id', 'Roles'.
'createdAt' AS 'Roles_createdAt', 'Roles'.'updatedAt' AS 'Roles_updatedAt', 'Roles'.'name' AS 'Roles_name', 'users'.'id' AS 'users_id', 'users'.'id' AS 'users_id', 'users'.'name' AS 'users_name', 'users'.'email' AS 'users_email' FROM 'Roles' 'Roles' LEFT JOIN 'user-roles' 'users_Roles' ON 'users_Roles'.'Role'='Roles'.'id' LEFT JOIN 'User' 'users' ON 'users'.'id'='users_Roles'.'User') 'distinctAlias' ORDER BY 'Roles_id' ASC LIMIT 2",Input Code
Expected behavior
should return
Possible Solution
Tested
It's working with TypeOrm version <= 0.2.45
Reason
maybe because in typeOrm version 0.3.0
Deprecated way of loading entity relations:
Old way of loading entity relations:
New way of loading entity relations:
Environment
The text was updated successfully, but these errors were encountered: