influxdata / influxdata/influxdb-client-csharp
Flux query builder fluent API
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 377
- Forks
- 93
- Avg merge
- 9m
- Merged PRs (30d)
- 2
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:
```csharp
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files, tests, or entry points are named. Start by surveying the existing manual Flux query construction and the separate LINQ-based query library mentioned in the issue, then determine the scope and API shape for dynamic data and metrics; done means an agreed fluent API can produce valid Flux queries like the example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- api, backend-api-design, database
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100