apex-enterprise-patterns / fflib-apex-common

Common Apex Library supporting Apex Enterprise Patterns and much more!
BSD 3-Clause "New" or "Revised" License
913 stars 518 forks source link

Aggregate SOQL support. #466

Closed Vishal-skywalker closed 1 year ago

Vishal-skywalker commented 1 year ago

The Query factory does not have Aggregate( GROUP BY ) in it. We use aggregate queries quite often in terms of reporting and metrics as of now to my knowledge fflib queryFactory does not support such queries, so we have to write the queries manually which is fine but the Selector class does not look good. So thought I could add the said feature, if its ok.

Solution you'd like I would like to add some methods in the fflib_QueryFactory class to support the above feature.

Already started working on it just for fun, let me know if its something that can be added to the library.

PS:- Thanks for the awesome library.

daveespo commented 1 year ago

Hi @Vishal-skywalker -- thanks for the compliment! Support for Aggregate SOQL is not something we will include in fflib-apex-common. fflib_SObjectSelector and fflib_QueryFactory are both built around querying for SObject record instances.

Specifically:

In short, bending QueryFactory and SObjectSelector to support Aggregate SOQL would create confusion on what's supported and what isn't.

Vishal-skywalker commented 1 year ago

Sure