-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
fix: add multiSubnetFailover to mssql driver option types #10804
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
|
re-run circleci test? |
gioboa
left a comment
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.
Thanks @isaru66
I added this PR to our release board
|
Hi, This PR would be very useful for those of us working with SQL Server in high availability setups. Since many large-scale applications use this type of database configuration, having support for this parameter in TypeORM would be a solid improvement. Is there anything blocking this from being merged ? |
gioboa
left a comment
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.
I see, there are conflicts and we need another reviewer, then we can merge it 👍
|
Thanks a lot for the review and clarification 👍 |
|
Hi @sgarner , @michaelbromley, This PR has been open since March 2024 and already has one approval. Would you mind taking a quick look so we can hopefully get this merged ? |
sgarner
left a comment
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.
Thanks @isaru66 💜
WalkthroughAdds a new optional Sql Server connection option multiSubnetFailover?: boolean to the TypeScript interface and documents it in the SQL Server driver docs. No control flow or runtime logic changes are included in this diff. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor App as Application
participant Driver as SQL Server Driver
participant DNS as DNS
participant IPs as Target IPs
App->>Driver: createConnection({ multiSubnetFailover })
Driver->>DNS: Resolve hostname -> IP list
DNS-->>Driver: [IP1, IP2, ...]
alt multiSubnetFailover = false
note right of Driver: Default behavior
Driver->>IPs: Attempt connect to first IP, fallback sequentially
IPs-->>Driver: First successful connection
else multiSubnetFailover = true
rect rgba(200, 230, 255, 0.3)
note right of Driver: Parallel connection attempts
Driver->>IPs: Connect to all resolved IPs in parallel
IPs-->>Driver: First successful connection wins
end
Driver--x IPs: Cancel remaining attempts
end
Driver-->>App: Connected SqlServer client
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
🔇 Additional comments (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
commit: |
Description of change
add multiSubnetFailover option for SqlServerConnectionOptions.
This will support MSSQL alway on avalibility group to be failover faster

ref: https://learn.microsoft.com/en-us/sql/sql-server/failover-clusters/windows/sql-server-multi-subnet-clustering-sql-server?view=sql-server-ver16#DNS
in tediousjs this feature was implemented in tediousjs/tedious#362
Pull-Request Checklist
masterbranchnpm run formatto apply prettier formattingnpm run testpasses with this changeFixes #0000Summary by CodeRabbit