FEAT: Adding procedures API #194
Open
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 metadata about stored procedures in SQL Server via the Python driver, including both temporary and permanent procedures. It introduces a new
procedures()
method on thecursor
object, updates the C++ pybind layer to expose the ODBCSQLProcedures
API, and includes a comprehensive suite of tests to ensure correct behavior across various scenarios.New feature: Procedures metadata retrieval
procedures()
method to thecursor
class inmssql_python/cursor.py
to fetch information about stored procedures, handling both temporary (using direct queries) and permanent procedures (using the ODBC API). The method supports filtering by procedure name, catalog, and schema, and returns detailed metadata for each procedure.ODBC bindings and pybind integration
SQLProceduresFunc
and related extern variable to the ODBC bindings header and implementation files (mssql_python/pybind/ddbc_bindings.h
,mssql_python/pybind/ddbc_bindings.cpp
).SQLProceduresW
function pointer during driver initialization and included it in the required function check.SQLProcedures_wrap
and exposed it to Python asDDBCSQLProcedures
for cross-platform use.Testing and validation
tests/test_004_cursor.py
to verify the newprocedures()
functionality, including filtering by name, schema, and catalog, handling of input/output parameters, result set reporting, and correct behavior with non-existent procedures.