influxdb-client-go icon indicating copy to clipboard operation
influxdb-client-go copied to clipboard

Flux DSL librairy for Go

Open jjauzion opened this issue 2 years ago • 3 comments

Proposal: It would be really nice to have a Flux DSL librairy for the go client; similarly to what exist for the Java client

Current behavior: With the current librairy I have to write the query as a string:

result, err := queryAPI.Query(context.Background(), `from(bucket:"my-bucket")|> range(start: -1h) |> filter(fn: (r) => r._measurement == "stat")`)

Desired behavior: It would be much better if I could chain operator with something like this:

q := queryAPI.Query(context.Background()).Bucket("my-bucket").Range("-1h").Filter("...")
res, err := q.Execute()

Use case: Every time I need to write queries using the go client

jjauzion avatar Jul 21 '22 11:07 jjauzion

Thanks for using this library. Flux DSL is already on in the backlog. This could be added in a few months.

vlastahajek avatar Jul 21 '22 12:07 vlastahajek

If needed, I can help and contribute ;)

jjauzion avatar Jul 21 '22 13:07 jjauzion

Any PR is welcomed 👍

vlastahajek avatar Jul 21 '22 14:07 vlastahajek