Skip to content

task: adding connection params - #40

Merged
paganotoni merged 4 commits into
mainfrom
feat-connection-params
Nov 14, 2025
Merged

task: adding connection params#40
paganotoni merged 4 commits into
mainfrom
feat-connection-params

Conversation

@paganotoni

Copy link
Copy Markdown
Contributor

Adds a db connection option to specify connection parameters.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 adds connection parameter support to the database connection functionality, allowing users to specify additional connection parameters that will be appended as URL query parameters to the connection string.

  • Added a new Params function to specify connection parameters in key-value format
  • Introduced a global connParams variable to store encoded connection parameters
  • Refactored variable names in tests from dbUrl to url for consistency

Reviewed Changes

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

File Description
db/connection.go Added Params function and connParams global variable to support appending connection parameters to the connection string
db/connection_test.go Renamed dbUrl variables to url and added test case for connection parameters functionality

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

Comment thread db/connection.go
Comment thread db/connection.go Outdated
Comment thread db/connection.go Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 3 comments.

Comments suppressed due to low confidence (1)

db/connection.go:59

  • The connection is being stored in dbPool using the original url parameter (from the function signature), but the lookup at line 38 will also use this original URL. However, the actual connection is opened with the modified URL that includes parameters (line 54). This means connections with different parameters but the same base URL will incorrectly be treated as the same connection. The pooling key should incorporate the connection parameters or use the modified URL.
		dbPool[url] = conn

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

Comment thread db/connection.go
Comment thread db/connection.go Outdated
@paganotoni
paganotoni merged commit adeffa5 into main Nov 14, 2025
1 check passed
@paganotoni
paganotoni deleted the feat-connection-params branch November 14, 2025 15:42
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.

2 participants