Skip to content
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

sortBy a VirtualColumn broken in pgsql #997

Open
Helveg opened this issue Oct 4, 2024 · 0 comments · May be fixed by #998
Open

sortBy a VirtualColumn broken in pgsql #997

Helveg opened this issue Oct 4, 2024 · 0 comments · May be fixed by #998

Comments

@Helveg
Copy link
Collaborator

Helveg commented Oct 4, 2024

Due to an upstream issue in TypeORM sorting by home.countCat is broken in pgSQL:

for SELECT DISTINCT, ORDER BY expressions must appear in select list
QueryFailedError: for SELECT DISTINCT, ORDER BY expressions must appear in select list
    at PostgresQueryRunner.query (C:\Users\pwd06\git\nestjs-paginate\src\driver\postgres\PostgresQueryRunner.ts:299:19)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at SelectQueryBuilder.loadRawResults (C:\Users\pwd06\git\nestjs-paginate\src\query-builder\SelectQueryBuilder.ts:3800:25)
    at SelectQueryBuilder.getRawMany (C:\Users\pwd06\git\nestjs-paginate\src\query-builder\SelectQueryBuilder.ts:1626:29)
    at SelectQueryBuilder.executeEntitiesAndRawResults (C:\Users\pwd06\git\nestjs-paginate\src\query-builder\SelectQueryBuilder.ts:3467:34)
    at SelectQueryBuilder.getManyAndCount (C:\Users\pwd06\git\nestjs-paginate\src\query-builder\SelectQueryBuilder.ts:1873:36)
    at paginate (C:\Users\pwd06\git\nestjs-paginate\src\paginate.ts:393:32)
    at Object.<anonymous> (C:\Users\pwd06\git\nestjs-paginate\src\paginate.spec.ts:668:24)

Since the last commit in TypeORM is 7 months ago, it has 2k open issues, and 150 open PRs, I think it's fair to say that it is unmaintained.

I have my own fork of typeorm, where I have fixes related to virtual columns, including for this issue. We can switch back to the original TypeORM repository if their maintenance ever picks up again.

Since TypeORM is a peerDependency of ours, I'm not sure how we best explain/nudge to our users that they should install the fork @helveg/typeorm, instead of typeorm itself. Probably best to just leave a note in our README, and to leave a note on fixed upstream issues here that we're closing them because they're fixed in my fork

@Helveg Helveg linked a pull request Oct 4, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant