Repository navigation
Conversation
Align orm.Query with db.Query by adding LeftJoin, RightJoin and CrossJoin with the same signatures. The clauses are prefixed with the join keyword and stored together with Join, so joins are rendered in call order.
Cover LeftJoin, RightJoin and CrossJoin against all drivers, including Count with joins and ToSql/ToRawSql output.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1576 +/- ##
==========================================
+ Coverage 72.91% 73.23% +0.32%
==========================================
Files 412 412
Lines 26893 26897 +4
==========================================
+ Hits 19608 19697 +89
+ Misses 7283 7198 -85
Partials 2 2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
JGamboa
marked this pull request as ready for review
October 18, 2026 23:47
Contributor
Author
|
Review Ready |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📑 Description
Part of goravel/goravel#1000 (joins section). Follows #1575. Roadmap: goravel/goravel#1015
Adds
LeftJoin,RightJoinandCrossJointoorm.Query, with the same signatures asdb.Query:Join, so joins are rendered in call order. The existingJoinkeeps taking the full SQL, unchanged.RIGHT JOINneeds SQLite ≥ 3.39. The driver used in the tests (ncruces/go-sqlite3) embeds 3.50, so it works there.This branch is independent from #1575. Both add the same test import, so whichever merges second needs a trivial rebase.
✅ Checks
TestJoinClausescovers the generated SQL, the bindings and mixed join order.TestLeftJoin,TestRightJoin,TestCrossJoinandTestToSqlWithJoins, includingCountwith joins andToSql/ToRawSql. They pass on Postgres, MySQL, SQLite and SQL Server.