Skip to content

Instantly share code, notes, and snippets.

Avatar
🐷
Big O of nothing

Ofonime Francis ofonimefrancis

🐷
Big O of nothing
View GitHub Profile
View queryStruct
type Query struct {
Command string
Database string
RetentionPolicy string
Precision string
Chunked bool
ChunkSize int
Parameters map[string]interface{}
}
View retrieveOrders
func retrieveUserOrders(influxClient client.Client, userID string) {
query := client.Query{
Command: fmt.Sprintf("select * from orders where user_id = '%s'", userID),
Database: "tutorial",
}
resp, err := influxClient.Query(query)
if err != nil {
log.Fatalf("%v", err)
}
View go
package main
import (
"log"
"time"
client "github.com/influxdata/influxdb/client/v2"
)
const (
You can’t perform that action at this time.