influxdata / influxdata/kapacitor

Feature Request - var interpolation inside of query()

Open
#1,109 3 comments 2 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
2.4k
Forks
479
Avg merge
4d 16h
Merged PRs (30d)
4

Description

When creating a template, it'd be really handy to be able to pass in a relevant string that varies between tasks vs having to pass the entire query into the var

```
var thingName string
var crit lambda

batch
|query('''
SELECT mean("value")
FROM "myDB"."autogen".foo
WHERE "thing" = {{ thingName }}
''')
...
|alert()
.crit(crit)
...
```

Contributor guide

Open the contributing guide

Research direction

Start by tracing how query() templates handle variables and how the example's thingName and crit values are resolved. Define the interpolation behavior and verify that task-specific values can be supplied without passing the entire query through a variable.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.