pypi mssql-python 1.4.0
v1.4.0

13 hours ago

Release Notes - Version 1.4.0

Enhancements

  • Bulk Copy Support (#449, #430, #426, #420, #439)

    What changed: The bulkcopy() method on the Cursor object is now a public API, providing high-performance bulk data loading into SQL Server. Added comprehensive logging support for bulk copy operations with configurable log levels. Enhanced type hints and explicit parameter definitions for better IDE support and type checking. This feature is powered by a new mssql-py-core native extension, please read here https://github.com/microsoft/mssql-rs.
    Who benefits: Developers performing ETL operations, applications requiring high-throughput data imports, teams needing detailed bulk copy operation logging for debugging
    Impact: Enables production use of high-performance bulk inserts, provides visibility into bulk copy operations through logging, ensures secure authentication with EntraID tokens, improves developer experience with better type hints and parameter documentation

    Implements #449, #430, #426, #420, #439

  • Spatial Type Support (#423)

    What changed: Added native support for SQL Server spatial data types including geography, geometry, and hierarchyid. These types are now automatically handled during query execution and result fetching, with proper Python type conversions. Includes comprehensive test coverage for spatial operations.
    Who benefits: Applications working with geospatial data, GIS integrations, users storing location-based information, developers working with hierarchical data structures
    Impact: Enables direct use of SQL Server spatial features from Python, eliminates need for manual type conversions, provides seamless integration with geospatial applications

    Implements #423

  • Type Annotations with py.typed Marker (#367)

    What changed: Added py.typed marker file to the package, enabling full type checking support for static type checkers like mypy, pylance, and pyright. This makes all type hints in the package discoverable and verifiable by type checking tools.
    Who benefits: Developers using static type checkers, teams enforcing type safety in codebases, IDE users wanting better autocomplete and inline documentation
    Impact: Enables compile-time type checking for mssql-python usage, improves IDE intelligence and error detection, enhances code quality through static analysis

    Implements #367

Bug Fixes

  • VARCHAR Fetch Failure with Non-ASCII CP1252 Characters (#444)

    What changed: Fixed a critical bug where fetching VARCHAR columns failed when the data length exactly equaled the column size and contained non-ASCII CP1252 characters (e.g., extended Latin characters like é, ñ, ü). The issue was caused by incorrect buffer size calculations for multi-byte character encodings.
    Who benefits: Applications storing international text data, databases with CP1252 collations, users in European and Latin American regions
    Impact: Prevents data fetch failures for international characters, ensures reliable VARCHAR handling across all character sets, eliminates data truncation issues

    Fixes #444

  • Segmentation Fault with Interleaved Fetch Calls (#441)

    What changed: Fixed a segmentation fault that occurred when interleaving calls to fetchmany() and fetchone() on the same cursor. The issue was caused by improper state management in the underlying result set iterator. Added comprehensive test coverage for various fetch operation sequences.
    Who benefits: Applications using mixed fetch strategies, developers iterating through result sets with different batch sizes, tools dynamically adjusting fetch patterns
    Impact: Eliminates crash risk when mixing fetch methods, ensures stable cursor iteration, improves overall driver reliability

    Fixes #427, #441

  • Date/Time Type Code Alignment with ODBC 18 Driver (#355)

    What changed: Aligned date and time type code mappings with the official ODBC 18 driver source code. This ensures consistent behavior when working with SQL Server date/time types (DATE, TIME, DATETIME2, DATETIMEOFFSET) across Python and other language drivers.
    Who benefits: Applications using temporal data types, developers migrating from ODBC-based solutions, cross-platform applications requiring consistent date/time handling
    Impact: Ensures accurate date/time type handling, eliminates subtle type conversion discrepancies, improves compatibility with other SQL Server drivers

    Fixes #352, #355

Developer Experience

  • Development Container Configuration (#147)

    What changed: Added devcontainer configuration for VS Code, providing a complete, pre-configured development environment with all necessary dependencies, tools, and extensions. Includes Python environment setup, SQL Server instance configuration, and recommended VS Code extensions.
    Who benefits: New contributors setting up development environments, developers wanting consistent cross-platform setups, remote development scenarios
    Impact: Reduces environment setup time from hours to minutes, ensures consistent development environments across team, eliminates "works on my machine" issues

    Implements #147

Don't miss a new mssql-python release

NewReleases is sending notifications on new releases.