Skip to content

Revert "feat: [#646] The Where function of Orm supports func condition"#985

Merged
almas-x merged 1 commit intomasterfrom
revert-975-almas/#646
Apr 2, 2025
Merged

Revert "feat: [#646] The Where function of Orm supports func condition"#985
almas-x merged 1 commit intomasterfrom
revert-975-almas/#646

Conversation

@almas-x
Copy link
Contributor

@almas-x almas-x commented Apr 2, 2025

Reverts #975

Copilot AI review requested due to automatic review settings April 2, 2025 07:23
@almas-x almas-x requested a review from a team as a code owner April 2, 2025 07:23
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.

Pull Request Overview

This PR reverts the feature implementation that allowed the Orm's Where function to support functional conditions.

  • Removed tests validating function-based conditions in query_test.go.
  • Removed conditional logic in query.go that handled function-type conditions.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tests/query_test.go Removed tests for function type conditions in Where.
database/gorm/query.go Removed function condition handling in Where.
Comments suppressed due to low confidence (2)

tests/query_test.go:3212

  • The removed test case for handling function conditions reduces the test coverage for the Where function; please confirm that this behavior is intended and that no consumers rely on this functionality.
var user5 User

database/gorm/query.go:926

  • The removal of this block that handled function-based conditions may impact modules relying on this behavior; verify that reverting this functionality doesn't introduce unintended side effects.
if scope, ok := query.(func(contractsorm.Query) contractsorm.Query); ok {

@almas-x almas-x closed this Apr 2, 2025
@almas-x almas-x reopened this Apr 2, 2025
Copy link
Contributor

@hwbrzzl hwbrzzl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@codecov
Copy link

codecov bot commented Apr 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.04%. Comparing base (47e6f78) to head (c948388).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #985   +/-   ##
=======================================
  Coverage   70.04%   70.04%           
=======================================
  Files         168      168           
  Lines       11353    11353           
=======================================
  Hits         7952     7952           
  Misses       3050     3050           
  Partials      351      351           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@almas-x almas-x merged commit 9bc11ed into master Apr 2, 2025
22 of 24 checks passed
@almas-x almas-x deleted the revert-975-almas/#646 branch April 2, 2025 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants