InfluxCommunity / influxdb3-csharp

The C# .NET Client that provides a simple and convenient way to interact with InfluxDB 3.
https://InfluxCommunity.github.io/influxdb3-csharp/
MIT License
24 stars 6 forks source link

feat: add supports for `InfluxQL` #13

Closed bednar closed 1 year ago

bednar commented 1 year ago

Proposed Changes

//
// Query by SQL
//
const string sql = "select time,location,value from temperature order by time desc limit 10";
Console.WriteLine("{0,-30}{1,-15}{2,-15}", "time", "location", "value");
await foreach (var row in client.Query(query: sql))
{
    Console.WriteLine("{0,-30}{1,-15}{2,-15}", row[0], row[1], row[2]);
}
Console.WriteLine();

//
// Query by InfluxQL
//
const string influxQL =
    "select MEAN(value) from temperature group by time(1d) fill(none) order by time desc limit 10";
Console.WriteLine("{0,-30}{1,-15}", "time", "mean");
await foreach (var row in client.Query(query: influxQL, queryType: QueryType.InfluxQL))
{
    Console.WriteLine("{0,-30}{1,-15}", row[1], row[2]);
}

Checklist

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (b75109f) 100.00% compared to head (a5c092e) 100.00%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #13 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 10 10 Lines 737 736 -1 ========================================= - Hits 737 736 -1 ``` | [Impacted Files](https://app.codecov.io/gh/bonitoo-io/influxdb3-csharp/pull/13?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bonitoo-io) | Coverage Δ | | |---|---|---| | [Client/Config/InfluxDBClientConfigs.cs](https://app.codecov.io/gh/bonitoo-io/influxdb3-csharp/pull/13?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bonitoo-io#diff-Q2xpZW50L0NvbmZpZy9JbmZsdXhEQkNsaWVudENvbmZpZ3MuY3M=) | `100.00% <ø> (ø)` | | | [Client/InfluxDBClient.cs](https://app.codecov.io/gh/bonitoo-io/influxdb3-csharp/pull/13?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bonitoo-io#diff-Q2xpZW50L0luZmx1eERCQ2xpZW50LmNz) | `100.00% <100.00%> (ø)` | | | [Client/Internal/FlightSqlClient.cs](https://app.codecov.io/gh/bonitoo-io/influxdb3-csharp/pull/13?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bonitoo-io#diff-Q2xpZW50L0ludGVybmFsL0ZsaWdodFNxbENsaWVudC5jcw==) | `100.00% <100.00%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.