Skip to content

Conversation

jahnvi480
Copy link
Contributor

@jahnvi480 jahnvi480 commented Aug 22, 2025

Work Item / Issue Reference

AB#34911


Summary

This pull request adds support for retrieving ODBC driver and data source information through a new getinfo method on the Python Connection class. It introduces a comprehensive set of ODBC info constants, implements the necessary C++ bindings to call SQLGetInfo, and exposes this functionality to Python. The changes also include tests and documentation for the new feature.

New Feature: Driver and Data Source Information Retrieval

  • Added a getinfo method to the Python Connection class, allowing users to query various ODBC driver and data source properties. This method checks connection state and delegates to the underlying C++ implementation.
  • Introduced a new GetInfoConstants enum in constants.py containing a wide set of ODBC information codes for use with getinfo.

C++ Backend and Bindings

  • Implemented the getInfo method in the C++ Connection and ConnectionHandle classes, which calls SQLGetInfoW and returns the result as the appropriate Python type (string or integer).
  • Added the SQLGetInfoFunc typedef, function pointer, and dynamic loading logic in the C++ bindings to support SQLGetInfoW. Updated the module to expose get_info to Python.

Testing and Usability

  • Imported the new GetInfoConstants as sql_const in the test suite to facilitate usage in tests.

@github-actions github-actions bot added the pr-size: medium Moderate update size 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: medium Moderate update size
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant