Execute prepared statements on client side by default#310
Execute prepared statements on client side by default#310damian3031 wants to merge 2 commits intotrinodb:masterfrom
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.
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.
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