Skip to content

feat: optimize db read write#954

Merged
hwbrzzl merged 8 commits intomasterfrom
bowen/optimize-db-read-write
Mar 18, 2025
Merged

feat: optimize db read write#954
hwbrzzl merged 8 commits intomasterfrom
bowen/optimize-db-read-write

Conversation

@hwbrzzl
Copy link
Contributor

@hwbrzzl hwbrzzl commented Mar 11, 2025

📑 Description

See: #954 (review)

✅ Checks

  • Added test cases for my code

@codecov
Copy link

codecov bot commented Mar 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.14%. Comparing base (be95d34) to head (088010a).
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #954      +/-   ##
==========================================
- Coverage   69.14%   69.14%   -0.01%     
==========================================
  Files         158      158              
  Lines       10602    10607       +5     
==========================================
+ Hits         7331     7334       +3     
- Misses       2940     2942       +2     
  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 force-pushed the bowen/optimize-db-read-write branch from 6c0693a to 2419868 Compare March 16, 2025 09:44
@hwbrzzl hwbrzzl force-pushed the bowen/optimize-db-read-write branch from ab77aeb to 8f6a51f Compare March 17, 2025 12:36
@hwbrzzl hwbrzzl marked this pull request as ready for review March 18, 2025 09:09
Copilot AI review requested due to automatic review settings March 18, 2025 09:09
@hwbrzzl hwbrzzl requested a review from a team as a code owner March 18, 2025 09:09
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 optimizations for database read/write operations and refactors several components including the ORM, query builder, and connection handling while removing deprecated fields and test files.

  • Refactors Gorm and DB building methods for streamlined initialization.
  • Updates query generation to use distinct read and write builders.
  • Removes version-related fields and corresponding test files to optimize and simplify configuration.

Reviewed Changes

Copilot reviewed 45 out of 45 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
database/driver/gorm.go Refactored Gorm configuration and connection handling.
database/db/builder.go Introduced Builder and TxBuilder for database operations.
database/schema/schema.go Updated schema initialization to return errors and handle connections.
database/console/show_command.go Removed version output and updated display logic.
contracts/database/config.go Removed deprecated fields and added new configuration options.
database/db/to_sql.go Updated SQL generation to use builder’s Explain method.
database/db/db.go Refactored DB/transaction building to use Gorm and unified builders.
database/gorm/query.go Adjusted query construction to utilize updated driver pool settings.
contracts/database/driver/* Updated grammar and driver interfaces to support common grammar.
database/db/query.go Significantly refactored query methods to use read/write builders.
database/service_provider.go Updated service registration to reflect changes in DB and schema.
contracts/database/db/db.go Extended CommonBuilder interface with an Explain method.
database/orm/orm.go Minor cleanup by removing the database version getter.
Comments suppressed due to low confidence (1)

database/db/db_test.go:1

  • The removal of the db_test.go file could reduce test coverage for core database functionalities; ensure that equivalent tests are implemented elsewhere to maintain coverage.
Entire file removed

@hwbrzzl hwbrzzl merged commit 9dd41c7 into master Mar 18, 2025
11 of 13 checks passed
@hwbrzzl hwbrzzl deleted the bowen/optimize-db-read-write branch March 18, 2025 09:18
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