Skip to content

Allow query options to be set on each Statement object #640

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

Closed
wants to merge 4 commits into from

Conversation

sodabrew
Copy link
Collaborator

The original Prepared Statements API didn't provide a way to pass query options into the prepare or execute phase of a statement. Rather, you'd have to modify the query options on the Client object prior to each Statement#execute.

In this PR, I've added a query options argument to Client#prepare, analogous to Client#query, and save a copy of these options into the Statement object, to be used for each Statement#execute.

I sort of wish the options were on Statement#execute, but I can't think of any way to differentiate between "argument that is supposed to be a ? replacement" and "argument that is the options hash".

@sodabrew sodabrew force-pushed the stmt_options branch 2 times, most recently from efbf12a to bc5097c Compare July 17, 2015 06:14
@sodabrew sodabrew force-pushed the stmt_options branch 3 times, most recently from 3db24ce to d5d050a Compare September 16, 2015 05:49
@sodabrew sodabrew added this to the 0.5.0 milestone Feb 17, 2016
@sodabrew
Copy link
Collaborator Author

@jeremyevans Thanks for bringing this issue up in #774. I've hesitated on this PR because I wasn't sure if it was actually needed, or if it even made sense to store different query options into each statement. It's also not obvious to me whether a change to query options on the Client itself should override the options on a Statement that was created previously. Your feedback as a user greatly appreciated!

@sodabrew sodabrew force-pushed the stmt_options branch 2 times, most recently from 88ea788 to 3bfc12a Compare November 26, 2017 05:51
@sodabrew
Copy link
Collaborator Author

Closing in favor of #912

@sodabrew sodabrew closed this Nov 29, 2017
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