Open valdeua opened 1 year ago
Take a look at this project: https://github.com/gid-oss/dataui-nestjs-crud
@valdeua I think this fix is wha you want - https://github.com/rewiko/crud/pull/20
I'm having the same issue. Is there any plan to update this library? Or should be switching to the forked projects?
I have same issue when use limit
in query:
@Crud({
model: {
type: TransactionEntity,
},
routes: {
only: ['getManyBase', 'getOneBase'],
},
query: {
alwaysPaginate: true,
limit: 25,
join: {
deposit: {
eager: true,
},
},
})
// QueryFailedError: ER_DUP_FIELDNAME: Duplicate column name 'TransactionEntity_id'
same issue here , anyone has a solution ?
Bug Report
Current behavior
When I try to join ('eager' type) related entity I received 'Duplicate column name'![Screenshot 2022-11-30 at 12 29 17](https://user-images.githubusercontent.com/7124478/204791925-a992ee92-d377-4de3-838c-c2d9ec205023.png)
[Nest] 39063 - 11/30/2022, 12:11:42 PM ERROR [ExceptionsHandler] Duplicate column name 'Fundraising_id'
Here is an exception:![Screenshot 2022-11-30 at 12 30 56](https://user-images.githubusercontent.com/7124478/204791942-c9fbb959-0ec3-47e8-8f5e-66b2e395b178.png)
I think an important precondition here is: I am trying to get data with ?limit When I tried to get data without limit I didn't have error:![Screenshot 2022-11-30 at 12 31 28](https://user-images.githubusercontent.com/7124478/204792301-e0235998-e821-4370-8a0e-2839406e36cb.png)
Expected behavior
Eagerly joined column without duplication error
What I have tried
I tried aliases but it doesn't help https://github.com/nestjsx/crud/issues/281#issuecomment-566964787 relation field renaming also wasn't helpful
My CRUD example:
Models:
Generated Query example
For Tooling issues:
Packages: