Conversation
|
Warning Rate limit exceeded@hwbrzzl has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 19 minutes and 4 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (3)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
| func NewSingleQuery(ctx context.Context, driver driver.Driver, builder db.Builder, logger logger.Logger, table string) *Query { | ||
| query := NewQuery(ctx, driver, builder, logger, table) | ||
| query.single = true | ||
|
|
||
| return query | ||
| } |
There was a problem hiding this comment.
It will be used in .Where(func (query db.Query)).
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #921 +/- ##
=======================================
Coverage 68.82% 68.82%
=======================================
Files 154 154
Lines 10200 10200
=======================================
Hits 7020 7020
Misses 2857 2857
Partials 323 323 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
PR Overview
This PR implements support for nested where conditions in the query builder, allowing developers to compose more complex SQL queries.
- Introduces nested condition handling for both Where and OrWhere
- Adds a NewSingleQuery constructor and a clone method to manage query instance behavior
- Updates test coverage in both query tests and database tests to validate nested where logic
Reviewed Changes
| File | Description |
|---|---|
| database/db/query_test.go | Updates tests to include nested where conditions |
| tests/db_test.go | Adds tests for nested condition handling in product queries |
| database/db/query.go | Adds new query instance handling (NewSingleQuery, clone) and enhances buildWhere to support nested conditions |
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
database/db/query.go:296
- [nitpick] When handling the string case in buildWhere, returning 'sq.Eq{query: where.args}' for multiple args may be unclear. Adding a comment to explain that this branch builds an equality condition intended to translate to an IN clause would improve code clarity.
case string:
| return sq.And(sqlizers), nil | ||
| } | ||
|
|
||
| func (r *Query) clone() *Query { |
There was a problem hiding this comment.
The clone method performs a shallow copy of the conditions by assigning r.conditions directly. If the conditions field is mutable and modified later, it may affect both the original query and its clone. Consider deep copying r.conditions to avoid unintended side effects.
📑 Description
goravel/goravel#358
@coderabbitai summary
✅ Checks