parser

package
v0.8.0-rc.4 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2014 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ValueRegex        ValueType = C.VALUE_REGEX
	ValueInt                    = C.VALUE_INT
	ValueBool                   = C.VALUE_BOOLEAN
	ValueFloat                  = C.VALUE_FLOAT
	ValueString                 = C.VALUE_STRING
	ValueIntoName               = C.VALUE_INTO_NAME
	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

This section is empty.

Functions

func GetStringArray

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

Types

type BasicQuery

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

func (*BasicQuery) GetEndTime

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) GetStartTime

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

type DeleteQuery struct {
	SelectDeleteCommonQuery
}

func (*DeleteQuery) GetQueryString

func (self *DeleteQuery) GetQueryString(withTime bool) string

type DropQuery

type DropQuery struct {
	Id int
}

type DropSeriesQuery

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

func (*DropSeriesQuery) GetTableName

func (self *DropSeriesQuery) GetTableName() string

type From

type From struct {
	TableName string
}

type FromClause

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

func GetFromClause

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

func (*FromClause) GetString

func (self *FromClause) GetString() string

type FromClauseType

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

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

func (GroupByClause) GetGroupByTime

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

func (*GroupByClause) GetString

func (self *GroupByClause) GetString() string

type IntoClause

type IntoClause struct {
	Target        *Value
	Backfill      bool
	BackfillValue *Value
}

func GetIntoClause

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

func (*IntoClause) GetString

func (self *IntoClause) GetString() string

type ListQuery

type ListQuery struct {
	Type ListType
}

type ListType

type ListType int
const (
	Series ListType = iota
	ContinuousQueries
)

type Operation

type Operation int

type Query

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

func ParseQuery

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

func (*Query) GetQueryString

func (self *Query) GetQueryString() string

func (*Query) GetQueryStringWithTimeCondition

func (self *Query) GetQueryStringWithTimeCondition() string

func (*Query) IsExplainQuery

func (self *Query) IsExplainQuery() bool

func (*Query) IsListContinuousQueriesQuery

func (self *Query) IsListContinuousQueriesQuery() bool

func (*Query) IsListQuery

func (self *Query) IsListQuery() bool

func (*Query) IsListSeriesQuery

func (self *Query) IsListSeriesQuery() bool

type QueryError

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

func (*QueryError) Error

func (self *QueryError) Error() string

func (*QueryError) PrettyPrint

func (self *QueryError) PrettyPrint() string

type QuerySpec

type QuerySpec struct {
	RunAgainstAllServersInShard bool
	// contains filtered or unexported fields
}

func NewQuerySpec

func NewQuerySpec(user common.User, database string, query *Query) *QuerySpec

func (*QuerySpec) AllShardsQuery

func (self *QuerySpec) AllShardsQuery() bool

func (*QuerySpec) Database

func (self *QuerySpec) Database() string

func (*QuerySpec) DeleteQuery

func (self *QuerySpec) DeleteQuery() *DeleteQuery

func (*QuerySpec) GetEndTime

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

func (*QuerySpec) GetFromClause

func (self *QuerySpec) GetFromClause() *FromClause

func (*QuerySpec) GetGroupByColumnCount

func (self *QuerySpec) GetGroupByColumnCount() int

func (*QuerySpec) GetGroupByInterval

func (self *QuerySpec) GetGroupByInterval() *time.Duration

func (*QuerySpec) GetQueryString

func (self *QuerySpec) GetQueryString() string

func (*QuerySpec) GetQueryStringWithTimeCondition

func (self *QuerySpec) GetQueryStringWithTimeCondition() string

func (*QuerySpec) GetStartTime

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

func (*QuerySpec) HasAggregates

func (self *QuerySpec) HasAggregates() bool

func (*QuerySpec) HasReadAccess

func (self *QuerySpec) HasReadAccess(name string) bool

func (*QuerySpec) IsAscending

func (self *QuerySpec) IsAscending() bool

func (*QuerySpec) IsDeleteFromSeriesQuery

func (self *QuerySpec) IsDeleteFromSeriesQuery() bool

func (*QuerySpec) IsDestructiveQuery

func (self *QuerySpec) IsDestructiveQuery() bool

func (*QuerySpec) IsDropSeriesQuery

func (self *QuerySpec) IsDropSeriesQuery() bool

func (*QuerySpec) IsExplainQuery

func (self *QuerySpec) IsExplainQuery() bool

func (*QuerySpec) IsListSeriesQuery

func (self *QuerySpec) IsListSeriesQuery() bool

