Parametrically create query request for Golang client?

Currently I’m making a query (via the golang client) to my InfluxDB 2.0 database by creating a giant string that is mostly static. However, there are some elements - like names or timestamps - that I have to enter in by appending the main string with another name string, which itself is constructed using multiple strings joined together.

Is there a way to parametrically ‘build’ a query other than using strings to do so? That is, does the golang influxdb 2.0 library support the construction of a query via parameters, rather than a big string?

Hi @jos, InfluxDB 2 Go client currently doesn’t support query parameters. However, such a feature is already in discussion about features for InfluxDB 2 clients.

Please, create an issue in InfuxDB 2 Go client repo to emphasize this.

For now, you can use sth like fmt.sprintf() to substitute this feature.

1 Like

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.