Skip to content

feat: [#358] Implement GroupBy, Having, Join methods#935

Merged
hwbrzzl merged 3 commits intomasterfrom
bowen/#358-14
Mar 4, 2025
Merged

feat: [#358] Implement GroupBy, Having, Join methods#935
hwbrzzl merged 3 commits intomasterfrom
bowen/#358-14

Conversation

@hwbrzzl
Copy link
Contributor

@hwbrzzl hwbrzzl commented Mar 4, 2025

📑 Description

goravel/goravel#358

✅ Checks

  • Added test cases for my code

@codecov-commenter
Copy link

codecov-commenter commented Mar 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.16%. Comparing base (3528add) to head (96f973f).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #935   +/-   ##
=======================================
  Coverage   69.16%   69.16%           
=======================================
  Files         157      157           
  Lines       10519    10519           
=======================================
  Hits         7275     7275           
  Misses       2911     2911           
  Partials      333      333           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hwbrzzl hwbrzzl changed the title feat: [#358] Implement GroupBy Having methods feat: [#358] Implement GroupBy, Having, Join methods Mar 4, 2025
@hwbrzzl hwbrzzl marked this pull request as ready for review March 4, 2025 08:09
Copilot AI review requested due to automatic review settings March 4, 2025 08:09
@hwbrzzl hwbrzzl requested a review from a team as a code owner March 4, 2025 08:09
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

PR Overview

This PR implements additional query building methods—GroupBy, Having, and various JOIN clauses (CrossJoin, Join, LeftJoin, RightJoin)—to extend the ORM’s SQL query capabilities. Key changes include:

  • New query methods in the database layer, updating the chaining API for GroupBy/Having and JOIN types.
  • Corresponding mock implementations in both database and ORM mocks.
  • Updated tests to verify the new query methods and integration with existing query semantics.

Reviewed Changes

File Description
database/db/query_test.go Added tests for CrossJoin, GroupBy/Having, Join, LeftJoin, and RightJoin.
mocks/database/db/Query.go Implemented mock functions for CrossJoin, GroupBy, Having, Join, LeftJoin, and RightJoin.
tests/db_test.go Added integration tests exercising the new JOIN and GroupBy/Having methods.
mocks/database/orm/Query.go Updated ORM mock functions to support the new GroupBy method and deprecate Group.
database/gorm/query.go Deprecated the old Group method in favor of GroupBy and updated group building logic.
contracts/database/orm/orm.go Updated the Query interface to deprecate Group and add GroupBy with corresponding documentation.
tests/query_test.go Modified tests to use the new GroupBy and Having methods.
database/db/conditions.go Extended the Conditions struct to include fields for CrossJoin, GroupBy, Having, and RightJoin.
contracts/database/db/db.go Updated the Query interface to document and support the new JOIN and GroupBy/Having methods.
database/gorm/conditions.go Updated the Conditions struct for the GORM implementation to align with new query methods.

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

@hwbrzzl hwbrzzl merged commit 78106ed into master Mar 4, 2025
11 checks passed
@hwbrzzl hwbrzzl deleted the bowen/#358-14 branch March 4, 2025 08:15
almas-x pushed a commit that referenced this pull request Mar 12, 2025
* feat: [#358] Implement GroupBy Having methods

* implement Join methods

* update mock
almas-x pushed a commit that referenced this pull request Mar 18, 2025
* feat: [#358] Implement GroupBy Having methods

* implement Join methods

* update mock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants