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 project is currently in Public Preview, meaning it is still under active development. We are working on core functionalities and gathering more feedback before GA. Please use with caution and avoid production environments.
10
+
> This project is now Generally Available (GA) and ready for production use. We’ve completed core functionality and incorporated feedback from the preview phase.
11
11
>
12
12
## Installation
13
13
@@ -47,20 +47,8 @@ pip install mssql-python
47
47
Windows, MacOS and Linux (manylinux - Debian, Ubuntu, RHEL, SUSE (x64 only) & musllinux - Alpine)
48
48
49
49
> **Note:**
50
-
> SUSE Linux ARM64 is not supported by Microsoft ODBC Driver. Use x64 architecture for SUSE deployments.
51
-
52
-
### DBAPI v2.0 Compliance
53
-
54
-
The Microsoft **mssql-python** module is designed to be fully compliant with the DB API 2.0 specification. This ensures that the driver adheres to a standardized interface for database access in Python, providing consistency and reliability across different database systems. Key aspects of DBAPI v2.0 compliance include:
55
-
56
-
-**Connection Objects**: Establishing and managing connections to the database.
57
-
-**Cursor Objects**: Executing SQL commands and retrieving results.
58
-
-**Transaction Management**: Supporting commit and rollback operations to ensure data integrity.
59
-
-**Error Handling**: Providing a consistent set of exceptions for handling database errors.
60
-
-**Parameter Substitution**: Allowing the use of placeholders in SQL queries to prevent SQL injection attacks.
61
-
62
-
By adhering to the DB API 2.0 specification, the mssql-python module ensures compatibility with a wide range of Python applications and frameworks, making it a versatile choice for developers working with Microsoft SQL Server, Azure SQL Database, and Azure SQL Managed Instance.
63
-
50
+
> SUSE Linux ARM64 is not supported. Please use x64 architecture for SUSE deployments.
51
+
64
52
### Support for Microsoft Entra ID Authentication
65
53
66
54
The Microsoft mssql-python driver enables Python applications to connect to Microsoft SQL Server, Azure SQL Database, or Azure SQL Managed Instance using Microsoft Entra ID identities. It supports a variety of authentication methods, including username and password, Microsoft Entra managed identity (system-assigned and user-assigned), Integrated Windows Authentication in a federated, domain-joined environment, interactive authentication via browser, device code flow for environments without browser access, and the default authentication method based on environment and configuration. This flexibility allows developers to choose the most suitable authentication approach for their deployment scenario.
@@ -73,39 +61,65 @@ EntraID authentication is now fully supported on MacOS and Linux but with certai
73
61
| ActiveDirectoryInteractive | ✅ Yes | ✅ Yes | Interactive login via browser; requires user interaction |
74
62
| ActiveDirectoryMSI (Managed Identity) | ✅ Yes | ✅ Yes | For Azure VMs/containers with managed identity |
75
63
| ActiveDirectoryServicePrincipal | ✅ Yes | ✅ Yes | Use client ID and secret or certificate |
76
-
| ActiveDirectoryIntegrated | ✅ Yes |❌ No|Only works on Windows(requires Kerberos/SSPI) |
64
+
| ActiveDirectoryIntegrated | ✅ Yes |✅ Yes|Now supported on Windows, macOS, and Linux (requires Kerberos/SSPI or equivalent configuration) |
77
65
| ActiveDirectoryDeviceCode | ✅ Yes | ✅ Yes | Device code flow for authentication; suitable for environments without browser access |
78
66
| ActiveDirectoryDefault | ✅ Yes | ✅ Yes | Uses default authentication method based on environment and configuration |
79
67
80
68
> For more information on Entra ID please refer this [document](https://github.com/microsoft/mssql-python/wiki/Microsoft-Entra-ID-support)
81
69
82
-
### Enhanced Pythonic Features
83
-
84
-
The driver offers a suite of Pythonic enhancements that streamline database interactions, making it easier for developers to execute queries, manage connections, and handle data more efficiently.
85
-
86
70
### Connection Pooling
87
71
88
72
The Microsoft mssql_python driver provides built-in support for connection pooling, which helps improve performance and scalability by reusing active database connections instead of creating a new connection for every request. This feature is enabled by default. For more information, refer [Connection Pooling Wiki](https://github.com/microsoft/mssql-python/wiki/Connection#connection-pooling).
73
+
74
+
### DBAPI v2.0 Compliance
75
+
76
+
The Microsoft **mssql-python** module is designed to be fully compliant with the DB API 2.0 specification. This ensures that the driver adheres to a standardized interface for database access in Python, providing consistency and reliability across different database systems. Key aspects of DBAPI v2.0 compliance include:
77
+
78
+
-**Connection Objects**: Establishing and managing connections to the database.
79
+
-**Cursor Objects**: Executing SQL commands and retrieving results.
80
+
-**Transaction Management**: Supporting commit and rollback operations to ensure data integrity.
81
+
-**Error Handling**: Providing a consistent set of exceptions for handling database errors.
82
+
-**Parameter Substitution**: Allowing the use of placeholders in SQL queries to prevent SQL injection attacks.
83
+
84
+
By adhering to the DB API 2.0 specification, the mssql-python module ensures compatibility with a wide range of Python applications and frameworks, making it a versatile choice for developers working with Microsoft SQL Server, Azure SQL Database, and Azure SQL Managed Instance.
85
+
86
+
### Enhanced Pythonic Features
87
+
88
+
The driver offers a suite of Pythonic enhancements that streamline database interactions, making it easier for developers to execute queries, manage connections, and handle data more efficiently.
We are thrilled to introduce Python driver for SQL Server (Public Preview) – a modern, high performant, and developer-friendly SDK designed to enhance your SQL Server database connectivity experience. This roadmap outlines the key structural improvements, new features and upcoming enhancements that will set our driver apart from existing solutions.
4
-
5
-
Why a New Driver?
6
-
7
-
Unlike existing Python SQL Server drivers, we are making substantial improvements to performance, maintainability, and usability by re-architecting the core internals. Our focus is on seamless integration between Python and C++, efficient memory management, better state handling, and advanced DBAPI enhancements.
8
-
9
-
Here’s what’s coming:
10
-
11
-
**1. Structural changes for abstraction of C++ and Python codebase**
12
-
13
-
We are undertaking significant structural changes to provide a clear abstraction between C++ code and Python. This will ensure better maintainability, improved performance, and a cleaner codebase. By leveraging existing pybind11 module, we aim to create a seamless integration between the two languages, allowing for efficient execution and easier debugging.
14
-
15
-
This will improve:
16
-
- Maintainability via simplified modular architecture
17
-
- Performance via optimized C++ code
18
-
- Debugging, traceability and seamless interaction between C++ and Python via with PyBind11 module integration
19
-
20
-
**2. Future DBAPI Enhancements**
21
-
22
-
In future releases, we plan to add several DBAPI enhancements, including:
23
-
-`Callproc()` : Support for calling stored procedures.
24
-
-`setinputsize()` and `setoutputsize()`
25
-
-`Output` and `InputOutput` Parameters: Handling of output and input-output parameters in stored procedures.
26
-
- Optional DBAPIs: Additional optional DBAPI features to provide more flexibility and functionality for developers.
27
-
28
-
**3. Cross-Platform Support: Additional Linux Distributions**
29
-
30
-
We are committed to providing cross-platform support for our Python driver. In the next few weeks, we will release support for additional Linux distributions viz Alpine, SUSE Linux & Oracle Linux.
31
-
32
-
**4. Bulk Copy (BCP)**
33
-
34
-
Bulk Copy API (BCP) support is coming soon to the Python Driver for SQL Server. It enables high-speed data ingestion and offers fine-grained control over batch operations, making it ideal for large-scale ETL workflows.
35
-
36
-
**5. Asynchronous Query Execution**
37
-
38
-
We are also working on adding support for asynchronous query execution. This feature will allow developers to execute queries without blocking the main thread, enabling more responsive and efficient applications. Asynchronous query execution will be particularly beneficial for applications that require high concurrency and low latency.
39
-
- No blocking of the main thread
40
-
- Faster parallel processing – ideal for high-concurrency applications
41
-
- Better integration with async frameworks like asyncio
42
-
43
-
We are dedicated to continuously improving the Python driver for SQL Server and welcome feedback from the community. Stay tuned for updates and new features as we work towards delivering a high-quality driver that meets your needs.
44
-
Join the Conversation!
45
-
46
-
We are building this for developers, with developers. Your feedback will shape the future of the driver.
0 commit comments