Skip to content

feat: Some nit optimizations for facades.DB#963

Merged
hwbrzzl merged 8 commits intomasterfrom
bowen/add-statement
Mar 19, 2025
Merged

feat: Some nit optimizations for facades.DB#963
hwbrzzl merged 8 commits intomasterfrom
bowen/add-statement

Conversation

@hwbrzzl
Copy link
Contributor

@hwbrzzl hwbrzzl commented Mar 19, 2025

📑 Description

The summary will be generated by Copilot in the below.

✅ Checks

  • Added test cases for my code

Copilot AI review requested due to automatic review settings March 19, 2025 08:20
@hwbrzzl hwbrzzl requested a review from a team as a code owner March 19, 2025 08:20
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 introduces a new Statement method to both the database layer and its mocks for executing raw SQL, while removing the Exec method from the mocks and the main code. Key changes include:

  • Removal of the Exec method from mocks and the transaction interface.
  • Addition of the Statement method and its corresponding mock helpers in both DB.go and Tx.go.
  • Updating tests and interface definitions to reflect the new Statement functionality.

Reviewed Changes

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

Show a summary per file
File Description
mocks/database/db/DB.go Removed Exec mocks and added a new Statement mock function.
mocks/database/db/Tx.go Removed Exec mocks and added a new Statement mock function.
tests/db_test.go Updated test function to include new Statement call; renamed tests accordingly.
database/db/db.go Removed Exec and added a Statement method that wraps exec.
contracts/database/db/db.go Updated the Tx interface to replace Exec with Statement.
Comments suppressed due to low confidence (1)

tests/db_test.go:208

  • [nitpick] The test function name still includes 'Exec', which might be misleading since the Exec method has been removed; consider renaming the function to accurately reflect that it tests the new Statement functionality.
func (s *DBTestSuite) Test_DB_Select_Insert_Update_Delete_Exec() {

@codecov
Copy link

codecov bot commented Mar 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.14%. Comparing base (f437993) to head (93d0d20).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #963   +/-   ##
=======================================
  Coverage   69.14%   69.14%           
=======================================
  Files         158      158           
  Lines       10607    10607           
=======================================
  Hits         7334     7334           
  Misses       2942     2942           
  Partials      331      331           

☔ 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.

@hwbrzzl hwbrzzl changed the title feat: add Statement method feat: Optimize facades.DB Mar 19, 2025
@hwbrzzl hwbrzzl changed the title feat: Optimize facades.DB feat: Some nit optimizations for facades.DB Mar 19, 2025
@hwbrzzl hwbrzzl marked this pull request as draft March 19, 2025 08:25
@hwbrzzl hwbrzzl marked this pull request as ready for review March 19, 2025 12:10
@hwbrzzl hwbrzzl merged commit df91513 into master Mar 19, 2025
11 checks passed
@hwbrzzl hwbrzzl deleted the bowen/add-statement branch March 19, 2025 12:13
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