Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 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 (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #924 +/- ##
=======================================
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 introduces new query condition methods (e.g. OrWhereBetween, WhereBetween, WhereColumn, etc.), expands the test coverage for query chaining and conditions, and updates the API interfaces and error messages accordingly.
- Added support for various “Where” and “OrWhere” condition methods including BETWEEN, IN, LIKE, and their negations.
- Extended tests in both query_test.go and db_test.go to cover new query condition flows.
- Updated the contracts and error messages to reflect the newly added methods.
Reviewed Changes
| File | Description |
|---|---|
| database/db/query_test.go | Added tests for various OR and WHERE condition methods. |
| tests/table.go | Updated test table schema with new integer columns (weight and height). |
| database/db/query.go | Added new query methods and integrated error checking in query builders. |
| tests/db_test.go | Expanded test coverage for the new condition methods (OrWhere, WhereExists, etc.). |
| contracts/database/db/db.go | Updated the Query interface with new method signatures. |
| tests/models.go | Extended Product model with new fields to support column comparison queries. |
| errors/list.go | Defined new error for invalid argument number in query methods. |
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (2)
database/db/query.go:187
- Consider validating that the 'args' slice contains exactly two elements for the OrWhereBetween condition for consistency with the WhereNotBetween method.
func (r *Query) OrWhereBetween(column string, args []any) db.Query {
errors/list.go:54
- Consider using a numeric format specifier such as %d for the invalid argument number instead of %s to better reflect the expected numeric value.
DatabaseInvalidArgumentNumber = New("invalid argument number: %s, expected %s")
* feat: add some Where methods * chore: update mocks * implement OrWhereNot * implement WhereExists * implement OrWhereColumn * implement WhereRaw * chore: update mocks * add .coderabbit.yaml * fix * fix test --------- Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com>
* feat: add some Where methods * chore: update mocks * implement OrWhereNot * implement WhereExists * implement OrWhereColumn * implement WhereRaw * chore: update mocks * add .coderabbit.yaml * fix * fix test --------- Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com>
📑 Description
goravel/goravel#358
@coderabbitai summary
✅ Checks