parser

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2014 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ValueRegex        ValueType = C.VALUE_REGEX
	ValueInt                    = C.VALUE_INT
	ValueFloat                  = C.VALUE_FLOAT
	ValueString                 = C.VALUE_STRING
	ValueTableName              = C.VALUE_TABLE_NAME
	ValueSimpleName             = C.VALUE_SIMPLE_NAME
	ValueDuration               = C.VALUE_DURATION
	ValueWildcard               = C.VALUE_WILDCARD
	ValueFunctionCall           = C.VALUE_FUNCTION_CALL
	ValueExpression             = C.VALUE_EXPRESSION
)

Variables

View Source
var (
	ZERO_TIME = time.Unix(0, 0)
)

Functions

func GetStringArray

func GetStringArray(array *C.array) []string

Types

type BasicQuery added in v0.4.0

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

func (*BasicQuery) GetEndTime added in v0.4.0

func (self *BasicQuery) GetEndTime() time.Time

Returns the start time of the query. Queries can only have one condition of the form time > start_time

func (*BasicQuery) GetQueryString added in v0.4.0

func (self *BasicQuery) GetQueryString() string

func (*BasicQuery) GetStartTime added in v0.4.0

func (self *BasicQuery) GetStartTime() time.Time

Returns the start time of the query. Queries can only have one condition of the form time > start_time

type DeleteQuery added in v0.4.0

type DeleteQuery struct {
	SelectDeleteCommonQuery
}

type DropQuery added in v0.4.0

type DropQuery struct {
	Id int
}

type DropSeriesQuery added in v0.4.0

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

func (*DropSeriesQuery) GetTableName added in v0.4.0

func (self *DropSeriesQuery) GetTableName() string

type From

type From struct {
	TableName string
}

type FromClause added in v0.0.5

type FromClause struct {
	Type  FromClauseType
	Names []*TableName
}

func GetFromClause added in v0.0.5

func GetFromClause(fromClause *C.from_clause) (*FromClause, error)

type FromClauseType added in v0.0.5

type FromClauseType int
const (
	FromClauseArray     FromClauseType = C.FROM_ARRAY
	FromClauseMerge     FromClauseType = C.FROM_MERGE
	FromClauseInnerJoin FromClauseType = C.FROM_INNER_JOIN
)

type GroupByClause

type GroupByClause struct {
	FillWithZero bool
	FillValue    *Value
	Elems        []*Value
}

func GetGroupByClause added in v0.4.0

func GetGroupByClause(groupByClause *C.groupby_clause) (*GroupByClause, error)

func (GroupByClause) GetGroupByTime

func (self GroupByClause) GetGroupByTime() (*time.Duration, error)

type IntoClause added in v0.4.0

type IntoClause struct {
	Target *Value
}

func GetIntoClause added in v0.4.0

func GetIntoClause(intoClause *C.into_clause) (*IntoClause, error)

type ListQuery added in v0.4.0

type ListQuery struct {
	Type ListType
}

type ListType added in v0.4.0

type ListType int
const (
	Series ListType = iota
	ContinuousQueries
)

type Operation

type Operation int

type Query

type Query struct {
	SelectQuery     *SelectQuery
	DeleteQuery     *DeleteQuery
	ListQuery       *ListQuery
	DropSeriesQuery *DropSeriesQuery
	DropQuery       *DropQuery
}

func ParseQuery

func ParseQuery(query string) ([]*Query, error)

func (*Query) GetQueryString added in v0.0.9

func (self *Query) GetQueryString() string

func (*Query) IsListContinuousQueriesQuery added in v0.4.0

func (self *Query) IsListContinuousQueriesQuery() bool

func (*Query) IsListQuery added in v0.4.0

func (self *Query) IsListQuery() bool

func (*Query) IsListSeriesQuery added in v0.4.0

func (self *Query) IsListSeriesQuery() bool

type SelectDeleteCommonQuery added in v0.4.0

type SelectDeleteCommonQuery struct {
	BasicQuery
	FromClause *FromClause
	Condition  *WhereCondition
	// contains filtered or unexported fields
}

