You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a new Python driver for Microsoft SQL Server currently in Alpha phase.
3
+
mssql-python is a new first-party SQL Server driver for Python that has all of the benefits of a fresh start while preserving a familiar experience for developers.
4
+
5
+
## What makes mssql-python different?
6
+
7
+
### Powered by DDBC – Direct Database Connectivity
8
+
9
+
Most Python SQL Server drivers, including pyodbc, route calls through the Driver Manager, which has slightly different implementations across Windows, macOS, and Linux. This results in inconsistent behavior and capabilities across platforms. Additionally, the Driver Manager must be installed separately, creating friction for both new developers and when deploying applications to servers.
10
+
11
+
At the heart of the driver is DDBC (Direct Database Connectivity) — a lightweight, high-performance C++ layer that replaces the platform’s Driver Manager.
12
+
13
+
Key Advantages:
14
+
15
+
- Provides a consistent, cross-platform backend that handles connections, statements, and memory directly.
16
+
- Interfaces directly with the native SQL Server drivers.
17
+
- Integrates with the same TDS core library that powers the ODBC driver.
18
+
19
+
### Why is this architecture important?
20
+
21
+
By simplifying the architecture, DDBC delivers:
22
+
23
+
- Consistency across platforms
24
+
- Lower function call overhead
25
+
- Zero external dependencies on Windows (`pip install mssql-python` is all you need)
26
+
- Full control over connections, memory, and statement handling
27
+
28
+
### Built with PyBind11 + Modern C++ for Performance and Safety
29
+
30
+
To expose the DDBC engine to Python, mssql-python uses PyBind11 – a modern C++ binding library, instead of ctypes. With ctypes, every call between Python and the ODBC driver involved costly type conversions, manual pointer management, resulting in slow and potentially unsafe code.
31
+
32
+
PyBind11 provides:
33
+
34
+
- Native-speed execution with automatic type conversions
35
+
- Memory-safe bindings
36
+
- Clean and Pythonic API, while performance-critical logic remains in robust, maintainable C++.
4
37
5
38
## Public Preview Release
6
39
7
-
We are making progress - The Public Preview of our driver is now available! This marks a significant milestone in our development journey. While we saw a few early adopters of our alpha release, we are introducing the following functionalities to support your applications in a more robust and reliable manner.
40
+
We are currently in **Public Preview**.
8
41
9
-
###What's Included:
42
+
## What's new in v0.13.0
10
43
11
-
-Everything from previous releases
12
-
-**Alpine Linux Support:**Added full support for Alpine Linux distribution (musllinux) with specialized driver handling and fixes for musl libc compatibility.
13
-
-**Connection Management Improvements:**Fixed autocommit to be False by default and added automatic rollback on connection close for better transaction control.
14
-
-**PyODBC Compatibility:**Enhanced type objects and constructor compatibility with pyodbc for seamless migration and interoperability.
44
+
-**Enhanced Batch Operations:** Complete support for UNIQUEIDENTIFIER and DATETIMEOFFSET in `executemany()` operations with automatic type inference, enabling efficient bulk inserts of complex data types including UUIDs and timezone-aware datetimes.
45
+
-**Streaming Large Values:**Robust handling of large objects (NVARCHAR/VARCHAR/VARBINARY(MAX)) in `executemany()` with automatic Data-At-Execution detection and fallback, supporting streaming inserts and fetches for massive datasets.
46
+
-**Improved Cursor Reliability:**Enhanced `cursor.rowcount` accuracy across all fetch operations, including proper handling of empty result sets and consistent behavior for SELECT, INSERT, and UPDATE operations.
47
+
-**Critical Stability Fixes:**Resolved memory leaks with secure token buffer handling, fixed resource cleanup to prevent segmentation faults during Python shutdown, and corrected type inference bugs in batch operations.
15
48
16
49
For more information, please visit the project link on Github: https://github.com/microsoft/mssql-python
17
50
18
-
### What's Next:
19
-
20
-
As we continue to develop and refine the driver, you can expect regular updates that will introduce new features, optimizations, and bug fixes. We encourage you to contribute, provide feedback and report any issues you encounter, as this will help us improve the driver for the final release.
51
+
If you have any feedback, questions or need support please mail us at mssql-python@microsoft.com.
21
52
22
-
### Stay Tuned:
53
+
##What's Next
23
54
24
-
We appreciate your interest and support in this project. Stay tuned for more updates and enhancements as we work towards delivering a robust and fully-featured driver in coming months.
25
-
Thank you for being a part of our journey!
55
+
As we continue to develop and refine the driver, you can expect regular updates that will introduce new features, optimizations, and bug fixes. We encourage you to contribute, provide feedback and report any issues you encounter, as this will help us improve the driver ahead of General Availability.
0 commit comments