Skip to content

Support query parameters #1200

@KGOH

Description

@KGOH

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&param_a=hello&param_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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions