LinDB on GitHub
  1. Developer Guide
  2. Query data

Client

The Client Libraries provide user-friendly and high preformance SDKs for a growing number of languages.

Examples

Go client library docs and repo.

package main

import (
	"context"
	"fmt"

	lindb "github.com/lindb/client_go"
)

func main() {
	// create write client
	cli := lindb.NewClient("http://localhost:9000")
	query := cli.DataQuery()
	// LinQL ref: https://lindb.io/guide/lin-ql.html#metric-query
	data, err := query.DataQuery(context.TODO(),
		"_internal",
		"select heap_objects from lindb.runtime.mem where time>now()-2m and 'role' in ('Broker') group by node")
	if err != nil {
		fmt.Println(err)
		return
	}
	// print table
	_, table := data.ToTable()
	fmt.Println(table)
}

HTTP REST API

Lin Query language

Example request:

Terminal
curl -G http://localhost:9000/api/v1/exec?db=_internal --data-urlencode "sql=select heap_inuse from lindb.runtime.mem  where 'role' in ('Broker') group by node"

For more information about Lin query language.