Blog Post

SQL Server Blog
2 MIN READ

Announcing the Public Preview of mssql-python

pskountrianos's avatar
pskountrianos
Icon for Microsoft rankMicrosoft
Jun 02, 2025

Python’s new gateway to Microsoft SQL Server and Azure SQL!

We’re excited to announce the public preview of the mssql-python driver with new platform support and powerful features for Microsoft SQL Server and the Azure SQL family, now available on GitHub: mssql-python.

Join us and contribute in shaping the future of Python connectivity with SQL Server!

MacOS Support

The mssql-python driver is now compatible with macOS ARM-based systems, expanding support for developers using Apple Silicon (M-Series) devices. This adds to our growing cross-platform story, and we’re not done yet — Linux support is coming soon!

Connection Pooling

We’ve built a robust, configurable connection pooling system to help boost performance and optimize resource usage.

Key highlights:

    • Connection Reuse: Reuses existing alive connections instead of creating new ones, improving performance.
    • Max Pool Size Limit: Enforces a configurable maximum number of connections per pool to limit resource consumption.
    • Idle Connection Pruning: Automatically disconnects and removes connections idle beyond a configurable timeout to free resources.
    • Multiple Pools by Connection String: Maintains separate pools keyed by connection string, supporting multiple distinct databases/endpoints.
    • Thread Safety: Uses mutex locking for safe concurrent access in multi-threaded environments. 
    • Connection Health Checking: Validates connections are alive before reuse and discards dead ones.
    • Explicit Connection Reset: Resets connections before reuse to clear session state and ensure clean context.
    • Configurable Global Pool Settings: Provides a singleton manager to configure default max pool size and idle timeout for all pools.
    • Simple Global API: Exposes easy-to-use functions to configure pooling and acquire pooled connections.
    • Logging: Outputs console logs for major events like creation, acquisition, release, pruning, and errors for easy debugging.

Note: This feature is currently available on Windows only. macOS and Linux support is in progress.

What's Next

Here’s a sneak peek at what we’re working on for upcoming releases:

  • Linux Support
  • Connection Pooling for macOS and Linux
  • Support for Bulk Copy for accelerated data transfer
  • Microsoft Entra ID (formerly Azure AD) Authentication for macOS and Linux

Try It and Share Your Feedback!

Ready to test the latest features? We invite you to:

  1. Try it out: Check-out the mssql-python driver and integrate it into your projects.
  2. Share your thoughts: Open issues, suggest features, and contribute to the project.
  3. Join the conversation: GitHub Discussions | SQL Server Tech Community.

We look forward to your feedback and collaboration!

Updated Jun 02, 2025
Version 1.0
No CommentsBe the first to comment