influxdb-client-csharp icon indicating copy to clipboard operation
influxdb-client-csharp copied to clipboard

feat: add support to filter by `Instant`, `ZonedDateTime`, `OffsetDateTime`, ... in LINQ

Open Sylvain2703 opened this issue 5 months ago • 3 comments

Proposed Changes

Features

  • Add nanosecond precision support to the DateTimeLiteral AST type (thanks to NodaTime's Instant).
  • Add support in LINQ queries for:
    • NodaTime's Instant, ZonedDateTime, OffsetDateTime, OffsetDate, LocalDateTime and LocalDate,
    • .NET 6+ DateOnly (adding net6.0 to InfluxDB.Client.Linq's TargetFrameworks),
    • NodaTime's Duration and Period,
    • Tick precision for TimeSpan (only microsecond precision was supported),
    • Unsigned integers, sbyte, short and decimal.

Refactor

  • Use pattern matching when creating AST Expression (in VariableAggregator.CreateExpression()).
  • Remove a useless function call for DateTime conversion (in FluxRecord.GetTimeInDateTime()).

Tests

  • Add tests to cover new supported types and adjust existing ones for TimeSpan precision.

Checklist

  • [ ] CHANGELOG.md updated
  • [x] Rebased/mergeable
  • [x] A test has been added if appropriate
  • [ ] dotnet test completes successfully
  • [x] Commit messages are conventional
  • [x] Sign CLA (if not already signed)

Sylvain2703 avatar Jan 08 '24 19:01 Sylvain2703