Skip to content

Commit 918b328

Browse files
authored
FEAT: complete macOS-support with main ddbc_bindings and connection pooling (#102)
This pull request refactors the `mssql_python` module to remove macOS-specific implementations and unify the codebase for better maintainability. Key changes include removing the `connection_mac.py` file, updating connection handling to use UTF-8 strings, and modifying build configurations to eliminate platform-specific blocks. ### Removal of macOS-specific implementations: * [`mssql_python/connection_mac.py`](diffhunk://#diff-fc969de9bfd18c6c71b4703f7abe8d6a7c82a4a09fef92d97c34088b6ae51474L1-L327): Deleted the entire file, which contained macOS-specific implementations of the `Connection` class. This eliminates platform-specific handling in favor of a unified approach. * [`mssql_python/db_connection.py`](diffhunk://#diff-dc442a0da15dacf049752b6c1aa47a48f9e84fb6965215dd3b2457d9cc19de82L6-L10): Removed conditional imports for macOS and updated the `Connection` import to use the unified implementation. * [`mssql_python/pybind/CMakeLists.txt`](diffhunk://#diff-dbb5892fbbb28149d1639664797cf3adb48ced28ec11aba95f2e2b338ca46badL181-L194): Removed the conditional block for macOS-specific source files (`ddbc_bindings_mac.cpp`) and standardized the build process to use `ddbc_bindings.cpp`. ### Transition to UTF-8 string handling: * [`mssql_python/pybind/connection/connection.cpp`](diffhunk://#diff-eca696c13d997f510e5f9b16288ed1deb0ad132768c283eda1518f78edf9b6ecL239-R253): Updated `ConnectionHandle` to convert connection strings from UTF-8 to wide strings (`std::wstring`) internally, ensuring compatibility across platforms. * [`mssql_python/pybind/connection/connection.h`](diffhunk://#diff-c74277ea1f36fff8f6bbe9df3fd722f7d270f3d6a3069ac7a747fe6d4235cf13L60-R60): Changed the constructor of `ConnectionHandle` to accept UTF-8 strings (`std::string`) instead of wide strings (`std::wstring`). * [`mssql_python/pybind/ddbc_bindings.cpp`](diffhunk://#diff-dde2297345718ec449a14e7dff91b7bb2342b008ecc071f562233646d71144a1L2074-R2074): Updated the Python bindings for `ConnectionHandle` to accept UTF-8 strings for the connection string parameter. ### Minor adjustments: * [`mssql_python/pybind/connection/connection_pool.cpp`](diffhunk://#diff-35a698bc3405cc30c1bf656066bd0575302239b5e39083a8160a6202026ca360L8): Removed an unused `#include <iostream>` statement to clean up the code. ### Issue Reference [AB#37666](https://sqlclientdrivers.visualstudio.com/c6d89619-62de-46a0-8b46-70b92a84d85e/_workitems/edit/37666) [AB#37610](https://sqlclientdrivers.visualstudio.com/c6d89619-62de-46a0-8b46-70b92a84d85e/_workitems/edit/37610)
1 parent 02a2afa commit 918b328

9 files changed

Lines changed: 23 additions & 1095 deletions

File tree

mssql_python/connection_mac.py

Lines changed: 0 additions & 327 deletions
This file was deleted.

0 commit comments

Comments
 (0)