-
Notifications
You must be signed in to change notification settings - Fork 8
Refactor database dialector initialization to use postgresx #510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…nd update related tests
There was a problem hiding this 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
postgresxpackage with enhanced error handling that wraps GORM's PostgreSQL dialector - Updates database initialization to use the new
postgresx.Dialectorinstead of the standardpostgres.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.
…nd update related tests