From f404ff50b26aa01c795b5e6cfa869294545e851d Mon Sep 17 00:00:00 2001 From: vlastahajek <29980246+vlastahajek@users.noreply.github.com> Date: Thu, 12 Dec 2024 16:27:39 +0100 Subject: [PATCH] chore: prepare v2 --- CHANGELOG.md | 22 ++++++++++++++++++- README.md | 4 ++-- examples/Basic/basic.go | 2 +- examples/Batching/batching.go | 4 ++-- examples/Downsampling/downsampling.go | 2 +- examples/HTTPErrorHandled/httpErrorHandled.go | 2 +- examples/LPBatching/lpBatching.go | 4 ++-- go.mod | 2 +- influxdb3/batching/batcher.go | 2 +- influxdb3/batching/batcher_test.go | 2 +- influxdb3/batching/example_test.go | 4 ++-- influxdb3/client_e2e_test.go | 4 ++-- influxdb3/write.go | 2 +- 13 files changed, 38 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 691e65d..b74af40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,25 @@ -## 1.1.0 [unreleased] +## 2.0.0 [unreleased] +### Breaking Changes + +:warning: **This is a breaking change release.** + +> Previously, the Query API did not respect the metadata type for columns returned from InfluxDB v3. This release fixes this issue. As a result, the type of some columns may differ from previous versions. For example, the timestamp column will now be `time.Time` instead of `arrow.Timestamp`. + +Update steps: +1. Update library: `go get github.com/influxdata/influxdb3-go/v2` +1. Update import path in Go files to `github.com/influxdata/influxdb3-go/v2/influxdb3`. + +### Features + +1. [#114](https://github.com/InfluxCommunity/influxdb3-go/pull/114): Query API respects metadata types for columns returned from InfluxDB v3. + Tags are mapped as a "string", timestamp as "time.Time", and fields as their respective types: + - iox::column_type::field::integer: => int64 + - iox::column_type::field::uinteger: => uint64 + - iox::column_type::field::float: => float64 + - iox::column_type::field::string: => string + - iox::column_type::field::boolean: => bool + ## 1.0.0 [2024-11-15] ### Breaking Changes diff --git a/README.md b/README.md index 53fe095..14358c6 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ To use this client, you'll need the following credentials for writing and queryi ```sh - go get github.com/InfluxCommunity/influxdb3-go + go get github.com/InfluxCommunity/influxdb3-go/v2 ``` ### Outside a module (standalone) @@ -79,7 +79,7 @@ import ( "fmt" "os" - "github.com/InfluxCommunity/influxdb3-go/influxdb3/v1" + "github.com/InfluxCommunity/influxdb3-go/v2/influxdb3" ) ``` diff --git a/examples/Basic/basic.go b/examples/Basic/basic.go index 598056f..5d906af 100644 --- a/examples/Basic/basic.go +++ b/examples/Basic/basic.go @@ -6,7 +6,7 @@ import ( "os" "time" - "github.com/InfluxCommunity/influxdb3-go/v1/influxdb3" + "github.com/InfluxCommunity/influxdb3-go/v2/influxdb3" ) func main() { diff --git a/examples/Batching/batching.go b/examples/Batching/batching.go index a0e2b4e..5262822 100644 --- a/examples/Batching/batching.go +++ b/examples/Batching/batching.go @@ -8,8 +8,8 @@ import ( "text/tabwriter" "time" - "github.com/InfluxCommunity/influxdb3-go/v1/influxdb3" - "github.com/InfluxCommunity/influxdb3-go/v1/influxdb3/batching" + "github.com/InfluxCommunity/influxdb3-go/v2/influxdb3" + "github.com/InfluxCommunity/influxdb3-go/v2/influxdb3/batching" ) const NumPoints = 54 diff --git a/examples/Downsampling/downsampling.go b/examples/Downsampling/downsampling.go index fb39f2b..6c91add 100644 --- a/examples/Downsampling/downsampling.go +++ b/examples/Downsampling/downsampling.go @@ -7,7 +7,7 @@ import ( "os" "time" - "github.com/InfluxCommunity/influxdb3-go/v1/influxdb3" + "github.com/InfluxCommunity/influxdb3-go/v2/influxdb3" ) func main() { diff --git a/examples/HTTPErrorHandled/httpErrorHandled.go b/examples/HTTPErrorHandled/httpErrorHandled.go index e2c4b84..dbdf5ce 100644 --- a/examples/HTTPErrorHandled/httpErrorHandled.go +++ b/examples/HTTPErrorHandled/httpErrorHandled.go @@ -7,7 +7,7 @@ import ( "log" "os" - "github.com/InfluxCommunity/influxdb3-go/v1/influxdb3" + "github.com/InfluxCommunity/influxdb3-go/v2/influxdb3" ) // Demonstrates working with HTTP response headers in ServerError diff --git a/examples/LPBatching/lpBatching.go b/examples/LPBatching/lpBatching.go index 88658c8..3a647b0 100644 --- a/examples/LPBatching/lpBatching.go +++ b/examples/LPBatching/lpBatching.go @@ -9,8 +9,8 @@ import ( "text/tabwriter" "time" - "github.com/InfluxCommunity/influxdb3-go/v1/influxdb3" - "github.com/InfluxCommunity/influxdb3-go/v1/influxdb3/batching" + "github.com/InfluxCommunity/influxdb3-go/v2/influxdb3" + "github.com/InfluxCommunity/influxdb3-go/v2/influxdb3/batching" ) const LineCount = 100 diff --git a/go.mod b/go.mod index 95c96ad..b148495 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/InfluxCommunity/influxdb3-go/v1 +module github.com/InfluxCommunity/influxdb3-go/v2 go 1.22.7 diff --git a/influxdb3/batching/batcher.go b/influxdb3/batching/batcher.go index 6bd0ba8..a31f1b5 100644 --- a/influxdb3/batching/batcher.go +++ b/influxdb3/batching/batcher.go @@ -28,7 +28,7 @@ import ( "log/slog" "sync" - "github.com/InfluxCommunity/influxdb3-go/v1/influxdb3" + "github.com/InfluxCommunity/influxdb3-go/v2/influxdb3" ) // DefaultBatchSize is the default number of points emitted diff --git a/influxdb3/batching/batcher_test.go b/influxdb3/batching/batcher_test.go index fe6b3a7..3f877a3 100644 --- a/influxdb3/batching/batcher_test.go +++ b/influxdb3/batching/batcher_test.go @@ -27,7 +27,7 @@ import ( "testing" "time" - "github.com/InfluxCommunity/influxdb3-go/v1/influxdb3" + "github.com/InfluxCommunity/influxdb3-go/v2/influxdb3" "github.com/stretchr/testify/assert" ) diff --git a/influxdb3/batching/example_test.go b/influxdb3/batching/example_test.go index c7dbd18..90d8337 100644 --- a/influxdb3/batching/example_test.go +++ b/influxdb3/batching/example_test.go @@ -29,8 +29,8 @@ import ( "math/rand" "time" - "github.com/InfluxCommunity/influxdb3-go/v1/influxdb3" - "github.com/InfluxCommunity/influxdb3-go/v1/influxdb3/batching" + "github.com/InfluxCommunity/influxdb3-go/v2/influxdb3" + "github.com/InfluxCommunity/influxdb3-go/v2/influxdb3/batching" ) func Example_batcher() { diff --git a/influxdb3/client_e2e_test.go b/influxdb3/client_e2e_test.go index 17d64cb..c18dd2b 100644 --- a/influxdb3/client_e2e_test.go +++ b/influxdb3/client_e2e_test.go @@ -37,8 +37,8 @@ import ( "testing" "time" - "github.com/InfluxCommunity/influxdb3-go/v1/influxdb3" - "github.com/InfluxCommunity/influxdb3-go/v1/influxdb3/batching" + "github.com/InfluxCommunity/influxdb3-go/v2/influxdb3" + "github.com/InfluxCommunity/influxdb3-go/v2/influxdb3/batching" "github.com/influxdata/line-protocol/v2/lineprotocol" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/influxdb3/write.go b/influxdb3/write.go index de796e0..bf5f1fb 100644 --- a/influxdb3/write.go +++ b/influxdb3/write.go @@ -33,7 +33,7 @@ import ( "strings" "time" - "github.com/InfluxCommunity/influxdb3-go/v1/influxdb3/gzip" + "github.com/InfluxCommunity/influxdb3-go/v2/influxdb3/gzip" "github.com/influxdata/line-protocol/v2/lineprotocol" )