Hello. I would like to use clickhouse query parameters within the datasource queries.
e.g. I can pass parameters into clickhouse like this:
$ curl "https://play.clickhouse.com/?user=explorer¶m_a=hello¶m_b=world" --data-binary "select {a:String}"
hello
Solutions I see:
- Just pass all the dashboard variables as clickhouse query-string parameters.
- Give a selection of dashboard variables in the datasource input form.
- Like in the infinity-datasource give a form that maps grafana vars to params using grafana templating. e.g. a list of field pairs
<clickhouse param>: <grafana var template>. For example: a:${a}
I see that this feature is mentioned in a TODO comment:
|
// TODO: support query parameters: https://clickhouse.com/docs/en/interfaces/cli#cli-queries-with-parameters |
Hello. I would like to use clickhouse query parameters within the datasource queries.
e.g. I can pass parameters into clickhouse like this:
Solutions I see:
<clickhouse param>:<grafana var template>. For example:a:${a}I see that this feature is mentioned in a
TODOcomment:clickhouse-datasource/src/data/ast.ts
Line 67 in fc6df16