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
### Work Item / Issue Reference
<!--
IMPORTANT: Please follow the PR template guidelines below.
For mssql-python maintainers: Insert your ADO Work Item ID below (e.g.
AB#37452)
For external contributors: Insert Github Issue number below (e.g. #149)
Only one reference is required - either GitHub issue OR ADO Work Item.
-->
<!-- mssql-python maintainers: ADO Work Item -->
>
[AB#38478](https://sqlclientdrivers.visualstudio.com/c6d89619-62de-46a0-8b46-70b92a84d85e/_workitems/edit/38478)
-------------------------------------------------------------------
### Summary
This pull request refactors the `connection.cpp` and `connection.h`
files to improve code readability, maintainability, and consistency,
while also making minor corrections and clarifications to comments. The
changes mainly involve formatting, type usage, and error handling
improvements, as well as updating include paths and constructor
signatures.
**Code Formatting and Readability Improvements**
* Reformatted function calls and argument lists for better readability,
including breaking up long lines and grouping parameters logically in
methods such as `getEnvHandle`, `allocateDbcHandle`, `commit`,
`rollback`, and others in `connection.cpp`.
* Improved comment formatting and clarity, including updating TODOs and
explanatory comments to be more precise and easier to understand.
**Type and Variable Usage Updates**
* Updated integer types in `setAttribute` from `long long` to `int64_t`
for clarity and platform consistency.
* Improved buffer management for string and binary attributes by
clarifying buffer lifetime logic and using more explicit type casts.
**Error Handling Enhancements**
* Enhanced error handling in attribute setting and connection attribute
application, including more detailed error messages and fallback logic.
**Include Path and Constructor Signature Updates**
* Updated include paths in both `connection.cpp` and `connection.h` for
consistency and to support future platform agnostic changes.
* Modified the `ConnectionHandle` constructor signature to improve
clarity and maintainability.
0 commit comments