In quite a few cases, the query can be longer than one line can fit, so we have to move cursors back and forth to check the whole query.
Possible ways:
1 would be simplest given such library exists (or extend https://github.com/peterh/liner to support it), 3 is also acceptable and trivial to implement.
How do you guys think?
This would definitely be useful -- thanks @fffw . I think 1 and 3 are most feasible. I'd like to see 1 in action.
For reference the CLI code is at https://github.com/influxdb/influxdb/blob/master/cmd/influx/main.go
liner is inspired by linenoise, and linenoise supports multiline mode.
I think it's appropriate to patch liner to support it, and I'll give it a try if you guys like this idea.
Thanks @flisky -- if you patch liner, will you need to wait for that patch to be merged before we can use it?
Yes, I think so. Upstream merge is great, and liner seems to be active maintained.
OK, since we already import the package I think it's a valid approach.
Awesome :clap:
Apologies for commenting on an old issue but I'm having trouble figuring out if/ how this works. I'm using v0.11 and I'm seeing the following behavior in the interactive CLI:
> CREATE CONTINUOUS QUERY cq_hourly_readings ON myDB BEGIN
ERR: error parsing query: found EOF, expected SELECT at line 1, char 67
> CREATE CONTINUOUS QUERY cq_hourly_readings ON myDB BEGIN \
ERR: error parsing query: found \, expected SELECT at line 1, char 67
I also can't find any mention of this issue in the CHANGELOG. Has it been released?
This issue added support for line wrapping (option 1 above). Multiline queries with trailing backslashes are not currently supported. Please open a new issue with a feature request if you'd like it added.
Note that new lines can be be included in queries, without backslashes, when directly interacting with the HTTP /query endpoint.
Most helpful comment
Apologies for commenting on an old issue but I'm having trouble figuring out if/ how this works. I'm using v0.11 and I'm seeing the following behavior in the interactive CLI:
I also can't find any mention of this issue in the CHANGELOG. Has it been released?