Skip to content

feat: [#358] Implement Value, Offset, Limit methods#941

Merged
hwbrzzl merged 3 commits intomasterfrom
bowen/#358-16
Mar 5, 2025
Merged

feat: [#358] Implement Value, Offset, Limit methods#941
hwbrzzl merged 3 commits intomasterfrom
bowen/#358-16

Conversation

@hwbrzzl
Copy link
Contributor

@hwbrzzl hwbrzzl commented Mar 5, 2025

📑 Description

goravel/goravel#358

✅ Checks

  • Added test cases for my code

Copilot AI review requested due to automatic review settings March 5, 2025 11:01
@hwbrzzl hwbrzzl requested a review from a team as a code owner March 5, 2025 11:01
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 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
Copy link

codecov bot commented Mar 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.16%. Comparing base (dfecd6c) to head (fa2d2fe).
Report is 1 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

@hwbrzzl hwbrzzl merged commit 66b7b71 into master Mar 5, 2025
11 of 13 checks passed
@hwbrzzl hwbrzzl deleted the bowen/#358-16 branch March 5, 2025 11:11
almas-x pushed a commit that referenced this pull request Mar 12, 2025
* feat: [#358] Implement Value, Offset, Limit methods

* chore: update mocks

* optimize

---------

Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com>
almas-x pushed a commit that referenced this pull request Mar 18, 2025
* feat: [#358] Implement Value, Offset, Limit methods

* chore: update mocks

* optimize

---------

Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com>
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.

2 participants