func (*SelectDeleteCommonQuery) GetFromClause added in v0.4.0

func (self *SelectDeleteCommonQuery) GetFromClause() *FromClause

func (*SelectDeleteCommonQuery) GetQueryStringForContinuousQuery added in v0.4.0

func (self *SelectDeleteCommonQuery) GetQueryStringForContinuousQuery(start, end time.Time) string

func (*SelectDeleteCommonQuery) GetQueryStringWithTimeCondition added in v0.4.0

func (self *SelectDeleteCommonQuery) GetQueryStringWithTimeCondition() string

func (*SelectDeleteCommonQuery) GetTableAliases added in v0.4.0

func (self *SelectDeleteCommonQuery) GetTableAliases(name string) []string

func (*SelectDeleteCommonQuery) GetWhereCondition added in v0.4.0

func (self *SelectDeleteCommonQuery) GetWhereCondition() *WhereCondition

func (*SelectDeleteCommonQuery) WillReturnSingleSeries added in v0.4.0

func (self *SelectDeleteCommonQuery) WillReturnSingleSeries() bool

type SelectQuery added in v0.4.0

type SelectQuery struct {
	SelectDeleteCommonQuery
	ColumnNames []*Value

	IntoClause *IntoClause
	Limit      int
	Ascending  bool
	// contains filtered or unexported fields
}

func ParseSelectQuery added in v0.4.0

func ParseSelectQuery(query string) (*SelectQuery, error)

This is just for backward compatability so we don't have to change all the code.

func (*SelectQuery) GetColumnNames added in v0.4.0

func (self *SelectQuery) GetColumnNames() []*Value

func (*SelectQuery) GetGroupByClause added in v0.4.0

func (self *SelectQuery) GetGroupByClause() *GroupByClause

func (*SelectQuery) GetIntoClause added in v0.4.0

func (self *SelectQuery) GetIntoClause() *IntoClause

func (*SelectQuery) GetReferencedColumns added in v0.4.0

func (self *SelectQuery) GetReferencedColumns() map[*Value][]string

Returns a mapping from the time series names (or regex) to the column names that are references

func (*SelectQuery) GetSinglePointQuerySequenceNumber added in v0.4.0

func (self *SelectQuery) GetSinglePointQuerySequenceNumber() (int64, error)

func (*SelectQuery) IsContinuousQuery added in v0.4.0

func (self *SelectQuery) IsContinuousQuery() bool

func (*SelectQuery) IsSinglePointQuery added in v0.4.0

func (self *SelectQuery) IsSinglePointQuery() bool

type TableName added in v0.3.0

type TableName struct {
	Name  *Value
	Alias string
}

func GetTableName added in v0.3.0

func GetTableName(name *C.table_name) (*TableName, error)

func GetTableNameArray added in v0.3.0

func GetTableNameArray(array *C.table_name_array) ([]*TableName, error)

func (*TableName) GetAlias added in v0.3.0

func (self *TableName) GetAlias() string

type Value

type Value struct {
	Name  string
	Type  ValueType
	Elems []*Value
	// contains filtered or unexported fields
}

func GetValue

func GetValue(value *C.value) (*Value, error)

func GetValueArray

func GetValueArray(array *C.value_array) ([]*Value, error)

func (*Value) GetCompiledRegex

func (self *Value) GetCompiledRegex() (*regexp.Regexp, bool)

func (*Value) IsFunctionCall

func (self *Value) IsFunctionCall() bool

type ValueType

type ValueType int

type WhereCondition

type WhereCondition struct {
	Left      interface{}
	Operation string
	Right     *WhereCondition
	// contains filtered or unexported fields
}

func GetWhereCondition

func GetWhereCondition(condition *C.condition) (*WhereCondition, error)

func (*WhereCondition) GetBoolExpression

func (self *WhereCondition) GetBoolExpression() (*Value, bool)

func (*WhereCondition) GetLeftWhereCondition

func (self *WhereCondition) GetLeftWhereCondition() (*WhereCondition, bool)

Jump to

Keyboard shortcuts

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