Does replace_placeholders really work as intended? #1378
-
I assumed I could use this function to resolve binding parameters. e.g.: query = "SELECT * FROM tbl WHERE col1 = ? AND col2 = ?"
exp.replace_placeholders( parse_one(query), "abc", 123 ) Expected: Actually: If I write
it results in
Thus my questions:
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
It's been some time since we added this, so I might be forgetting something, but what you're saying feels reasonable to me. Maybe we need to have @tobymao did we want to implement this only for identifiers for some reason? If not, happy to rework this, as Mike suggested. |
Beta Was this translation helpful? Give feedback.
-
replace_placeholders should be calling convert so that passing in "x" -> Literal.string, if you want to replace a table or column, the user needs to pass in an identifier directly |
Beta Was this translation helpful? Give feedback.
-
Fixed in 2d243af |
Beta Was this translation helpful? Give feedback.
Fixed in 2d243af