feat: [#358] Implement Value, Offset, Limit methods#941
Merged
Conversation
Contributor
There was a problem hiding this comment.
PR Overview
This PR implements the Value, Offset, and Limit methods as described in issue [#358]. The changes update the database query building functionality, add corresponding mocks and interfaces, and extend test coverage for these new features.
- Adds new grammar interfaces and methods for handling offset and limit in queries.
- Updates the Query implementation to delegate to new grammar interfaces where available.
- Enhances tests with new cases for Limit, Offset, and Value behaviors.
Reviewed Changes
| File | Description |
|---|---|
| mocks/database/driver/CompileOffsetGrammar.go | Introduces mocks for CompileOffsetGrammar with Run/Return methods. |
| mocks/database/driver/CompileOrderByGrammar.go | Introduces mocks for CompileOrderByGrammar. |
| mocks/database/driver/CompileLimitGrammar.go | Introduces mocks for CompileLimitGrammar with Run/Return methods. |
| mocks/database/db/Query.go | Adds Value and Offset methods integrated with the grammar interfaces. |
| tests/db_test.go | Adds tests for Limit, Offset, and updates the Value test. |
| database/db/query_test.go | Enhances testing for Limit, Offset and Value functionality. |
| contracts/database/db/db.go | Updates documentation and method comments for Limit and Offset. |
| contracts/database/driver/conditions.go | Updates Conditions structure with the new Offset field and updates field names. |
| contracts/database/driver/grammar.go | Defines new grammar interfaces for offset, order by, and limit compilation. |
| tests/query.go | Uncomments and activates sqlserver test paths. |
| tests/mock_config.go | Updates sqlserver-related mock expectations. |
| database/db/query.go | Refactors query building to use the updated Conditions and grammar interfaces. |
Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #941 +/- ##
=======================================
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. |
almas-x
pushed a commit
that referenced
this pull request
Mar 12, 2025
almas-x
pushed a commit
that referenced
this pull request
Mar 18, 2025
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
goravel/goravel#358
✅ Checks