Skip to content

fix(mssql): modernize adapter config#512

Merged
cofin merged 1 commit into
mainfrom
codex/adapter-config-mssql-python
Jun 9, 2026
Merged

fix(mssql): modernize adapter config#512
cofin merged 1 commit into
mainfrom
codex/adapter-config-mssql-python

Conversation

@cofin

@cofin cofin commented Jun 9, 2026

Copy link
Copy Markdown
Member

Summary

Modernizes the mssql-python adapter around the current connection keyword surface and BulkCopy runtime behavior.

Details

  • Expands typed connection params for current ODBC-style aliases, including address, database, username, trust/encryption, certificate, SPN, multi-subnet, retry, keepalive, IP preference, packet size, and timeout options.
  • Normalizes supported aliases into canonical connection-string keywords and rejects conflicting aliases instead of silently choosing one.
  • Filters settings that mssql-python does not consume from SQLSpec's generated connection string, including driver/app/workstation/MARS-style keys.
  • Updates bulk_copy() defaults to match the mssql-python runtime and returns a typed MssqlPythonBulkCopyResult when the driver provides one.
  • Exports MssqlPythonBulkCopyResult and adds focused unit coverage for config normalization, alias conflicts, BulkCopy defaults, and BulkCopy result handling.

Review Notes

This branch is rebased onto the latest main; the larger surface area comes from keeping mssql-python config aliases and BulkCopy behavior aligned with the driver runtime.

@codecov-commenter

codecov-commenter commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.40%. Comparing base (6b216bc) to head (f44ada8).

Files with missing lines Patch % Lines
sqlspec/adapters/mssql_python/driver.py 88.88% 1 Missing and 1 partial ⚠️
sqlspec/adapters/mssql_python/core.py 96.15% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #512      +/-   ##
==========================================
+ Coverage   71.56%   74.40%   +2.83%     
==========================================
  Files         439      439              
  Lines       53386    53427      +41     
  Branches     8456     8460       +4     
==========================================
+ Hits        38205    39751    +1546     
+ Misses      12665    11052    -1613     
- Partials     2516     2624     +108     
Flag Coverage Δ
integration 58.27% <0.00%> (+3.65%) ⬆️
py3.10 71.19% <96.00%> (+9.71%) ⬆️
py3.11 71.21% <96.00%> (+0.01%) ⬆️
py3.12 71.21% <96.00%> (+9.72%) ⬆️
py3.13 71.21% <96.00%> (+9.72%) ⬆️
py3.14 73.53% <92.68%> (+12.81%) ⬆️
unit 61.72% <96.00%> (+0.02%) ⬆️

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

Files with missing lines Coverage Δ
sqlspec/adapters/mssql_python/__init__.py 100.00% <ø> (ø)
sqlspec/adapters/mssql_python/config.py 81.46% <100.00%> (+2.23%) ⬆️
sqlspec/adapters/mssql_python/core.py 79.66% <96.15%> (+4.88%) ⬆️
sqlspec/adapters/mssql_python/driver.py 62.61% <88.88%> (-0.30%) ⬇️

... and 37 files with indirect coverage changes

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

@cofin cofin force-pushed the codex/adapter-config-mssql-python branch from 9b5a3d3 to 3c3cb37 Compare June 9, 2026 03:43
@cofin cofin marked this pull request as ready for review June 9, 2026 03:50
@cofin cofin force-pushed the codex/adapter-config-mssql-python branch from 3c3cb37 to 60e466d Compare June 9, 2026 14:16
@cofin cofin force-pushed the codex/adapter-config-mssql-python branch from 60e466d to f44ada8 Compare June 9, 2026 17:39
@cofin cofin merged commit 2f1a993 into main Jun 9, 2026
22 checks passed
@cofin cofin deleted the codex/adapter-config-mssql-python branch June 9, 2026 20:49
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.

2 participants