clickhouse-rs
clickhouse-rs copied to clipboard
Feature Request: Query with Parameters
The library currently does not support sending a query with parameters out of band (eg: to avoid sql injections). It would be nice to have a way to send a query and the provide the parameters separately. Eg:
let query = Query::new("select * from foo where x = ?").add_param("whatever").build();
@suharev7 @mitsuhiko maybe https://docs.rs/postgres-protocol/0.6.4/postgres_protocol/escape/fn.escape_literal.html can be used to implement this?
That seems like the wrong way to accomplish that.
@mitsuhiko Maybe https://docs.rs/sqlparser/latest/sqlparser/ would fit better? It supports ClickHouse dialect. We use it exactly for mentioned purpose.