func (*QuerySpec) IsRegex

func (self *QuerySpec) IsRegex() bool

func (*QuerySpec) IsSinglePointQuery

func (self *QuerySpec) IsSinglePointQuery() bool

func (*QuerySpec) Query

func (self *QuerySpec) Query() *Query

func (*QuerySpec) ReadsFromMultipleSeries

func (self *QuerySpec) ReadsFromMultipleSeries() bool

func (*QuerySpec) SelectQuery

func (self *QuerySpec) SelectQuery() *SelectQuery

func (*QuerySpec) SeriesValuesAndColumns

func (self *QuerySpec) SeriesValuesAndColumns() map[*Value][]string

func (*QuerySpec) TableNames

func (self *QuerySpec) TableNames() []string

func (*QuerySpec) TableNamesAndRegex

func (self *QuerySpec) TableNamesAndRegex() ([]string, *regexp.Regexp)

func (*QuerySpec) User

func (self *QuerySpec) User() common.User

type SelectDeleteCommonQuery

type SelectDeleteCommonQuery struct {
	BasicQuery
	FromClause *FromClause
	Condition  *WhereCondition
}

func (*SelectDeleteCommonQuery) GetFromClause

func (self *SelectDeleteCommonQuery) GetFromClause() *FromClause

func (*SelectDeleteCommonQuery) GetTableAliases

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

func (*SelectDeleteCommonQuery) GetWhereCondition

func (self *SelectDeleteCommonQuery) GetWhereCondition() *WhereCondition

func (*SelectDeleteCommonQuery) GetWhereConditionWithTime

func (self *SelectDeleteCommonQuery) GetWhereConditionWithTime(startTime, endTime time.Time) *WhereCondition

func (*SelectDeleteCommonQuery) WillReturnSingleSeries

func (self *SelectDeleteCommonQuery) WillReturnSingleSeries() bool

type SelectQuery

type SelectQuery struct {
	SelectDeleteCommonQuery
	ColumnNames []*Value

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

func ParseSelectQuery

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

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

func (*SelectQuery) GetGroupByClause

func (self *SelectQuery) GetGroupByClause() *GroupByClause

func (*SelectQuery) GetIntoClause

func (self *SelectQuery) GetIntoClause() *IntoClause

func (*SelectQuery) GetQueryString

func (self *SelectQuery) GetQueryString() string

func (*SelectQuery) GetQueryStringWithTimeCondition

func (self *SelectQuery) GetQueryStringWithTimeCondition() string

func (*SelectQuery) GetQueryStringWithTimes

func (self *SelectQuery) GetQueryStringWithTimes(startTime, endTime time.Time) string

func (*SelectQuery) GetQueryStringWithTimesAndNoIntoClause

func (self *SelectQuery) GetQueryStringWithTimesAndNoIntoClause(startTime, endTime time.Time) string

func (*SelectQuery) GetReferencedColumns

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) GetResultColumns

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

func (*SelectQuery) GetSinglePointQuerySequenceNumber

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

func (*SelectQuery) HasAggregates

func (self *SelectQuery) HasAggregates() bool

Returns true if the query has aggregate functions applied to the columns

func (*SelectQuery) IsContinuousQuery

func (self *SelectQuery) IsContinuousQuery() bool

func (*SelectQuery) IsExplainQuery

func (self *SelectQuery) IsExplainQuery() bool

func (*SelectQuery) IsNonRecursiveContinuousQuery

func (self *SelectQuery) IsNonRecursiveContinuousQuery() bool

func (*SelectQuery) IsSinglePointQuery

func (self *SelectQuery) IsSinglePointQuery() bool

func (*SelectQuery) IsValidContinuousQuery

func (self *SelectQuery) IsValidContinuousQuery() bool

type TableName

type TableName struct {
	Name  *Value
	Alias string
}

func GetTableName

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

func GetTableNameArray

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

func (*TableName) GetAlias

func (self *TableName) GetAlias() string

func (*TableName) GetAliasString

func (self *TableName) GetAliasString() string

type Value

type Value struct {
	Name  string
	Alias string
	Type  ValueType
	Elems []*Value

	IsInsensitive bool
	// 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) GetString

func (self *Value) GetString() string

func (*Value) IsFunctionCall

func (self *Value) IsFunctionCall() bool

type ValueType

type ValueType int

type Values

type Values []*Value

func (Values) GetString

func (self Values) GetString() string

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)

func (*WhereCondition) GetString

func (self *WhereCondition) GetString() string

Jump to

Keyboard shortcuts

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