ReleaseMicrosoftMicrosoftpublished May 29, 2026seen 3d

microsoft/mssql-python v1.8.0

microsoft/mssql-python

Open original ↗

Captured source

source ↗
published May 29, 2026seen 3dcaptured 11hhttp 200method plain

v1.8.0

Repository: microsoft/mssql-python

Tag: v1.8.0

Published: 2026-05-29T17:05:17Z

Prerelease: no

Release notes:

Release Notes - Version 1.8.0

Enhancements

ActiveDirectoryMSI Support for Bulk Copy (#573)

_What changed_: Added Authentication=ActiveDirectoryMSI support to cursor.bulkcopy(), enabling both system-assigned (ManagedIdentityCredential()) and user-assigned (ManagedIdentityCredential(client_id=UID)) managed identity authentication. Credential kwargs are now threaded through the token acquisition path and persisted on the Connection to survive the bulk copy fresh-token flow. _Who benefits_: Users running bulk copy operations from Azure-hosted services (VMs, App Service, Functions, AKS) that authenticate via Managed Identity. _Impact_: Bulk copy now works with MSI authentication without workarounds. Previously only Default, DeviceCode, and Interactive auth methods were supported for bulk copy. > PR #573 | GitHub Issue #534

Row String-Key Indexing (#589)

_What changed_: Row.__getitem__ now supports accessing values by column name as a string key (e.g., row["col"]), in addition to existing integer index and attribute access. Case-insensitive lookup is supported when the cursor's lowercase attribute is enabled. _Who benefits_: All users who prefer dictionary-style access to result rows. _Impact_: More intuitive row access patterns without needing to track column ordinal positions. > PR #589 | GitHub Issue #582

Bundled ODBC Driver Upgrade (#569)

_What changed_: Updated the bundled Microsoft ODBC Driver for SQL Server from 18.5.1.1 to 18.6.2.1, picking up the latest fixes and improvements from the ODBC driver team. _Who benefits_: All users — benefits from the latest ODBC driver stability and compatibility improvements. _Impact_: Improved compatibility and stability from the latest ODBC driver release. > PR #569

---

Bug Fixes

Deferred Connect-Attribute Use-After-Free (#596)

_What changed_: Fixed a use-after-free in Connection.setAttribute where deferred ODBC attributes (e.g., SQL_COPT_SS_ACCESS_TOKEN) were copied to stack-local buffers that were freed before the driver dereferenced them during SQLDriverConnect. Values are now stored in Connection-owned member buffers that remain valid for the lifetime of the connection. _Who benefits_: Users authenticating with access tokens (Entra ID / AAD), especially on macOS arm64 and Azure SQL. _Impact_: Eliminates SIGBUS crashes on macOS arm64, ProgrammingError: Authentication token is missing on Windows, and OperationalError: Communication link failure on Azure SQL when using token-based authentication. > PR #596 | GitHub Issue #594

Connection String Parsed Multiple Times in Auth Path (#590)

_What changed_: Refactored authentication handling from string-based to dictionary-based parameter processing, eliminating redundant connection string parsing passes. _construct_connection_string now returns a normalized parameter dictionary alongside the string, removing the need for downstream re-parsing and ensuring robust sanitization of sensitive parameters before ODBC handoff. _Who benefits_: All users using Entra ID / AAD authentication methods. _Impact_: More reliable authentication with reduced overhead and cleaner sensitive-parameter sanitization. > PR #590 | GitHub Issue #580

`executemany` Type Annotation Regression (#586)

_What changed_: Changed the seq_of_parameters type from invariant List[Sequence[Any]] to covariant Sequence[Sequence[Any]], fixing a mypy rejection of valid list[tuple[...]] arguments introduced in v1.6.0's dual paramstyle support. Runtime behaviour is unchanged. _Who benefits_: Users running mypy or other static type checkers on code that calls Cursor.executemany. _Impact_: executemany now correctly accepts list[tuple[...]], list[list[...]], and other sequence-of-sequences under strict type checking, matching PEP 249. > PR #586 | GitHub Issue #572

Notability

notability 3.0/10

Routine library release update.