Skip to content

questdb/go-questdb-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoDoc reference

go-questdb-client

Golang client for QuestDB's Influx Line Protocol (ILP) over HTTP and TCP. This library makes it easy to insert data into QuestDB.

Features:

  • Context-aware API.
  • Optimized for batch writes.
  • Supports TLS encryption and ILP authentication.
  • Automatic write retries and connection reuse for ILP over HTTP.
  • Tested against QuestDB 7.3.11 and newer versions.

New in v3:

  • Supports ILP over HTTP using the same client semantics

Documentation is available here.

Quickstart

package main import ( "context" "fmt" "log" "time"	qdb "github.com/questdb/go-questdb-client/v3" ) func main() { ctx := context.TODO() // Connect to QuestDB running locally. sender, err := qdb.LineSenderFromConf(ctx, "http::addr=localhost:9000;") if err != nil { log.Fatal(err)	} // Make sure to close the sender on exit to release resources. defer sender.Close() // Send a few ILP messages. err = sender. Table("trades"). Symbol("name", "test_ilp1"). Float64Column("value", 12.4). AtNow(ctx) if err != nil { log.Fatal(err)	} err = sender. Table("trades"). Symbol("name", "test_ilp2"). Float64Column("value", 11.4). At(ctx, time.Now().UnixNano()) if err != nil { log.Fatal(err)	} // Make sure that the messages are sent over the network. err = sender.Flush(ctx) if err != nil { log.Fatal(err)	} }

To connect via TCP, set the configuration string to:

// ... sender, err := qdb.LineSenderFromConf(ctx, "tcp::addr=localhost:9009;") // ...

Community

If you need help, have additional questions or want to provide feedback, you may find us on Slack. You can also sign up to our mailing list to get notified of new releases.

About

Golang client for QuestDB's Influx Line Protocol

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 9

Languages