pressly/influxql

Name: influxql

Owner: Pressly Inc.

Description: InfluxDB Query Builder for Go clients

Created: 2016-03-11 17:53:39.0

Updated: 2018-05-17 05:48:18.0

Pushed: 2018-02-28 15:17:48.0

Homepage: null

Size: 12

Language: Go

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

InfluxQL

The influxql package is a query builder for InfluxQL, the SQL-like query language InfluxDB uses. The purpose of this package is to offer a better tool to build InfluxQL when writing complex queries. Sometimes string concatenation is just not the best approach.

This package is still a draft, see some examples below:

influxql.Select(inql.Distinct("foo")).From("bar")
rr = q.Build() // SELECT DISTINCT(foo) FROM bar

influxql.Select("foo").From("bar").Where("location", "Toronto").And("time >=", dateA).And("time <=", dateB).GroupBy(time.Minute*30).Fill("none")
ild() // SELECT foo FROM bar WHERE location = ? AND time >= ? AND time <= ?

influxql.Select("foo").From("bar").Where("location = ? AND time >= ? AND time <= ?", "Toronto", dateA, dateB).GroupBy(time.Minute*30).Fill(0)
ild() // SELECT foo FROM bar WHERE location = ? AND time >= ? AND time <= ?

 influxql.Select(inql.Distinct("level description")).From("h2o_feet").GroupBy("location")
ild() // SELECT DISTINCT("level description") FROM h2o_feet GROUP BY location

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.