-
Notifications
You must be signed in to change notification settings - Fork 168
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
Execute prepared statements on client side by default #310
base: master
Are you sure you want to change the base?
Execute prepared statements on client side by default #310
Conversation
Just to complete the information for @hashhar. We discussed the following approaches
|
question_mark_positions.reverse() | ||
for index, value in enumerate(reversed(params)): | ||
operation = "".join([operation[:question_mark_positions[index]], | ||
"'", value, "'", |
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.
The value should not be enclosed by single quotes but use the appropriate type string.
) | ||
|
||
# substitue parameters in query in reversed order | ||
question_mark_positions = [index for index, character in enumerate(operation) if character == '?'] |
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.
Alternative to the reverse trick is to use string slicing. maybe that would be slightly more readable?
1daa3d4
to
dab8de2
Compare
Doing on the client side makes the most sense to me depending on what problem we're trying to solve. 1 (directly manipulate ClientSession) seems like a hack. I think we can do the following:
For paramstyle = format we need to:
Where the handling of qmark and format style needs to be done? - to me it seems the logical place is to have two The question we need to answerWhat's the biggest problem we want to solve?
If we want to solve 1 then the only solution is what we discuss above. To be honest I don't know which of these problems people actually care about. The benefit of customizable |
Draft PR to discuss approach for #306