Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OdbcResult: Ability to explicitely describe parameters #863

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

detule
Copy link
Collaborator

@detule detule commented Nov 30, 2024

Hi @simonpcouch @hadley

This is a draft/RFC of a feature that would allow (power) users to explicitly describe parameter attributes when submitting parametrized queries.

The details are in #518 and this PR would address the issue there. In summary:

  • We do a very good job of inferring the parameter metadata, but at the end of the day it's only an informed guess.
  • In some cases the user may wish to override those inferred values. Linked issue above is one of those.
  • Offer them the ability to do that. This type of feature is not uncommon in other ODBC programming interfaces.

Some notes about the PR:

  • Added an ODBC_TYPE helper method that would help with the user not having to guess what integer corresponds to SQL_WVARCHAR, for example.
  • The example is in ?OdbcResult.
  • I have a few items below as TODOs, including offering the usage of this parameter more broadly.

TODO:

  • Rename ODBC_TYPE to SQL_TYPE
  • Permeate parameter_description to dbSendQuery, dbGetQuery
  • Add unit tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant