Skip to content

feat: add ADO.Net connection string synonyms#374

Merged
dlevy-msft-sql merged 5 commits into
microsoft:mainfrom
dlevy-msft-sql:feat/ado-net-synonyms
Jun 12, 2026
Merged

feat: add ADO.Net connection string synonyms#374
dlevy-msft-sql merged 5 commits into
microsoft:mainfrom
dlevy-msft-sql:feat/ado-net-synonyms

Conversation

@dlevy-msft-sql

@dlevy-msft-sql dlevy-msft-sql commented Apr 28, 2026

Copy link
Copy Markdown

Problem

The ADO.Net connection string format supports many parameter synonyms (e.g. App for Application Name, Connect Timeout for Connection 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 adoSynonyms map in msdsn/conn_str.go was missing 13 synonyms that are documented in the SqlConnection.ConnectionString reference.

Solution

Add the 13 missing non-authentication ADO.Net synonyms to the adoSynonyms map:

Synonym Maps To
App app name
Connect Timeout connection timeout
Timeout connection timeout
Failover Partner failover partner
Failover Partner SPN failover partner spn
Application Intent applicationintent
Trust Server Certificate trustservercertificate
Multi Subnet Failover multisubnetfailover
Host Name In Certificate hostnameincertificate
Server SPN serverspn
Server Certificate servercertificate
WSID workstation id

Authentication-related synonyms (Integrated Security, Trusted_Connection, Authentication) are intentionally excluded as they are covered by PR #368 or require separate design work.

Changes

File Change
msdsn/conn_str.go Added 13 entries to adoSynonyms map; updated reference URL
msdsn/conn_str_test.go Added 22 test cases covering all new synonyms

Testing

  • go build ./... -- passes
  • go test ./msdsn -v -count=1 -- all 19 tests pass (including 22 new sub-cases)
  • No SQL Server required for these unit tests

Related Issues

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 adoSynonyms in msdsn/conn_str.go with additional non-auth ADO.NET keyword synonyms.
  • Added unit test cases in msdsn/conn_str_test.go to validate the new synonyms, including a split-level test for Server 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.

Comment thread msdsn/conn_str_test.go Outdated
Comment thread msdsn/conn_str_test.go Outdated
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

Copilot AI left a comment

Copy link
Copy Markdown

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 1 comment.

Comment thread msdsn/conn_str.go

Copilot AI left a comment

Copy link
Copy Markdown

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 1 comment.

Comment thread msdsn/conn_str.go Outdated

Copilot AI left a comment

Copy link
Copy Markdown

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 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread README.md Outdated
Comment thread README.md Outdated

Copilot AI left a comment

Copy link
Copy Markdown

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 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread msdsn/conn_str_test.go Outdated
Comment thread README.md Outdated

Copilot AI left a comment

Copy link
Copy Markdown

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 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread msdsn/conn_str_test.go

Copilot AI left a comment

Copy link
Copy Markdown

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 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread msdsn/conn_str_test.go

Copilot AI left a comment

Copy link
Copy Markdown

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 3 out of 3 changed files in this pull request and generated no new comments.

@dlevy-msft-sql dlevy-msft-sql force-pushed the feat/ado-net-synonyms branch from 4a39a6d to 3cc2805 Compare April 29, 2026 00:18
@codecov-commenter

codecov-commenter commented Apr 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.60%. Comparing base (99bd561) to head (0f937d9).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             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     
Flag Coverage Δ
unittests 96.53% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
msdsn/conn_str.go 90.08% <ø> (ø)

... and 59 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dlevy-msft-sql dlevy-msft-sql marked this pull request as ready for review April 29, 2026 19:05
@dlevy-msft-sql dlevy-msft-sql added this to the v1.11.0 milestone Apr 29, 2026
Comment thread msdsn/conn_str.go Outdated
Removed /en-us/ from comment
Remove remaining /en-us/ tags in URLs
@dlevy-msft-sql dlevy-msft-sql merged commit d72f750 into microsoft:main Jun 12, 2026
12 of 13 checks passed
@dlevy-msft-sql dlevy-msft-sql deleted the feat/ado-net-synonyms branch June 12, 2026 15:33
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.

feat: add remaining ADO.Net connection string synonyms

4 participants