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

Bind by Index #82

Open
chands10 opened this issue Dec 18, 2024 · 0 comments
Open

Bind by Index #82

chands10 opened this issue Dec 18, 2024 · 0 comments

Comments

@chands10
Copy link

chands10 commented Dec 18, 2024

cdb2api supports binding parameters by index. Could that be ported to the cdb2 library?
Could be implemented as handle.execute(query, [ParameterValue]) and/or handle.execute(query, {int: ParameterValue}) where each parameter is mapped with 1-based indexing, and query uses ? as parameters

Note that you cannot bind an array by index

Examples:
handle.execute("select ?", [10])
handle.execute("select ?", {1: 10})
Both of these would output 10

https://peps.python.org/pep-0249/#id53 supports using a sequence or mapping from index to value

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

No branches or pull requests

1 participant