Skip to content

Conversation

jahnvi480
Copy link
Contributor

@jahnvi480 jahnvi480 commented Aug 22, 2025

Work Item / Issue Reference

AB#34927


Summary

This pull request adds support for retrieving column metadata from SQL tables via a new columns method on the Cursor class, and exposes the underlying ODBC SQLColumns function through the C++ and Python bindings. The main changes introduce the necessary function pointer, wrapper, and Python binding, as well as the implementation of the new method in Python.

Python API enhancements:

  • Added a columns method to the Cursor class in cursor.py that retrieves column information for specified tables using the ODBC SQLColumns function. This method includes documentation, argument handling, and returns a list of Row objects with detailed column metadata.

C++ bindings and driver integration:

  • Defined a new function pointer type SQLColumnsFunc, its global variable, and ensured it is loaded from the driver in ddbc_bindings.h and ddbc_bindings.cpp.
  • Implemented the SQLColumns_wrap function to call the ODBC SQLColumns API, handling platform differences between Unix and Windows.
  • Exposed the new DDBCSQLColumns function to Python via pybind11 in the module definition.

@github-actions github-actions bot added the pr-size: large Substantial code update label Aug 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-size: large Substantial code update
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant