Implement APD/IPD descriptor integration for parameter binding#566
Open
sfc-gh-makowalski wants to merge 2 commits intoodbc-bind-parameter-testsfrom
Open
Implement APD/IPD descriptor integration for parameter binding#566sfc-gh-makowalski wants to merge 2 commits intoodbc-bind-parameter-testsfrom
sfc-gh-makowalski wants to merge 2 commits intoodbc-bind-parameter-testsfrom
Conversation
This was referenced Mar 18, 2026
Contributor
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
e85c7a7 to
8314ac6
Compare
26a7d3b to
3a30fe6
Compare
8314ac6 to
9a07a9c
Compare
3a30fe6 to
4afa8d8
Compare
2563283 to
d68dc81
Compare
4afa8d8 to
128afe0
Compare
d68dc81 to
c7d5424
Compare
128afe0 to
54cbb52
Compare
c7d5424 to
c974721
Compare
54cbb52 to
7e0c5ea
Compare
c974721 to
e4297d7
Compare
7e0c5ea to
0306feb
Compare
e4297d7 to
8d00e31
Compare
0306feb to
7596afe
Compare
8d00e31 to
c30040c
Compare
7596afe to
c24ae71
Compare
c24ae71 to
ca07516
Compare
dafe50f to
caec91d
Compare
Replace the ad-hoc parameter_bindings HashMap with proper ODBC descriptor types (ApdDescriptor/IpdDescriptor) as the source of truth for parameter binding. SQLBindParameter now writes to APD (application side: C type, data pointer, buffer length, indicator) and IPD (implementation side: SQL type, column size, decimal digits, direction) separately. At execution time, records are zipped into ParameterBinding for the existing conversion pipeline. - Add ApdDescriptor with ApdRecord and IpdDescriptor with IpdRecord - Add DescriptorRef::Apd/Ipd variants for proper dispatch - Add APD/IPD branches to get_desc_field/set_desc_field - Add DescField::ParameterType (1015) and DescField::Nullable (1008) - Implement SQLNumParams and SQLDescribeParam (FFI + exports) - SQLFreeStmt(SQL_RESET_PARAMS) now clears APD+IPD records - column_size and decimal_digits are now stored in IPD (previously ignored) Made-with: Cursor
Made-with: Cursor
a13e594 to
a1fc57c
Compare
caec91d to
90c0a16
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Summary
parameter_bindingsHashMap with proper ODBC APD/IPD descriptors as the source of truth for parameter binding.SQLBindParameternow writes to the APD (C type, data pointer, buffer length, indicator) and IPD (SQL type, column size, decimal digits, direction) separately.SQLNumParamsandSQLDescribeParam— these read directly from the IPD descriptor, providing parameter metadata to applications.SQLGetDescField/SQLSetDescField— applications can now bind parameters via descriptor manipulation as an alternative toSQLBindParameter.Changes
types.rsApdDescriptor,ApdRecord,IpdDescriptor,IpdRecordstructs;DescriptorRefnow hasApd/Ipdvariants;DescFieldgainsParameterType(1015) andNullable(1008);StatementusesApdDescriptor/IpdDescriptorinstead ofparameter_bindingsHashMapstatement.rsbind_parameterwrites to APD+IPD;apply_parameter_bindingsreads from APD+IPD;free_stmt(RESET_PARAMS)clears both descriptors; newnum_paramsanddescribe_paramfunctionsdescriptor.rsget_apd_field/set_apd_fieldandget_ipd_field/set_ipd_fieldhandlersc_api.rsSQLNumParamsandSQLDescribeParamFFI exportsparam_binding.rsodbc_bindings_to_jsonnow takes&ApdDescriptor, &IpdDescriptorand reconstructsParameterBindingat execution timeexports.defSQLNumParamsandSQLDescribeParamhandle_allocation.rsDesign
Per ODBC spec, parameter binding is split across two descriptors:
SQLBindParameterpopulates both. At execution time, APD+IPD records are zipped into the existingParameterBindingstruct for the conversion pipeline (ParamConverter→ReadODBC→WriteJson→ JSON). The conversion layer is unchanged.Test plan
SQLNumParamsreturns correct count after bindingSQLDescribeParamreturns correct type infoSQLSetDescFieldon APD/IPD affects executionMade with Cursor