Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(adapter-mssql): support pool idle timeout and min connections#28813

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
beejjacobs wants to merge2 commits intoprisma:main
base:main
Choose a base branch
Loading
frombeejjacobs:feat/support-mssql-pool-config

Conversation

@beejjacobs
Copy link
Contributor

@beejjacobsbeejjacobs commentedDec 2, 2025
edited
Loading

This PR updates parseConnectionString to support more pool config parameters from a connection string. This includesidleTimeoutMillis andmin (connections), the new connection string values are:

  • poolIdleTimeout (in seconds)
  • poolMinConnections
  • poolMaxConnections (alias ofconnectionLimit)

CopilotAI review requested due to automatic review settingsDecember 2, 2025 15:54
Copy link
Contributor

CopilotAI 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 adds support for configuring pool idle timeout and minimum connections via connection string parameters for the MSSQL adapter. It extends the existing pool configuration capabilities to includepoolIdleTimeout andpoolMinConnections, while also addingpoolMaxConnections as an alias for the existingconnectionLimit parameter.

Key changes:

  • Added parsing forpoolIdleTimeout connection string parameter (converted from seconds to milliseconds)
  • Added parsing forpoolMinConnections connection string parameter
  • AddedpoolMaxConnections as an alias forconnectionLimit

Reviewed changes

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

FileDescription
packages/adapter-mssql/src/connection-string.tsImplements parsing logic for new pool configuration parameters with validation and unit conversion
packages/adapter-mssql/src/connection-string.test.tsAdds test coverage for the three new/updated connection string parameters

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

Comment on lines 174 to 182
constpoolIdleTimeout=firstKey(parameters,'poolIdleTimeout')
if(poolIdleTimeout!==null){
consttimeout=parseInt(poolIdleTimeout,10)
if(isNaN(timeout)){
thrownewError(`Invalid pool idle timeout:${poolIdleTimeout}`)
}
config.pool=config.pool||{}
config.pool.idleTimeoutMillis=timeout*1000
}
Copy link

CopilotAIDec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

The validation logic for pool timeout parameters doesn't check for negative values. Consider adding validation to ensure timeout values are positive, similar to how you might validate other numeric constraints. For example:if (isNaN(timeout) || timeout < 0) { throw new Error(...) }

Copilot uses AI. Check for mistakes.
Comment on lines 184 to 192
constpoolMinConnections=firstKey(parameters,'poolMinConnections')
if(poolMinConnections!==null){
constmin=parseInt(poolMinConnections,10)
if(isNaN(min)){
thrownewError(`Invalid pool min connections:${poolMinConnections}`)
}
config.pool=config.pool||{}
config.pool.min=min
}
Copy link

CopilotAIDec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

The validation forpoolMinConnections doesn't check for negative values. Pool minimum connections should be a non-negative integer. Consider adding validation:if (isNaN(min) || min < 0) { throw new Error(...) }

Copilot uses AI. Check for mistakes.
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I have addedisNaNOrNegative in a second commit.

@beejjacobsbeejjacobsforce-pushed thefeat/support-mssql-pool-config branch from84e8621 to642d754CompareDecember 3, 2025 08:24
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

Copilot code reviewCopilotCopilot left review comments

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@beejjacobs

[8]ページ先頭

©2009-2025 Movatter.jp