You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Most of the SQL queries I have are dynamically generated, some parts of the query with user-provided values.
Unfortunately because of the usage of Interpolation in Python it forces me to escape every occurrences of '%' which I cannot do (or it would be way to cumbersome to even try safely).
And I can't rely on the server-side binding to work around this issue because the query will always go through the python formatting.
To Reproduce
client=Client(host='localhost')
# or even empty params for that matterclient.execute(
"select 'Number %' as category from system.numbers WHERE number < 5 LIMIT {max:Int32}",
params={
'max': 10
}
)
Expected behavior
I should be able to choose to rely on server-side binding only to avoid the escaping problem that Interpolating brings.
Versions
Version of package with the problem: 0.2.6
ClickHouse server version: 23.12.2.59
Python version: 3.8.16
The text was updated successfully, but these errors were encountered:
panthony
changed the title
Allowing client-side and server-side binding prevent me from using server-side binding
Using both client-side and server-side binding prevent me from using server-side binding
Jan 17, 2024
panthony
changed the title
Using both client-side and server-side binding prevent me from using server-side binding
Using both client-side and server-side binding prevents using server-side binding
Jan 18, 2024
Describe the bug
Most of the SQL queries I have are dynamically generated, some parts of the query with user-provided values.
Unfortunately because of the usage of Interpolation in Python it forces me to escape every occurrences of '%' which I cannot do (or it would be way to cumbersome to even try safely).
And I can't rely on the server-side binding to work around this issue because the query will always go through the python formatting.
To Reproduce
Expected behavior
I should be able to choose to rely on server-side binding only to avoid the escaping problem that Interpolating brings.
Versions
The text was updated successfully, but these errors were encountered: