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

feat: provide support for groupby #2175

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

aaqilniz
Copy link
Contributor

@aaqilniz aaqilniz commented Dec 28, 2023

This PR enables the loopback-datasource-juggler to add min(), max(), count(), avg() & sum() in the result.

Related PRs:

Checklist

  • Sign off your commits with DCO (Developer Certificate of Origin)
  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • Commit messages are following our guidelines

@coveralls
Copy link

coveralls commented Dec 28, 2023

Pull Request Test Coverage Report for Build 11316630714

Details

  • 35 of 36 (97.22%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 84.737%

Changes Missing Coverage Covered Lines Changed/Added Lines %
lib/dao.js 3 4 75.0%
Totals Coverage Status
Change from base Build 11297099147: 0.02%
Covered Lines: 7316
Relevant Lines: 8323

💛 - Coveralls

nodes = nodes.slice(skip, skip + limit);
if (filter.groupBy) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will require support for connector too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. And it's implemented here.

@@ -272,6 +272,28 @@ describe('crud-with-options', function() {
User.find({limit: 3});
});

it('should allow filter with groupBy, count, max, min, sum & avg', function(done) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add test cases for when there are other filter queries too and limit and offset is also provided ? Basically to confirm whether this feature works with other features together or not. And whether it has any impact there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, @samarpanB. I have added one more test to verify the change with existing filters.

@aaqilniz aaqilniz force-pushed the feat/support-groupby branch 3 times, most recently from de0259c to 720f3c9 Compare September 26, 2024 17:04
siimsams and others added 2 commits September 28, 2024 10:22
…ject

Signed-off-by: Siim Sams <siim.sams@katanamrp.com>
Signed-off-by: Muhammad Aaqil <aaqilcs102@gmail.com>
@aaqilniz aaqilniz force-pushed the feat/support-groupby branch from 720f3c9 to 24bd657 Compare September 28, 2024 05:23
Signed-off-by: Muhammad Aaqil <aaqilcs102@gmail.com>
@aaqilniz aaqilniz force-pushed the feat/support-groupby branch 4 times, most recently from a4872f5 to 757f670 Compare September 28, 2024 05:39
@aaqilniz aaqilniz force-pushed the feat/support-groupby branch from 757f670 to 82da092 Compare October 13, 2024 18:12
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 this pull request may close these issues.

4 participants