-
Notifications
You must be signed in to change notification settings - Fork 35
FEAT: BCP implementation in mssql-python driver using rust #402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a new _bulkcopy method to the Cursor class that enables high-performance bulk data insertion into SQL Server tables using a Rust-based implementation from the mssql_py_core library. The implementation includes connection string parsing, input validation, error handling, and resource cleanup.
Changes:
- Added
_bulkcopymethod supporting bulk copy operations with configurable batch size and timeout - Implemented connection string parsing to extract database connection parameters
- Added comprehensive error handling and resource cleanup mechanisms
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
📊 Code Coverage Report
Diff CoverageDiff: main...HEAD, staged and unstaged changes
Summary
📋 Files Needing Attention📉 Files with overall lowest coverage (click to expand)mssql_python.pybind.logger_bridge.hpp: 58.8%
mssql_python.pybind.logger_bridge.cpp: 59.2%
mssql_python.row.py: 66.2%
mssql_python.helpers.py: 67.5%
mssql_python.pybind.ddbc_bindings.cpp: 69.4%
mssql_python.pybind.ddbc_bindings.h: 71.7%
mssql_python.pybind.connection.connection.cpp: 73.6%
mssql_python.ddbc_bindings.py: 79.6%
mssql_python.pybind.connection.connection_pool.cpp: 79.6%
mssql_python.connection.py: 84.1%🔗 Quick Links
|
saurabh500
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some API docs comments and some comments about removal of references to programming languages i.e. Python and Rust.
Summary
This pull request introduces a new method to the
cursor.pyfile that enables efficient bulk copy operations using a Rust-based implementation. The main addition is the_bulkcopymethod, which leverages themssql_py_coreRust library to perform high-performance data transfers from Python into SQL Server tables. The method includes robust input validation, connection handling, and error management.Bulk Copy Feature:
_bulkcopymethod to thecursor.pyclass, allowing bulk data insertion into a SQL Server table using the Rust-basedmssql_py_corelibrary. This method supports configurable batch size, timeout, and column mappings, and provides detailed error handling and resource cleanup.Input Validation and Error Handling:
_bulkcopymethod validates its parameters (such astable_name,batch_size, andtimeout) and checks for the presence of required connection string components, raising appropriate exceptions for invalid input or missing dependencies.Integration and Resource Management: