Skip to content

3.0.0

Compare
Choose a tag to compare
@puzpuzpuz puzpuzpuz released this 20 Mar 07:46
· 21 commits to main since this release
d4a8ec0

Release overview

Major API improvements including support for InfluxDB Line Protocol over HTTP.

What is new

  • Add support for the ILP protocol over HTTP transport, as well as the new config string syntax #26
    • The new HTTP sender has better error reporting. In particular, it returns an error if the QuestDB server failed to write ILP messages for any reason.
    • HTTP sender handles network errors and retries writes automatically.
    • HTTP sender reuses connections to avoid open connection overhead for each Flush call.
    • The new LineSenderFromConf method provides a convenient way for creating a LineSender based on a config string.

Migration

v2 code example:

package main

import (
	"context"

	qdb "github.com/questdb/go-questdb-client/v2"
)

func main() {
	// Connect to QuestDB running on 127.0.0.1:9009 (ILP/TCP)
	sender, err := qdb.NewLineSender(context.TODO())
	// ...
	defer sender.Close()
	// ...
}

Migrated v3 code:

package main

import (
	"context"

	qdb "github.com/questdb/go-questdb-client/v3"
)

func main() {
	// Connect to QuestDB running on 127.0.0.1:9000 (ILP/HTTP)
	sender, err := qdb.NewLineSender(context.TODO(), qdb.WithHTTP())
	// Alternatively, you can use the LineSenderFromConf function:
	// sender, err := qdb.LineSenderFromConf(ctx, "http::addr=localhost:9000;")
	// ...
	defer sender.Close(context.TODO())
	// ...
}

Note that the migrated code uses the HTTP sender instead of the TCP one.