Skip to content

Conversation

@tianzhou
Copy link
Contributor

@tianzhou tianzhou commented Nov 1, 2025

Fix #141

Copilot AI review requested due to automatic review settings November 1, 2025 14:14
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 connection logic to use a centralized utility function, promoting code reuse and consistency across the codebase. The changes eliminate duplicated connection string building and ping operations by leveraging the existing util.Connect function.

  • Replaced manual DSN construction with util.ConnectionConfig struct
  • Removed redundant ping operations already handled by util.Connect
  • Exported BuildDSN function to make it available for potential external use

Reviewed Changes

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

File Description
cmd/util/connection.go Exported BuildDSN function by changing it from private buildDSN to public BuildDSN
internal/postgres/external.go Refactored to use util.Connect instead of manual connection setup, removing duplicate ping logic
internal/postgres/embedded.go Refactored two functions to use util.Connect instead of manual connection setup, removing duplicate ping logic

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tianzhou tianzhou force-pushed the consolidate_connection branch from d9d8294 to 231e3d6 Compare November 1, 2025 14:18
@tianzhou tianzhou requested a review from Copilot November 1, 2025 14:19
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

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tianzhou tianzhou merged commit 35399fd into main Nov 1, 2025
8 checks passed
@tianzhou tianzhou deleted the consolidate_connection branch November 23, 2025 14:51
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.

Unable to plan migrations using UNIX socket connection

1 participant