influxdata / influxdata/kapacitor
Add string interpolation to all TICKscript strings
- Dominant language
- Go
- Stars
- 2.4k
- Forks
- 479
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 4
Description
Its a common enough practice to use vars as part of string literals in TICKscript we should have native support for string interpolation, therefore removing the need to use the verbose string concatenation methods.
I am thinking something along the lines of:
```
var field = 'count'
var db = 'mydb'
var rp = 'rp'
var m = 'm'
var actual = batch
|query('SELECT "${field}" FROM "${db}"."${rp}"."${m}" ')
//...
```
Currently you have to do this:
```
var field = 'count'
var db = 'mydb'
var rp = 'rp'
var m = 'm'
var actual = batch
|query('SELECT "' + field + '" FROM "' + db + '"."' + rp + '"."' + m + '"')
//...
```
which is significantly harder to read.
Contributor guide
Research direction
The issue names no implementation files or tests. Start by locating the TICKscript parser and string-literal handling, then trace how query strings are evaluated; done means interpolation works for all TICKscript strings while preserving existing concatenation and literal behavior, with coverage for the shown variable substitutions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100