-
Notifications
You must be signed in to change notification settings - Fork 96
Open
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed
Description
Currently, the queries have to be built manually in a string. It would be great to have a fluent API to build a query.
I know you guys are working on another library to query by using LINQ, but that requires having the data modeled and annotated in C# classes, which is not always possible due to the nature of dynamic data and metrics.
I'm proposing an API that can do things like the following:
var query = influxDb.GetQueryBuilder()
.From("bucket")
.Filter(r => r["_measurement"] == "cpu")
.Filter(r => r["_field"] == "temperature")
.Filter(r => r["some-tag"] == "some-value")
.AggregateWindow(every: TimeSpan.FromSeconds(10), fn: InfluxDb.Functions.Mean, createEmpty: false)
.Yield("mean")
.ToString();
This way we could be writing queries in a .NET idiomatic way and ensuring the resulting strings are valid Flux queries.
ldematte, maxreb, uvbkq and danpercic86
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed