-
Notifications
You must be signed in to change notification settings - Fork 173
feat(c/driver/sqlite,python/adbc_driver_manager): bind params by name #3362
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
Conversation
|
The Python side is not fully wired up yet but I would appreciate opinions on using an option to tell drivers to bind parameters by name and not position. @zeroshade @amoeba @WillAyd @paleolimbot My reasoning:
The tests in this PR aren't complete yet on the Python side. |
| table, or record batch reader (to provide multiple | ||
| parameters, which will each be bound in turn). | ||
| Parameters to bind. Can be a Python sequence (to bind a single | ||
| set of parameters), a Python dictionary (to bind a single set of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does providing a dictionary automatically set the option to bind by name? If not, should it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will, yes. It's only when using Arrow data that you have to manage it explicitly.
paleolimbot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems great! I'll wire it up in R after this merges (not sure there's a good way to pass through statement options to read_adbc() or execute_adbc() yet).
| "adbc.sqlite.load_extension.entrypoint"; | ||
| /// The batch size for query results (and for initial type inference) | ||
| constexpr std::string_view kStatementOptionBatchRows = "adbc.sqlite.query.batch_rows"; | ||
| constexpr std::string_view kStatementOptionBindByName = "adbc.statement.bind_by_name"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this unique to SQLite or maybe there's another good place for "well known but also we don't really want to update adbc.h" parameters? (I recall there's a Postgres one like that too but I forget what it's called).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should maybe make such a header 😬 arrow-adbc/experimental.h?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another day!
|
Any other comments? |
WillAyd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice work!
| "adbc.sqlite.load_extension.entrypoint"; | ||
| /// The batch size for query results (and for initial type inference) | ||
| constexpr std::string_view kStatementOptionBatchRows = "adbc.sqlite.query.batch_rows"; | ||
| constexpr std::string_view kStatementOptionBindByName = "adbc.statement.bind_by_name"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another day!
Closes #3262.