-
Notifications
You must be signed in to change notification settings - Fork 31
FEAT: Adding options for BCP with comparison bcp.exe #53
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
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 introduces structured data models for BCP (Bulk Copy Program) configuration to improve type safety and organization of bcp.exe options.
- Added a
ColumnFormatdataclass for column-specific format settings. - Added a
BCPOptionsdataclass encapsulating overall BCP operation parameters. - Centralized BCP flags and file paths into well-typed attributes for clarity.
Comments suppressed due to low confidence (1)
mssql_python/bcp_options.py:10
- [nitpick] The name server_col is ambiguous; consider renaming to server_column_index for clarity and consistency.
server_col: int = 1 # Option: (format_file) or (server_col)
sumitmsft
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.
Although this PR has just added the options for the BCP, I have added a few comments\best practices to be followed when you implement the logic. Make sure you adhere to all the validations I have suggested along with others wherever possible.
sumitmsft
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.
All requested changes have been merged. PR approved.
bewithgaurav
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.
Re-approved since the pending comments and changes are resolved now.
PYTHON BCP OPTIONS
For feature requests
FEAT: This pull request introduces a new data model for managing BCP (Bulk Copy Program) options in the
mssql_pythonpackage. The changes add two@dataclassstructures,ColumnFormatandBCPOptions, to encapsulate the configuration details for BCP operations in a structured and type-safe manner.Summary
mssql_python/bcp_options.py:ColumnFormatdataclass to define column-specific configurations such asprefix_len,data_len, and terminators (field_terminatorandrow_terminator).BCPOptionsdataclass to represent BCP operation settings, including options for direction (inorout), file paths (data_file,error_file, etc.), batch size, error handling, and column configurations.