Skip to content

feat(connections): Add mssql-python driver.#5839

Open
walanguzzi wants to merge 11 commits into
SQLMesh:mainfrom
walanguzzi:feature/add-mssql-python-driver
Open

feat(connections): Add mssql-python driver.#5839
walanguzzi wants to merge 11 commits into
SQLMesh:mainfrom
walanguzzi:feature/add-mssql-python-driver

Conversation

@walanguzzi

@walanguzzi walanguzzi commented Jun 14, 2026

Copy link
Copy Markdown

Description

Issue #5645 - support the official mssql-python driver from Microsoft.

The new driver implements PEP 249 interfaces and should work as a pluggable drop-in: https://pypi.org/project/mssql-python/

*Re-raises #5647 for clean CI runs following the CircleCI migration.

Motivation

The driver bundles a lightweight and high-performance binary layer replacing the platform's Driver Manager hence eliminating the need for system-level ODBC driver installations.

As per the mssql-python overview, additional benefits include:

  • Consistency across platforms
  • Lower function call overhead
  • Zero external dependencies on Windows (the mssql-python is all that's needed)
  • Full control over connections, memory, and statement handling

Code Changes

  • Implemented connect_mssql_python and moved the prior pyodbc logic to connect_pyodbc.
  • Added driver configuration support for "mssql-python" to relevant *ConnectionConfig classes:
    • MSSQLConnectionConfig
    • AzureSQLConnectionConfig
    • FabricConnectionConfig
  • Updated documentation.
  • Automated refactors around import order (done by ruff and pylance).

Test Plan

The fast-test, slow-test and doc-test targets are also passing (locally).

Note

There was initially an issue with test_state_sync:test_version_schema test case failing and prompting for a migration when run locally. This seems to have been due to my tag-less checkout, fetching the upstream release tags allowed setuptools-scm to derive the real version string (as it does in CI).

Checklist

  • I have run make style and fixed any issues
  • I have added tests for my changes (if applicable)
  • All existing tests pass (make fast-test)
  • My commits are signed off (git commit -s) per the DCO

walanguzzi and others added 11 commits January 8, 2026 00:58
DATETIMEOFFSET is natively supported by `mssql-python`.

See "microsoft/mssql-python#213"
- Added a TODO re its removal as it should already
  be supported natively by `mssql-python`.
chore: Sync upstream `main`.
…sql-python-driver

Integrates 63 upstream commits since 4f833af (sqlglot v30, Pydantic 2.13
compat, StarRocks engine, ClickHouse secure field, BigQuery reservations,
Databricks connection pool, CI circleci->github migration) while preserving
the mssql-python driver support. Auto-merged with zero textual conflicts; all
66 connection-config tests pass.

Co-Authored-By: Claude <noreply@anthropic.com>
@walanguzzi walanguzzi force-pushed the feature/add-mssql-python-driver branch from 00fcd17 to 37f80e7 Compare June 14, 2026 22:24
@walanguzzi walanguzzi marked this pull request as ready for review June 14, 2026 22:32
@walanguzzi walanguzzi changed the title feat(connections): Support mssql-python driver. feat(connections): Add mssql-python driver. Jun 14, 2026
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.

1 participant