Relative Content

Tag Archive for postgresqlnestjstypeormaliasnestjs-typeorm

TypeORM Error when using camel case alias in addSelect

I’m using TypeORM and Postgresql .I have 2 entities event and eventParticipant relationship is one-to-many. I want to sort by the number of eventParticipants with booking status so I used addSelect with subQuery but the error QueryFailedError: column “bookingparticipantsortable” does not exist occurred. I could solve it by changing the alias writing from camel case to snack key as follows bookingParticipantSortable -> booking_participant_sortable and everything worked fine.
This is my code: