-
Notifications
You must be signed in to change notification settings - Fork 117
feat: adding flux query parameters #308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
3c6e73c
to
82759e0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome improvement 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🍻
@@ -2,6 +2,8 @@ | |||
### Features | |||
- [#304](https://github.com/influxdata/influxdb-client-go/pull/304) Added public constructor for `QueryTableResult` | |||
- [#307](https://github.com/influxdata/influxdb-client-go/pull/307) Synced generated server API with the latest [oss.yml](https://github.com/influxdata/openapi/blob/master/contracts/oss.yml). | |||
- [#308](https://github.com/influxdata/influxdb-client-go/pull/308) Added Flux query parameters. Supported by InfluxDB Cloud only now. | |||
- [#308](https://github.com/influxdata/influxdb-client-go/pull/308) Go 1.17 is required |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it depend on 1.17 features? Isn't it the case that 1.17 is now used by tests, so it is not a feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should IMHO at least follow Go Security Policy so that each major Go release is supported until there are two newer major releases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Go 1.17 is required because the new feature uses https://pkg.go.dev/reflect#VisibleFields, which is the new addon from Roger Peppe released in 1.17. It is out almost 6 months.
Go V3, where this feature was added originally, already uses 1.17 (although it is still in progress, it was supposed to be ready soon). Other products in InfluxData also require Go 1.17 (although not libraries).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the explanation. 1.18 is likely to come this month and 1.16 will thus go out of support. So it makes sense to require 1.17 herein.
@@ -2,6 +2,8 @@ | |||
### Features | |||
- [#304](https://github.com/influxdata/influxdb-client-go/pull/304) Added public constructor for `QueryTableResult` | |||
- [#307](https://github.com/influxdata/influxdb-client-go/pull/307) Synced generated server API with the latest [oss.yml](https://github.com/influxdata/openapi/blob/master/contracts/oss.yml). | |||
- [#308](https://github.com/influxdata/influxdb-client-go/pull/308) Added Flux query parameters. Supported by InfluxDB Cloud only now. | |||
- [#308](https://github.com/influxdata/influxdb-client-go/pull/308) Go 1.17 is required |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the explanation. 1.18 is likely to come this month and 1.16 will thus go out of support. So it makes sense to require 1.17 herein.
Would it be worth making a PR to update the docs to warn that this is not supported in OSS (yet)? Its kinda strange its in the readme but not the docs. |
There is a note in the Readme about this: https://github.com/influxdata/influxdb-client-go#parametrized-queries |
I acknowledge the note in the Readme. My question is if it should be added to the interface doc comments. I didn't use the Readme to figure out how to use the library. I used the docs for the interface itself on pkg.go.dev, and had no idea what error I was getting until I got lucky with a Google search showing the |
I understand your point. |
The same applies to the Readme? And even if OSS gets support soon, some people might not update their dbs for a long while, meaning the warning will be relevent for some Time after.
|
Readme is more often read on GitHub than on the Go API docs site and it can be updated on the fly, I think. |
When will support for parametrized queries be added to OSS? What's the justification for not including it? |
Proposed Changes
Added support for Flux query parameters, available in InfluxDB Cloud only at this moment.
QueryAPI
is extended withQueryWithParams
andQueryRawWithParams
.Query parameters can be passed as a struct or map. Param values can be only simple types or
time.Time
.The name of a struct field or a map key (must be a string) will become a param name
The name of the parameter represented by a struct field can be specified by JSON annotation:
Additionally, this requires changing the minimum Go version to 1.17.
Checklist
Closes #146