Skip to content

Conversation

@molon
Copy link
Contributor

@molon molon commented Sep 6, 2025

…nd update related tests

@molon molon requested a review from Copilot September 6, 2025 02:54
Copilot

This comment was marked as outdated.

@molon molon requested a review from Copilot September 6, 2025 03:11
Copilot

This comment was marked as outdated.

@molon molon requested a review from Copilot September 6, 2025 09:46
Copilot

This comment was marked as outdated.

@molon molon changed the title Refactor database dialector initialization to use WithCause wrapper Refactor database dialector initialization to use postgresx Sep 6, 2025
@molon molon requested a review from Copilot September 8, 2025 01:49
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 refactors database dialector initialization to use an enhanced PostgreSQL dialector (postgresx) that preserves original error details alongside GORM error translations, and updates related tests to support this change.

  • Introduces a new postgresx package with enhanced error handling that wraps GORM's PostgreSQL dialector
  • Updates database initialization to use the new postgresx.Dialector instead of the standard postgres.Dialector
  • Refactors test setup by consolidating shared database configuration into a common test file

Reviewed Changes

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

Show a summary per file
File Description
gormx/postgresx/postgres.go New enhanced PostgreSQL dialector with improved error handling that preserves original error details
gormx/postgresx/postgres_test.go Comprehensive tests for the new dialector's error handling capabilities
gormx/database.go Updated to use postgresx dialector and improved database setup with better error handling
gormx/database_test.go Updated test expectations to use the new postgresx.Dialector type
gormx/gorm_test.go New shared test setup file with common database configuration
gormx/omit_associations_test.go Removed duplicate test setup code, now relies on shared configuration
gormx/example/config.yaml Added example database configuration file
httpx/example/config.yaml Added missing http configuration section

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@molon molon merged commit eed5b57 into master Sep 8, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants