FEAT: Adding primary key API #196
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Work Item / Issue Reference
Summary
This pull request adds support for retrieving primary key information from database tables using a new
primaryKeysmethod on thecursorobject. It introduces the necessary C++/ODBC bindings, Python method, and a comprehensive set of tests to validate the new functionality.Primary Key Metadata Support
primaryKeysmethod to thecursorclass incursor.pyto allow users to retrieve primary key columns for a specified table, including support for catalog and schema filtering. The method handles ODBC API requirements and result formatting.ODBC/C++ Binding Enhancements
SQLPrimaryKeysFuncfunction pointer and associated logic in the C++ ODBC bindings (ddbc_bindings.cppandddbc_bindings.h), including function pointer loading, wrapper implementation, and Python module export, enabling Python to call the ODBCSQLPrimaryKeysAPI.Testing Improvements
test_004_cursor.pyto verify the behavior of the newprimaryKeysmethod, including setup and cleanup of test tables, validation for single and composite primary keys, column metadata correctness, handling of non-existent tables, and catalog filtering.