typeorm / typeorm

ORM for TypeScript and JavaScript. Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, SAP Hana, WebSQL databases. Works in NodeJS, Browser, Ionic, Cordova and Electron platforms.
http://typeorm.io
MIT License
33.46k stars 6.21k forks source link

Add Group By on entity find #9415

Open enryson opened 1 year ago

enryson commented 1 year ago

Add Group By on entityManager.find operation

Is only possible using QueryBuilder

I preferred workin with entityManager, and would be very nice to have this implemented on. Sequelize and Primsma have this feature, i have more that 40 applications using TypeORM and all of them are using entityManager and we have some components too.

The Solution

make something similar to Sequelize. like:

userRepository.find({ groupBy: "ColumName", })

Considered Alternatives

On my case this implementation will help on my projects, and will benefit new projects. I know that is possible by using query builder, but on my case using repository the implementation is cleaner and more friendly.

Additional Context

On my work i have more that 130 developers that will benefit with this change. with more that 40 projects.

(first request on this project and sorry if my English isn't 100% accurate)

Relevant Database Driver(s)

DB Type Relevant
aurora-mysql no
aurora-postgres no
better-sqlite3 no
cockroachdb no
cordova no
expo no
mongodb no
mysql yes
nativescript no
oracle no
postgres no
react-native no
sap no
spanner no
sqlite no
sqlite-abstract no
sqljs no
sqlserver no

Are you willing to resolve this issue by submitting a Pull Request?

IchabodCrow commented 2 months ago

Hi from 2024. We are still waiting for this feature.

iamludal commented 2 months ago

Up, we definitely need this feature.

SkyZeroZx commented 1 month ago

Up, we definitely need this feature.

chalscc commented 1 month ago

Bump, very needed feature

stouch commented 1 week ago

very needed... an obvious feature

trevor-shepard commented 1 week ago

Would be much appreciated! Probably the main reasons we use createQueryBuilder instead of find methods.