denisenkom / go-mssqldb

Microsoft SQL server driver written in go language
BSD 3-Clause "New" or "Revised" License
1.81k stars 493 forks source link

Allow for local dns resolution with a custom dialer #779

Closed stephaniehingtgen closed 1 year ago

stephaniehingtgen commented 1 year ago

If the custom dialer updates the transport to proxy the mssql connection, and only the proxy can reach the network that mssql is running in, then any local DNS resolution will fail.

To address this, this PR adds an attempt to dial the connection via the custom dialer, if the DNS resolution fails.

codecov[bot] commented 1 year ago

Codecov Report

Merging #779 (d1ee717) into master (6fb7982) will decrease coverage by 0.14%. The diff coverage is 28.57%.

:exclamation: Current head d1ee717 differs from pull request most recent head e0b26b5. Consider uploading reports for the commit e0b26b5 to get more accurate results

@@            Coverage Diff             @@
##           master     #779      +/-   ##
==========================================
- Coverage   71.24%   71.11%   -0.14%     
==========================================
  Files          24       24              
  Lines        5405     5411       +6     
==========================================
- Hits         3851     3848       -3     
- Misses       1307     1313       +6     
- Partials      247      250       +3     
Impacted Files Coverage Δ
tds.go 65.14% <28.57%> (+0.01%) :arrow_up:

... and 2 files with indirect coverage changes

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

denisenkom commented 1 year ago

Thank you for this pull request. Can you add test coverage for this change?

stephaniehingtgen commented 1 year ago

Thank you for this pull request. Can you add test coverage for this change?

Definitely! Updated :)