Skip to content

3.1.0

Compare
Choose a tag to compare
@puzpuzpuz puzpuzpuz released this 02 Aug 16:31
· 4 commits to main since this release
1532472

Release overview

API improvements including a pool of HTTP senders.

What is new

  • Add sender pool (experimental API) #47
package main

import (
	"context"

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

func main() {
	ctx := context.TODO()

	pool := qdb.PoolFromConf("http::addr=localhost:9000")
	defer func() {
		err := pool.Close(ctx)
		if err != nil {
			panic(err)
		}
	}()

	sender, err := pool.Acquire(ctx)
	if err != nil {
		panic(err)
	}

	sender.Table("prices").
		Symbol("ticker", "AAPL").
		Float64Column("price", 123.45).
		AtNow(ctx)

	if err := pool.Release(ctx, sender); err != nil {
		panic(err)
	}
}

Note that the pool only supports HTTP senders.