feat: add ADO.Net connection string synonyms#374
Merged
dlevy-msft-sql merged 5 commits intoJun 12, 2026
Conversation
22865d4 to
0e93506
Compare
There was a problem hiding this comment.
Pull request overview
Adds additional ADO.NET-style connection string keyword synonyms to the msdsn parser to improve compatibility with migrated .NET connection strings.
Changes:
- Extended
adoSynonymsinmsdsn/conn_str.gowith additional non-auth ADO.NET keyword synonyms. - Added unit test cases in
msdsn/conn_str_test.goto validate the new synonyms, including a split-level test forServer Certificate.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| msdsn/conn_str.go | Adds new ADO.NET keyword synonyms mapping to the driver’s canonical parameter keys. |
| msdsn/conn_str_test.go | Adds test cases intended to cover the new synonyms, plus a direct splitConnectionString test for Server Certificate. |
Add 13 missing ADO.Net connection string synonyms to the adoSynonyms map: App, Connect Timeout, Timeout, Failover Partner, Failover Partner SPN, Application Intent, Trust Server Certificate, Multi Subnet Failover, Host Name In Certificate, Server SPN, Server Certificate, WSID. Includes 22 new test cases in TestValidConnectionString covering all new synonyms plus combined synonym usage. Closes microsoft#373 Related to microsoft#288
0e93506 to
cc7df57
Compare
1e1b141 to
cc7df57
Compare
fa41e3b to
cc7df57
Compare
ae28987 to
eb0a962
Compare
eb0a962 to
972faae
Compare
972faae to
01d7e0b
Compare
01d7e0b to
4a39a6d
Compare
4a39a6d to
3cc2805
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #374 +/- ##
===========================================
+ Coverage 80.67% 96.60% +15.93%
===========================================
Files 35 92 +57
Lines 6920 74361 +67441
===========================================
+ Hits 5583 71840 +66257
- Misses 1066 2186 +1120
- Partials 271 335 +64
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
shueybubbles
approved these changes
Jun 11, 2026
Removed /en-us/ from comment
Remove remaining /en-us/ tags in URLs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The ADO.Net connection string format supports many parameter synonyms (e.g.
AppforApplication Name,Connect TimeoutforConnection Timeout), but the go-mssqldb driver only recognized a subset of them. Users migrating connection strings from .NET applications would find that common synonyms were silently ignored.Tracked in #288 (original request) and #373 (scoped to non-auth synonyms).
Root Cause
The
adoSynonymsmap inmsdsn/conn_str.gowas missing 13 synonyms that are documented in the SqlConnection.ConnectionString reference.Solution
Add the 13 missing non-authentication ADO.Net synonyms to the
adoSynonymsmap:Appapp nameConnect Timeoutconnection timeoutTimeoutconnection timeoutFailover Partnerfailover partnerFailover Partner SPNfailover partner spnApplication IntentapplicationintentTrust Server CertificatetrustservercertificateMulti Subnet FailovermultisubnetfailoverHost Name In CertificatehostnameincertificateServer SPNserverspnServer CertificateservercertificateWSIDworkstation idAuthentication-related synonyms (
Integrated Security,Trusted_Connection,Authentication) are intentionally excluded as they are covered by PR #368 or require separate design work.Changes
msdsn/conn_str.goadoSynonymsmap; updated reference URLmsdsn/conn_str_test.goTesting
go build ./...-- passesgo test ./msdsn -v -count=1-- all 19 tests pass (including 22 new sub-cases)Related Issues