influxql

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 3, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Tokens Specific to INFLUXDB
	TokenShortDesc lex.TokenType = 1000
	TokenLongDesc  lex.TokenType = 1001
	TokenKind      lex.TokenType = 1002
)
View Source
var InfluxQlDialect *lex.Dialect = &lex.Dialect{
	Statements: []*lex.Clause{
		{Token: lex.TokenSelect, Clauses: selectQl},
	},
}

Functions

func LexColumnsInflux

func LexColumnsInflux(l *lex.Lexer) lex.StateFn

Handle influx columns

SELECT
     valuect(item) AS stuff SHORTDESC "stuff" KIND INT

Examples:

(colx = y OR colb = b)
cola = 'a5'p
cola != "a5", colb = "a6"
REPLACE(cola,"stuff") != "hello"
FirstName = REPLACE(LOWER(name," "))
cola IN (1,2,3)
cola LIKE "abc"
eq(name,"bob") AND age > 5

func LexInfluxName

func LexInfluxName(l *lex.Lexer) lex.StateFn

lex value

SIMPLE_NAME_VALUE | TABLE_NAME_VALUE | REGEX_VALUE

Types

type Ast

type Ast struct {
	Comments string `json:",omitempty"` // Any comments
	Select   *SelectStmt
}

func Parse

func Parse(query string) (*Ast, error)

Parses string query

type Column

type Column struct {
	Name string
}

type From

type From struct {
	Value string
	Regex bool
}

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

parser evaluateslex.Tokens

type SelectStmt

type SelectStmt struct {
	Columns []*Column // identify inputs and outputs, e.g. "SELECT fname, count(*) FROM ..."
	From    *From     // metric can be regex
	GroupBy []string  // group by
	Alias   string    // Unique identifier of this query for start/stop/mgmt purposes

}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL