Documentation ¶
Overview ¶
Package influxql implements a parser for the InfluxDB query language.
InfluxQL is a DML and DDL language for the InfluxDB time series database. It provides the ability to query for aggregate statistics as well as create and configure the InfluxDB server.
Selecting data ¶
The SELECT query is used for retrieving data from one or more series. It allows for a list of columns followed by a list of series to select from.
SELECT value FROM cpu_load
You can also add a a conditional expression to limit the results of the query:
SELECT value FROM cpu_load WHERE host = 'influxdb.com'
Two or more series can be combined into a single query and executed together:
SELECT cpu0.value + cpu1.value FROM cpu_load AS cpu0 INNER JOIN cpu_load cpu1 ON cpu0.host = cpu1.host
Limits and ordering can be set on selection queries as well:
SELECT value FROM cpu_load LIMIT 100 ORDER DESC;
Removing data ¶
The DELETE query is available to remove time series data points from the database. This query will delete "cpu_load" values older than an hour:
DELETE FROM cpu_load WHERE time < now() - 1h
Continuous Queries ¶
Queries can be run indefinitely on the server in order to generate new series. This is done by running a "SELECT INTO" query. For example, this query computes the hourly mean for cpu_load and stores it into a "cpu_load" series in the "daily" shard space.
SELECT mean(value) AS value FROM cpu_load GROUP BY 1h INTO daily.cpu_load
If there is existing data on the source series then this query will be run for all historic data. To only execute the query on new incoming data you can append "NO BACKFILL" to the end of the query:
SELECT mean(value) AS value FROM cpu_load GROUP BY 1h INTO daily.cpu_load NO BACKFILL
Continuous queries will return an id that can be used to remove them in the future. To remove a continous query, use the DROP CONTINUOUS QUERY statement:
DROP CONTINUOUS QUERY 12
You can also list all continuous queries by running:
LIST CONTINUOUS QUERIES
Index ¶
- Constants
- Variables
- func ContainsVarRef(expr Expr) bool
- func Eval(expr Expr, m map[string]interface{}) interface{}
- func EvalBool(expr Expr, m map[string]interface{}) bool
- func ExprNames(expr Expr) []string
- func FormatDuration(d time.Duration) string
- func HasTimeExpr(expr Expr) bool
- func IdentNeedsQuotes(ident string) bool
- func IsRegexOp(t Token) bool
- func IsSystemName(name string) bool
- func MatchSource(sources Sources, name string) string
- func OnlyTimeExpr(expr Expr) bool
- func ParseDuration(s string) (time.Duration, error)
- func QuoteIdent(segments ...string) string
- func QuoteString(s string) string
- func ScanBareIdent(r io.RuneScanner) string
- func ScanDelimited(r io.RuneScanner, start, end rune, escapes map[rune]rune, escapesPassThru bool) ([]byte, error)
- func ScanString(r io.RuneScanner) (string, error)
- func TimeRange(expr Expr) (min, max time.Time)
- func TimeRangeAsEpochNano(expr Expr) (min, max int64)
- func Walk(v Visitor, node Node)
- func WalkFunc(node Node, fn func(Node))
- type AlterRetentionPolicyStatement
- type AuxIterator
- type BinaryExpr
- type BooleanIterator
- type BooleanLiteral
- type BooleanPoint
- type Call
- type CreateContinuousQueryStatement
- type CreateDatabaseStatement
- type CreateRetentionPolicyStatement
- type CreateSubscriptionStatement
- type CreateUserStatement
- type DataType
- type DeleteStatement
- type Dimension
- type Dimensions
- type Distinct
- type DropContinuousQueryStatement
- type DropDatabaseStatement
- type DropMeasurementStatement
- type DropRetentionPolicyStatement
- type DropSeriesStatement
- type DropServerStatement
- type DropSubscriptionStatement
- type DropUserStatement
- type DurationLiteral
- type Emitter
- type ExecutionPrivilege
- type ExecutionPrivileges
- type Expr
- type Field
- type Fields
- type FillOption
- type FloatIterator
- type FloatPoint
- type GrantAdminStatement
- type GrantStatement
- type HasDefaultDatabase
- type IntegerIterator
- type IntegerPoint
- type Interval
- type Iterator
- func NewCallIterator(input Iterator, opt IteratorOptions) Iterator
- func NewDedupeIterator(input Iterator) Iterator
- func NewDistinctIterator(input Iterator, opt IteratorOptions) Iterator
- func NewFillIterator(input Iterator, expr Expr, opt IteratorOptions) Iterator
- func NewLimitIterator(input Iterator, opt IteratorOptions) Iterator
- func NewMergeIterator(inputs []Iterator, opt IteratorOptions) Iterator
- func NewSortedMergeIterator(inputs []Iterator, opt IteratorOptions) Iterator
- func Select(stmt *SelectStatement, ic IteratorCreator, sopt *SelectOptions) ([]Iterator, error)
- type IteratorCreator
- type IteratorOptions
- type Iterators
- type Literal
- type Measurement
- type Measurements
- type Node
- type NowValuer
- type NumberLiteral
- type ParenExpr
- type ParseError
- type Parser
- type Point
- type Points
- type Pos
- type Privilege
- type Processor
- type Query
- type RegexLiteral
- type Result
- type RevokeAdminStatement
- type RevokeStatement
- type Rewriter
- type Scanner
- type SelectOptions
- type SelectStatement
- func (s *SelectStatement) Clone() *SelectStatement
- func (s *SelectStatement) ColumnNames() []string
- func (s *SelectStatement) FunctionCalls() []*Call
- func (s *SelectStatement) FunctionCallsByPosition() [][]*Call
- func (s *SelectStatement) GroupByInterval() (time.Duration, error)
- func (s *SelectStatement) HasCountDistinct() bool
- func (s *SelectStatement) HasDerivative() bool
- func (s *SelectStatement) HasDimensionWildcard() bool
- func (s *SelectStatement) HasDistinct() bool
- func (s *SelectStatement) HasFieldWildcard() bool
- func (s *SelectStatement) HasSimpleCount() bool
- func (s *SelectStatement) HasTimeFieldSpecified() bool
- func (s *SelectStatement) HasWildcard() bool
- func (s *SelectStatement) IsSimpleDerivative() bool
- func (s *SelectStatement) NamesInDimension() []string
- func (s *SelectStatement) NamesInSelect() []string
- func (s *SelectStatement) NamesInWhere() []string
- func (s *SelectStatement) RequiredPrivileges() ExecutionPrivileges
- func (s *SelectStatement) RewriteDistinct()
- func (s *SelectStatement) RewriteTimeFields()
- func (s *SelectStatement) RewriteWildcards(ic IteratorCreator) (*SelectStatement, error)
- func (s *SelectStatement) SetTimeRange(start, end time.Time) error
- func (s *SelectStatement) String() string
- func (s *SelectStatement) Substatement(ref *VarRef) (*SelectStatement, error)
- func (s *SelectStatement) TimeAscending() bool
- type Series
- type SeriesList
- type SetPasswordUserStatement
- type ShowContinuousQueriesStatement
- type ShowDatabasesStatement
- type ShowDiagnosticsStatement
- type ShowFieldKeysStatement
- type ShowGrantsForUserStatement
- type ShowMeasurementsStatement
- type ShowRetentionPoliciesStatement
- type ShowSeriesStatement
- type ShowServersStatement
- type ShowShardGroupsStatement
- type ShowShardsStatement
- type ShowStatsStatement
- type ShowSubscriptionsStatement
- type ShowTagKeysStatement
- type ShowTagValuesStatement
- type ShowUsersStatement
- type SortField
- type SortFields
- type Source
- type Sources
- type Statement
- type Statements
- type StringIterator
- type StringLiteral
- type StringPoint
- type TagSet
- type Tags
- type Target
- type TimeLiteral
- type Token
- type Valuer
- type VarRef
- type Visitor
- type Wildcard
Constants ¶
const ( // Unknown primitive data type. Unknown DataType = 0 // Float means the data type is a float Float = 1 // Integer means the data type is a integer Integer = 2 // String means the data type is a string of text. String = 3 // Boolean means the data type is a boolean. Boolean = 4 // Time means the data type is a time. Time = 5 // Duration means the data type is a duration of time. Duration = 6 )
const ( // MinTime is used as the minimum time value when computing an unbounded range. MinTime = int64(0) // MaxTime is used as the maximum time value when computing an unbounded range. // This time is Jan 1, 2050 at midnight UTC. MaxTime = int64(2524608000000000000) )
const ( // DateFormat represents the format for date literals. DateFormat = "2006-01-02" // DateTimeFormat represents the format for date time literals. DateTimeFormat = "2006-01-02 15:04:05.999999" )
const ZeroTime = int64(-6795364578871345152)
ZeroTime is the Unix nanosecond timestamp for time.Time{}.
Variables ¶
var ErrInvalidDuration = errors.New("invalid duration")
ErrInvalidDuration is returned when parsing a malformatted duration.
var ErrUnknownCall = errors.New("unknown call")
ErrUnknownCall is returned when operating on an unknown function call.
Functions ¶
func ContainsVarRef ¶
ContainsVarRef returns true if expr is a VarRef or contains one.
func EvalBool ¶
EvalBool evaluates expr and returns true if result is a boolean true. Otherwise returns false.
func FormatDuration ¶
FormatDuration formats a duration to a string.
func HasTimeExpr ¶
HasTimeExpr returns true if the expression has a time term.
func IdentNeedsQuotes ¶
IdentNeedsQuotes returns true if the ident string given would require quotes.
func IsSystemName ¶
IsSystemName returns true if name is an internal system name. System names are prefixed with an underscore.
func MatchSource ¶
MatchSource returns the source name that matches a field name. Returns a blank string if no sources match.
func OnlyTimeExpr ¶
OnlyTimeExpr returns true if the expression only has time constraints.
func ParseDuration ¶
ParseDuration parses a time duration from a string.
func QuoteIdent ¶
QuoteIdent returns a quoted identifier from multiple bare identifiers.
func ScanBareIdent ¶
func ScanBareIdent(r io.RuneScanner) string
ScanBareIdent reads bare identifier from a rune reader.
func ScanDelimited ¶
func ScanString ¶
func ScanString(r io.RuneScanner) (string, error)
ScanString reads a quoted string from a rune reader.
func TimeRange ¶
TimeRange returns the minimum and maximum times specified by an expression. Returns zero times if there is no bound.
func TimeRangeAsEpochNano ¶
TimeRange returns the minimum and maximum times, as epoch nano, specified by and expression. If there is no lower bound, the start of the epoch is returned for minimum. If there is no higher bound, now is returned for maximum.
Types ¶
type AlterRetentionPolicyStatement ¶
type AlterRetentionPolicyStatement struct { // Name of policy to alter. Name string // Name of the database this policy belongs to. Database string // Duration data written to this policy will be retained. Duration *time.Duration // Replication factor for data written to this policy. Replication *int // Should this policy be set as defalut for the database? Default bool }
AlterRetentionPolicyStatement represents a command to alter an existing retention policy.
func (*AlterRetentionPolicyStatement) RequiredPrivileges ¶
func (s *AlterRetentionPolicyStatement) RequiredPrivileges() ExecutionPrivileges
RequiredPrivileges returns the privilege required to execute an AlterRetentionPolicyStatement.
func (*AlterRetentionPolicyStatement) String ¶
func (s *AlterRetentionPolicyStatement) String() string
String returns a string representation of the alter retention policy statement.
type AuxIterator ¶
type AuxIterator interface { Iterator IteratorCreator // Auxilary iterator Iterator(name string) Iterator // Start starts writing to the created iterators. Start() }
AuxIterator represents an iterator that can split off separate auxilary iterators.
func NewAuxIterator ¶
func NewAuxIterator(input Iterator, seriesKeys SeriesList, opt IteratorOptions) AuxIterator
NewAuxIterator returns a new instance of AuxIterator.
type BinaryExpr ¶
BinaryExpr represents an operation between two expressions.
func (*BinaryExpr) String ¶
func (e *BinaryExpr) String() string
String returns a string representation of the binary expression.
type BooleanIterator ¶
type BooleanIterator interface { Iterator Next() *BooleanPoint }
BooleanIterator represents a stream of boolean points.
type BooleanLiteral ¶
type BooleanLiteral struct {
Val bool
}
BooleanLiteral represents a boolean literal.
func (*BooleanLiteral) String ¶
func (l *BooleanLiteral) String() string
String returns a string representation of the literal.
type BooleanPoint ¶
BooleanPoint represents a point with a bool value.
func (*BooleanPoint) Clone ¶
func (v *BooleanPoint) Clone() *BooleanPoint
Clone returns a copy of v.
type Call ¶
Call represents a function call.
type CreateContinuousQueryStatement ¶
type CreateContinuousQueryStatement struct { // Name of the continuous query to be created. Name string // Name of the database to create the continuous query on. Database string // Source of data (SELECT statement). Source *SelectStatement // Interval to resample previous queries ResampleEvery time.Duration // Maximum duration to resample previous queries ResampleFor time.Duration }
CreateContinuousQueryStatement represents a command for creating a continuous query.
func (*CreateContinuousQueryStatement) DefaultDatabase ¶
func (s *CreateContinuousQueryStatement) DefaultDatabase() string
DefaultDatabase returns the default database from the statement.
func (*CreateContinuousQueryStatement) RequiredPrivileges ¶
func (s *CreateContinuousQueryStatement) RequiredPrivileges() ExecutionPrivileges
RequiredPrivileges returns the privilege required to execute a CreateContinuousQueryStatement.
func (*CreateContinuousQueryStatement) String ¶
func (s *CreateContinuousQueryStatement) String() string
String returns a string representation of the statement.
type CreateDatabaseStatement ¶
type CreateDatabaseStatement struct { // Name of the database to be created. Name string // IfNotExists indicates whether to return without error if the database // already exists. IfNotExists bool // RetentionPolicyCreate indicates whether the user explicitly wants to create a retention policy RetentionPolicyCreate bool // RetentionPolicyDuration indicates retention duration for the new database RetentionPolicyDuration time.Duration // RetentionPolicyReplication indicates retention replication for the new database RetentionPolicyReplication int // RetentionPolicyName indicates retention name for the new database RetentionPolicyName string }
CreateDatabaseStatement represents a command for creating a new database.
func (*CreateDatabaseStatement) RequiredPrivileges ¶
func (s *CreateDatabaseStatement) RequiredPrivileges() ExecutionPrivileges
RequiredPrivileges returns the privilege required to execute a CreateDatabaseStatement.
func (*CreateDatabaseStatement) String ¶
func (s *CreateDatabaseStatement) String() string
String returns a string representation of the create database statement.
type CreateRetentionPolicyStatement ¶
type CreateRetentionPolicyStatement struct { // Name of policy to create. Name string // Name of database this policy belongs to. Database string // Duration data written to this policy will be retained. Duration time.Duration // Replication factor for data written to this policy. Replication int // Should this policy be set as default for the database? Default bool }
CreateRetentionPolicyStatement represents a command to create a retention policy.
func (*CreateRetentionPolicyStatement) RequiredPrivileges ¶
func (s *CreateRetentionPolicyStatement) RequiredPrivileges() ExecutionPrivileges
RequiredPrivileges returns the privilege required to execute a CreateRetentionPolicyStatement.
func (*CreateRetentionPolicyStatement) String ¶
func (s *CreateRetentionPolicyStatement) String() string
String returns a string representation of the create retention policy.
type CreateSubscriptionStatement ¶
type CreateSubscriptionStatement struct { Name string Database string RetentionPolicy string Destinations []string Mode string }
CreateSubscriptionStatement represents a command to add a subscription to the incoming data stream
func (*CreateSubscriptionStatement) RequiredPrivileges ¶
func (s *CreateSubscriptionStatement) RequiredPrivileges() ExecutionPrivileges
RequiredPrivileges returns the privilege required to execute a CreateSubscriptionStatement
func (*CreateSubscriptionStatement) String ¶
func (s *CreateSubscriptionStatement) String() string
String returns a string representation of the CreateSubscriptionStatement.
type CreateUserStatement ¶
type CreateUserStatement struct { // Name of the user to be created. Name string // User's password. Password string // User's admin privilege. Admin bool }
CreateUserStatement represents a command for creating a new user.
func (*CreateUserStatement) RequiredPrivileges ¶
func (s *CreateUserStatement) RequiredPrivileges() ExecutionPrivileges
RequiredPrivileges returns the privilege(s) required to execute a CreateUserStatement.
func (*CreateUserStatement) String ¶
func (s *CreateUserStatement) String() string
String returns a string representation of the create user statement.
type DataType ¶
type DataType int
DataType represents the primitive data types available in InfluxQL.
func InspectDataType ¶
func InspectDataType(v interface{}) DataType
InspectDataType returns the data type of a given value.
func InspectDataTypes ¶
func InspectDataTypes(a []interface{}) []DataType
type DeleteStatement ¶
type DeleteStatement struct { // Data source that values are removed from. Source Source // An expression evaluated on data point. Condition Expr }
DeleteStatement represents a command for removing data from the database.
func (*DeleteStatement) RequiredPrivileges ¶
func (s *DeleteStatement) RequiredPrivileges() ExecutionPrivileges
RequiredPrivileges returns the privilege required to execute a DeleteStatement.
func (*DeleteStatement) String ¶
func (s *DeleteStatement) String() string
String returns a string representation of the delete statement.
type Dimension ¶
type Dimension struct {
Expr Expr
}
Dimension represents an expression that a select statement is grouped by.
type Dimensions ¶
type Dimensions []*Dimension
Dimensions represents a list of dimensions.
func (Dimensions) Normalize ¶
func (a Dimensions) Normalize() (time.Duration, []string)
Normalize returns the interval and tag dimensions separately. Returns 0 if no time interval is specified.
func (Dimensions) String ¶
func (a Dimensions) String() string
String returns a string representation of the dimensions.
type Distinct ¶
type Distinct struct { // Identifier following DISTINCT Val string }
Distinct represents a DISTINCT expression.
type DropContinuousQueryStatement ¶
DropContinuousQueryStatement represents a command for removing a continuous query.
func (*DropContinuousQueryStatement) RequiredPrivileges ¶
func (s *DropContinuousQueryStatement) RequiredPrivileges() ExecutionPrivileges
RequiredPrivileges returns the privilege(s) required to execute a DropContinuousQueryStatement
func (*DropContinuousQueryStatement) String ¶
func (s *DropContinuousQueryStatement) String() string
String returns a string representation of the statement.
type DropDatabaseStatement ¶
type DropDatabaseStatement struct { // Name of the database to be dropped. Name string // IfExists indicates whether to return without error if the database // does not exists. IfExists bool }
DropDatabaseStatement represents a command to drop a database.
func (*DropDatabaseStatement) RequiredPrivileges ¶
func (s *DropDatabaseStatement) RequiredPrivileges() ExecutionPrivileges
RequiredPrivileges returns the privilege required to execute a DropDatabaseStatement.
func (*DropDatabaseStatement) String ¶
func (s *DropDatabaseStatement) String() string
String returns a string representation of the drop database statement.
type DropMeasurementStatement ¶
type DropMeasurementStatement struct { // Name of the measurement to be dropped. Name string }
DropMeasurementStatement represents a command to drop a measurement.
func (*DropMeasurementStatement) RequiredPrivileges ¶
func (s *DropMeasurementStatement) RequiredPrivileges() ExecutionPrivileges
RequiredPrivileges returns the privilege(s) required to execute a DropMeasurementStatement
func (*DropMeasurementStatement) String ¶
func (s *DropMeasurementStatement) String() string
String returns a string representation of the drop measurement statement.
type DropRetentionPolicyStatement ¶
type DropRetentionPolicyStatement struct { // Name of the policy to drop. Name string // Name of the database to drop the policy from. Database string }
DropRetentionPolicyStatement represents a command to drop a retention policy from a database.
func (*DropRetentionPolicyStatement) RequiredPrivileges ¶
func (s *DropRetentionPolicyStatement) RequiredPrivileges() ExecutionPrivileges
RequiredPrivileges returns the privilege required to execute a DropRetentionPolicyStatement.
func (*DropRetentionPolicyStatement) String ¶
func (s *DropRetentionPolicyStatement) String() string
String returns a string representation of the drop retention policy statement.
type DropSeriesStatement ¶
type DropSeriesStatement struct { // Data source that fields are extracted from (optional) Sources Sources // An expression evaluated on data point (optional) Condition Expr }
DropSeriesStatement represents a command for removing a series from the database.
func (DropSeriesStatement) RequiredPrivileges ¶
func (s DropSeriesStatement) RequiredPrivileges() ExecutionPrivileges
RequiredPrivileges returns the privilege required to execute a DropSeriesStatement.
func (*DropSeriesStatement) String ¶
func (s *DropSeriesStatement) String() string
String returns a string representation of the drop series statement.
type DropServerStatement ¶
type DropServerStatement struct { // ID of the node to be dropped. NodeID uint64 // Meta indicates if the server being dropped is a meta or data node Meta bool }
DropServerStatement represents a command for removing a server from the cluster.
func (*DropServerStatement) RequiredPrivileges ¶
func (s *DropServerStatement) RequiredPrivileges() ExecutionPrivileges
RequiredPrivileges returns the privilege required to execute a DropServerStatement.
func (*DropServerStatement) String ¶
func (s *DropServerStatement) String() string
String returns a string representation of the drop series statement.
type DropSubscriptionStatement ¶
DropSubscriptionStatement represents a command to drop a subscription to the incoming data stream.
func (*DropSubscriptionStatement) RequiredPrivileges ¶
func (s *DropSubscriptionStatement) RequiredPrivileges() ExecutionPrivileges
RequiredPrivileges returns the privilege required to execute a DropSubscriptionStatement
func (*DropSubscriptionStatement) String ¶
func (s *DropSubscriptionStatement) String() string
String returns a string representation of the DropSubscriptionStatement.
type DropUserStatement ¶
type DropUserStatement struct { // Name of the user to drop. Name string }
DropUserStatement represents a command for dropping a user.
func (*DropUserStatement) RequiredPrivileges ¶
func (s *DropUserStatement) RequiredPrivileges() ExecutionPrivileges
RequiredPrivileges returns the privilege(s) required to execute a DropUserStatement.
func (*DropUserStatement) String ¶
func (s *DropUserStatement) String() string
String returns a string representation of the drop user statement.
type DurationLiteral ¶
DurationLiteral represents a duration literal.
func (*DurationLiteral) String ¶
func (l *DurationLiteral) String() string
String returns a string representation of the literal.
type Emitter ¶
type Emitter struct { // The columns to attach to each row. Columns []string // Removes the "time" column from output. // Used for meta queries where time does not apply. OmitTime bool // contains filtered or unexported fields }
Emitter groups values together by name,
func NewEmitter ¶
NewEmitter returns a new instance of Emitter that pulls from itrs.
type ExecutionPrivilege ¶
type ExecutionPrivilege struct { // Admin privilege required. Admin bool // Name of the database. Name string // Database privilege required. Privilege Privilege }
ExecutionPrivilege is a privilege required for a user to execute a statement on a database or resource.
type ExecutionPrivileges ¶
type ExecutionPrivileges []ExecutionPrivilege
ExecutionPrivileges is a list of privileges required to execute a statement.
type Expr ¶
type Expr interface { Node // contains filtered or unexported methods }
Expr represents an expression that can be evaluated to a value.
func MustParseExpr ¶
MustParseExpr parses an expression string and returns its AST. Panic on error.
type Field ¶
Field represents an expression retrieved from a select statement.
type Fields ¶
type Fields []*Field
Fields represents a list of fields.
func (Fields) AliasNames ¶
AliasNames returns a list of calculated field names in order of alias, function name, then field.
type FillOption ¶
type FillOption int
const ( // NullFill means that empty aggregate windows will just have null values. NullFill FillOption = iota // NoFill means that empty aggregate windows will be purged from the result. NoFill // NumberFill means that empty aggregate windows will be filled with the given number NumberFill // PreviousFill means that empty aggregate windows will be filled with whatever the previous aggregate window had PreviousFill )
type FloatIterator ¶
type FloatIterator interface { Iterator Next() *FloatPoint }
FloatIterator represents a stream of float points.
type FloatPoint ¶
type FloatPoint struct { Name string Tags Tags Time int64 Nil bool Value float64 Aux []interface{} }
FloatPoint represents a point with a float64 value.
type GrantAdminStatement ¶
type GrantAdminStatement struct { // Who to grant the privilege to. User string }
GrantAdminStatement represents a command for granting admin privilege.
func (*GrantAdminStatement) RequiredPrivileges ¶
func (s *GrantAdminStatement) RequiredPrivileges() ExecutionPrivileges
RequiredPrivileges returns the privilege required to execute a GrantAdminStatement.
func (*GrantAdminStatement) String ¶
func (s *GrantAdminStatement) String() string
String returns a string representation of the grant admin statement.
type GrantStatement ¶
type GrantStatement struct { // The privilege to be granted. Privilege Privilege // Database to grant the privilege to. On string // Who to grant the privilege to. User string }
GrantStatement represents a command for granting a privilege.
func (*GrantStatement) RequiredPrivileges ¶
func (s *GrantStatement) RequiredPrivileges() ExecutionPrivileges
RequiredPrivileges returns the privilege required to execute a GrantStatement.
func (*GrantStatement) String ¶
func (s *GrantStatement) String() string
String returns a string representation of the grant statement.
type HasDefaultDatabase ¶
type HasDefaultDatabase interface { Node DefaultDatabase() string // contains filtered or unexported methods }
HasDefaultDatabase provides an interface to get the default database from a Statement.
type IntegerIterator ¶
type IntegerIterator interface { Iterator Next() *IntegerPoint }
IntegerIterator represents a stream of integer points.
type IntegerPoint ¶
type IntegerPoint struct { Name string Tags Tags Time int64 Nil bool Value int64 Aux []interface{} }
IntegerPoint represents a point with a int64 value.
func (*IntegerPoint) Clone ¶
func (v *IntegerPoint) Clone() *IntegerPoint
Clone returns a copy of v.
type Iterator ¶
type Iterator interface {
Close() error
}
Iterator represents a generic interface for all Iterators. Most iterator operations are done on the typed sub-interfaces.
func NewCallIterator ¶
func NewCallIterator(input Iterator, opt IteratorOptions) Iterator
NewCallIterator returns a new iterator for a Call.
func NewDedupeIterator ¶
NewDedupeIterator returns an iterator that only outputs unique points. This iterator maintains a serialized copy of each row so it is inefficient to use on large datasets. It is intended for small datasets such as meta queries.
func NewDistinctIterator ¶
func NewDistinctIterator(input Iterator, opt IteratorOptions) Iterator
NewDistinctIterator returns an iterator for operating on a distinct() call.
func NewFillIterator ¶
func NewFillIterator(input Iterator, expr Expr, opt IteratorOptions) Iterator
NewFillIterator returns an iterator that fills in missing points in an aggregate.
func NewLimitIterator ¶
func NewLimitIterator(input Iterator, opt IteratorOptions) Iterator
NewLimitIterator returns an iterator that limits the number of points per grouping.
func NewMergeIterator ¶
func NewMergeIterator(inputs []Iterator, opt IteratorOptions) Iterator
NewMergeIterator returns an iterator to merge itrs into one. Inputs must either be merge iterators or only contain a single name/tag in sorted order. The iterator will output all points by window, name/tag, then time. This iterator is useful when you need all of the points for an interval.
func NewSortedMergeIterator ¶
func NewSortedMergeIterator(inputs []Iterator, opt IteratorOptions) Iterator
NewSortedMergeIterator returns an iterator to merge itrs into one. Inputs must either be sorted merge iterators or only contain a single name/tag in sorted order. The iterator will output all points by name/tag, then time. This iterator is useful when you need all points for a name/tag to be in order.
func Select ¶
func Select(stmt *SelectStatement, ic IteratorCreator, sopt *SelectOptions) ([]Iterator, error)
Select executes stmt against ic and returns a list of iterators to stream from.
Statements should have all rewriting performed before calling select(). This includes wildcard and source expansion.
type IteratorCreator ¶
type IteratorCreator interface { // Creates a simple iterator for use in an InfluxQL query. CreateIterator(opt IteratorOptions) (Iterator, error) // Returns the unique fields and dimensions across a list of sources. FieldDimensions(sources Sources) (fields, dimensions map[string]struct{}, err error) // Returns the series keys that will be returned by this iterator. SeriesKeys(opt IteratorOptions) (SeriesList, error) }
IteratorCreator represents an interface for objects that can create Iterators.
type IteratorOptions ¶
type IteratorOptions struct { // Expression to iterate for. // This can be VarRef or a Call. Expr Expr // Auxilary tags or values to also retrieve for the point. Aux []string // Data sources from which to retrieve data. Sources []Source // Group by interval and tags. Interval Interval Dimensions []string // Fill options. Fill FillOption FillValue interface{} // Condition to filter by. Condition Expr // Time range for the iterator. StartTime int64 EndTime int64 // Sorted in time ascending order if true. Ascending bool // Limits the number of points per series. Limit, Offset int // Limits the number of series. SLimit, SOffset int // Removes duplicate rows from raw queries. Dedupe bool }
IteratorOptions is an object passed to CreateIterator to specify creation options.
func (IteratorOptions) DerivativeInterval ¶
func (opt IteratorOptions) DerivativeInterval() Interval
DerivativeInterval returns the time interval for the derivative function.
func (IteratorOptions) MergeSorted ¶
func (opt IteratorOptions) MergeSorted() bool
MergeSorted returns true if the options require a sorted merge. This is only needed when the expression is a variable reference or there is no expr.
func (IteratorOptions) SeekTime ¶
func (opt IteratorOptions) SeekTime() int64
SeekTime returns the time the iterator should start from. For ascending iterators this is the start time, for descending iterators it's the end time.
func (IteratorOptions) Window ¶
func (opt IteratorOptions) Window(t int64) (start, end int64)
Window returns the time window [start,end) that t falls within.
type Literal ¶
type Literal interface { Expr // contains filtered or unexported methods }
Literal represents a static literal.
type Measurement ¶
type Measurement struct { Database string RetentionPolicy string Name string Regex *RegexLiteral IsTarget bool }
Measurement represents a single measurement used as a datasource.
func (*Measurement) String ¶
func (m *Measurement) String() string
String returns a string representation of the measurement.
type Measurements ¶
type Measurements []*Measurement
Measurements represents a list of measurements.
func (Measurements) String ¶
func (a Measurements) String() string
String returns a string representation of the measurements.
type Node ¶
type Node interface { String() string // contains filtered or unexported methods }
Node represents a node in the InfluxDB abstract syntax tree.
type NumberLiteral ¶
type NumberLiteral struct {
Val float64
}
NumberLiteral represents a numeric literal.
func (*NumberLiteral) String ¶
func (l *NumberLiteral) String() string
String returns a string representation of the literal.
type ParenExpr ¶
type ParenExpr struct {
Expr Expr
}
ParenExpr represents a parenthesized expression.
type ParseError ¶
ParseError represents an error that occurred during parsing.
func (*ParseError) Error ¶
func (e *ParseError) Error() string
Error returns the string representation of the error.
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser represents an InfluxQL parser.
func (*Parser) ParseQuery ¶
ParseQuery parses an InfluxQL string and returns a Query AST object.
func (*Parser) ParseStatement ¶
ParseStatement parses an InfluxQL string and returns a Statement AST object.
type Point ¶
type Point interface {
// contains filtered or unexported methods
}
Point represents a value in a series that occurred at a given time.
type Pos ¶
Pos specifies the line and character position of a token. The Char and Line are both zero-based indexes.
type Privilege ¶
type Privilege int
Privilege is a type of action a user can be granted the right to use.
const ( // NoPrivileges means no privileges required / granted / revoked. NoPrivileges Privilege = iota // ReadPrivilege means read privilege required / granted / revoked. ReadPrivilege // WritePrivilege means write privilege required / granted / revoked. WritePrivilege // AllPrivileges means all privileges required / granted / revoked. AllPrivileges )
func NewPrivilege ¶
NewPrivilege returns an initialized *Privilege.
type Query ¶
type Query struct {
Statements Statements
}
Query represents a collection of ordered statements.
func ParseQuery ¶
ParseQuery parses a query string and returns its AST representation.
type RegexLiteral ¶
RegexLiteral represents a regular expression.
func CloneRegexLiteral ¶
func CloneRegexLiteral(r *RegexLiteral) *RegexLiteral
CloneRegexLiteral returns a clone of the RegexLiteral.
func (*RegexLiteral) String ¶
func (r *RegexLiteral) String() string
String returns a string representation of the literal.
type Result ¶
type Result struct { // StatementID is just the statement's position in the query. It's used // to combine statement results if they're being buffered in memory. StatementID int `json:"-"` Series models.Rows Err error }
Rows represents a list of rows that can be sorted consistently by name/tag. Result represents a resultset returned from a single statement.
func (*Result) MarshalJSON ¶
MarshalJSON encodes the result into JSON.
func (*Result) UnmarshalJSON ¶
UnmarshalJSON decodes the data into the Result struct
type RevokeAdminStatement ¶
type RevokeAdminStatement struct { // Who to revoke admin privilege from. User string }
RevokeAdminStatement represents a command to revoke admin privilege from a user.
func (*RevokeAdminStatement) RequiredPrivileges ¶
func (s *RevokeAdminStatement) RequiredPrivileges() ExecutionPrivileges
RequiredPrivileges returns the privilege required to execute a RevokeAdminStatement.
func (*RevokeAdminStatement) String ¶
func (s *RevokeAdminStatement) String() string
String returns a string representation of the revoke admin statement.
type RevokeStatement ¶
type RevokeStatement struct { // The privilege to be revoked. Privilege Privilege // Database to revoke the privilege from. On string // Who to revoke privilege from. User string }
RevokeStatement represents a command to revoke a privilege from a user.
func (*RevokeStatement) RequiredPrivileges ¶
func (s *RevokeStatement) RequiredPrivileges() ExecutionPrivileges
RequiredPrivileges returns the privilege required to execute a RevokeStatement.
func (*RevokeStatement) String ¶
func (s *RevokeStatement) String() string
String returns a string representation of the revoke statement.
type Rewriter ¶
Rewriter can be called by Rewrite to replace nodes in the AST hierarchy. The Rewrite() function is called once per node.
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner represents a lexical scanner for InfluxQL.
func NewScanner ¶
NewScanner returns a new instance of Scanner.
type SelectOptions ¶
type SelectOptions struct { // The lower bound for a select call. MinTime time.Time // The upper bound for a select call. MaxTime time.Time }
SelectOptions are options that customize the select call.
type SelectStatement ¶
type SelectStatement struct { // Expressions returned from the selection. Fields Fields // Target (destination) for the result of the select. Target *Target // Expressions used for grouping the selection. Dimensions Dimensions // Data sources that fields are extracted from. Sources Sources // An expression evaluated on data point. Condition Expr // Fields to sort results by SortFields SortFields // Maximum number of rows to be returned. Unlimited if zero. Limit int // Returns rows starting at an offset from the first row. Offset int // Maxiumum number of series to be returned. Unlimited if zero. SLimit int // Returns series starting at an offset from the first one. SOffset int // if it's a query for raw data values (i.e. not an aggregate) IsRawQuery bool // What fill option the select statement uses, if any Fill FillOption // The value to fill empty aggregate buckets with, if any FillValue interface{} // Removes the "time" column from the output. OmitTime bool // Removes duplicate rows from raw queries. Dedupe bool // contains filtered or unexported fields }
SelectStatement represents a command for extracting data from the database.
func (*SelectStatement) Clone ¶
func (s *SelectStatement) Clone() *SelectStatement
Clone returns a deep copy of the statement.
func (*SelectStatement) ColumnNames ¶
func (s *SelectStatement) ColumnNames() []string
ColumnNames will walk all fields and functions and return the appropriate field names for the select statement while maintaining order of the field names
func (*SelectStatement) FunctionCalls ¶
func (s *SelectStatement) FunctionCalls() []*Call
FunctionCalls returns the Call objects from the query
func (*SelectStatement) FunctionCallsByPosition ¶
func (s *SelectStatement) FunctionCallsByPosition() [][]*Call
FunctionCallsByPosition returns the Call objects from the query in the order they appear in the select statement
func (*SelectStatement) GroupByInterval ¶
func (s *SelectStatement) GroupByInterval() (time.Duration, error)
GroupByIterval extracts the time interval, if specified.
func (*SelectStatement) HasCountDistinct ¶
func (s *SelectStatement) HasCountDistinct() bool
func (*SelectStatement) HasDerivative ¶
func (s *SelectStatement) HasDerivative() bool
HasDerivative returns true if one of the function calls in the statement is a derivative aggregate
func (*SelectStatement) HasDimensionWildcard ¶
func (s *SelectStatement) HasDimensionWildcard() bool
HasDimensionWildcard returns whether or not the select statement has at least 1 wildcard in the dimensions aka `GROUP BY`
func (*SelectStatement) HasDistinct ¶
func (s *SelectStatement) HasDistinct() bool
func (*SelectStatement) HasFieldWildcard ¶
func (s *SelectStatement) HasFieldWildcard() bool
HasFieldWildcard returns whether or not the select statement has at least 1 wildcard in the fields
func (*SelectStatement) HasSimpleCount ¶
func (s *SelectStatement) HasSimpleCount() bool
HasSimpleCount return true if one of the function calls is a count function with a variable ref as the first arg
func (*SelectStatement) HasTimeFieldSpecified ¶
func (s *SelectStatement) HasTimeFieldSpecified() bool
HasTimeFieldSpecified will walk all fields and determine if the user explicitly asked for time This is needed to determine re-write behaviors for functions like TOP and BOTTOM
func (*SelectStatement) HasWildcard ¶
func (s *SelectStatement) HasWildcard() bool
HasWildcard returns whether or not the select statement has at least 1 wildcard
func (*SelectStatement) IsSimpleDerivative ¶
func (s *SelectStatement) IsSimpleDerivative() bool
IsSimpleDerivative return true if one of the function call is a derivative function with a variable ref as the first arg
func (*SelectStatement) NamesInDimension ¶
func (s *SelectStatement) NamesInDimension() []string
NamesInDimension returns the field and tag names (idents) in the group by
func (*SelectStatement) NamesInSelect ¶
func (s *SelectStatement) NamesInSelect() []string
NamesInSelect returns the field and tag names (idents) in the select clause
func (*SelectStatement) NamesInWhere ¶
func (s *SelectStatement) NamesInWhere() []string
NamesInWhere returns the field and tag names (idents) referenced in the where clause
func (*SelectStatement) RequiredPrivileges ¶
func (s *SelectStatement) RequiredPrivileges() ExecutionPrivileges
RequiredPrivileges returns the privilege required to execute the SelectStatement.
func (*SelectStatement) RewriteDistinct ¶
func (s *SelectStatement) RewriteDistinct()
RewriteDistinct rewrites the expression to be a call for map/reduce to work correctly This method assumes all validation has passed
func (*SelectStatement) RewriteTimeFields ¶
func (s *SelectStatement) RewriteTimeFields()
RewriteTimeFields removes any "time" field references.
func (*SelectStatement) RewriteWildcards ¶
func (s *SelectStatement) RewriteWildcards(ic IteratorCreator) (*SelectStatement, error)
RewriteWildcards returns the re-written form of the select statement. Any wildcard query fields are replaced with the supplied fields, and any wildcard GROUP BY fields are replaced with the supplied dimensions.
func (*SelectStatement) SetTimeRange ¶
func (s *SelectStatement) SetTimeRange(start, end time.Time) error
SetTimeRange sets the start and end time of the select statement to [start, end). i.e. start inclusive, end exclusive. This is used commonly for continuous queries so the start and end are in buckets.
func (*SelectStatement) String ¶
func (s *SelectStatement) String() string
String returns a string representation of the select statement.
func (*SelectStatement) Substatement ¶
func (s *SelectStatement) Substatement(ref *VarRef) (*SelectStatement, error)
Substatement returns a single-series statement for a given variable reference.
func (*SelectStatement) TimeAscending ¶
func (s *SelectStatement) TimeAscending() bool
TimeAscending returns true if the time field is sorted in chronological order.
type Series ¶
Series represents a series that will be returned by the iterator.
type SeriesList ¶
type SeriesList []Series
SeriesList is a list of series that will be returned by an iterator.
func (SeriesList) Len ¶
func (a SeriesList) Len() int
func (SeriesList) Less ¶
func (a SeriesList) Less(i, j int) bool
func (SeriesList) Swap ¶
func (a SeriesList) Swap(i, j int)
type SetPasswordUserStatement ¶
type SetPasswordUserStatement struct { // Plain Password Password string // Who to grant the privilege to. Name string }
SetPasswordUserStatement represents a command for changing user password.
func (*SetPasswordUserStatement) RequiredPrivileges ¶
func (s *SetPasswordUserStatement) RequiredPrivileges() ExecutionPrivileges
RequiredPrivileges returns the privilege required to execute a SetPasswordUserStatement.
func (*SetPasswordUserStatement) String ¶
func (s *SetPasswordUserStatement) String() string
String returns a string representation of the set password statement.
type ShowContinuousQueriesStatement ¶
type ShowContinuousQueriesStatement struct{}
ShowContinuousQueriesStatement represents a command for listing continuous queries.
func (*ShowContinuousQueriesStatement) RequiredPrivileges ¶
func (s *ShowContinuousQueriesStatement) RequiredPrivileges() ExecutionPrivileges
RequiredPrivileges returns the privilege required to execute a ShowContinuousQueriesStatement.
func (*ShowContinuousQueriesStatement) String ¶
func (s *ShowContinuousQueriesStatement) String() string
String returns a string representation of the list continuous queries statement.
type ShowDatabasesStatement ¶
type ShowDatabasesStatement struct{}
ShowDatabasesStatement represents a command for listing all databases in the cluster.
func (*ShowDatabasesStatement) RequiredPrivileges ¶
func (s *ShowDatabasesStatement) RequiredPrivileges() ExecutionPrivileges
RequiredPrivileges returns the privilege required to execute a ShowDatabasesStatement
func (*ShowDatabasesStatement) String ¶
func (s *ShowDatabasesStatement) String() string
String returns a string representation of the list databases command.
type ShowDiagnosticsStatement ¶
type ShowDiagnosticsStatement struct { // Module Module string }
ShowDiagnosticsStatement represents a command for show node diagnostics.
func (*ShowDiagnosticsStatement) RequiredPrivileges ¶
func (s *ShowDiagnosticsStatement) RequiredPrivileges() ExecutionPrivileges
RequiredPrivileges returns the privilege required to execute a ShowDiagnosticsStatement
func (*ShowDiagnosticsStatement) String ¶
func (s *ShowDiagnosticsStatement) String() string
String returns a string representation of the ShowDiagnosticsStatement.
type ShowFieldKeysStatement ¶
type ShowFieldKeysStatement struct { // Data sources that fields are extracted from. Sources Sources // Fields to sort results by SortFields SortFields // Maximum number of rows to be returned. // Unlimited if zero. Limit int // Returns rows starting at an offset from the first row. Offset int }
ShowFieldKeysStatement represents a command for listing field keys.
func (*ShowFieldKeysStatement) RequiredPrivileges ¶
func (s *ShowFieldKeysStatement) RequiredPrivileges() ExecutionPrivileges
RequiredPrivileges returns the privilege(s) required to execute a ShowFieldKeysStatement
func (*ShowFieldKeysStatement) String ¶
func (s *ShowFieldKeysStatement) String() string
String returns a string representation of the statement.
type ShowGrantsForUserStatement ¶
type ShowGrantsForUserStatement struct { // Name of the user to display privileges. Name string }
ShowGrantsForUserStatement represents a command for listing user privileges.
func (*ShowGrantsForUserStatement) RequiredPrivileges ¶
func (s *ShowGrantsForUserStatement) RequiredPrivileges() ExecutionPrivileges
RequiredPrivileges returns the privilege required to execute a ShowGrantsForUserStatement
func (*ShowGrantsForUserStatement) String ¶
func (s *ShowGrantsForUserStatement) String() string
String returns a string representation of the show grants for user.
type ShowMeasurementsStatement ¶
type ShowMeasurementsStatement struct { // Measurement name or regex. Source Source // An expression evaluated on data point. Condition Expr // Fields to sort results by SortFields SortFields // Maximum number of rows to be returned. // Unlimited if zero. Limit int // Returns rows starting at an offset from the first row. Offset int }
ShowMeasurementsStatement represents a command for listing measurements.
func (*ShowMeasurementsStatement) RequiredPrivileges ¶
func (s *ShowMeasurementsStatement) RequiredPrivileges() ExecutionPrivileges
RequiredPrivileges returns the privilege(s) required to execute a ShowMeasurementsStatement
func (*ShowMeasurementsStatement) String ¶
func (s *ShowMeasurementsStatement) String() string
String returns a string representation of the statement.
type ShowRetentionPoliciesStatement ¶
type ShowRetentionPoliciesStatement struct { // Name of the database to list policies for. Database string }
ShowRetentionPoliciesStatement represents a command for listing retention policies.
func (*ShowRetentionPoliciesStatement) RequiredPrivileges ¶
func (s *ShowRetentionPoliciesStatement) RequiredPrivileges() ExecutionPrivileges
RequiredPrivileges returns the privilege(s) required to execute a ShowRetentionPoliciesStatement
func (*ShowRetentionPoliciesStatement) String ¶
func (s *ShowRetentionPoliciesStatement) String() string
String returns a string representation of a ShowRetentionPoliciesStatement.
type ShowSeriesStatement ¶
type ShowSeriesStatement struct { // Measurement(s) the series are listed for. Sources Sources // An expression evaluated on a series name or tag. Condition Expr // Fields to sort results by SortFields SortFields // Maximum number of rows to be returned. // Unlimited if zero. Limit int // Returns rows starting at an offset from the first row. Offset int }
ShowSeriesStatement represents a command for listing series in the database.
func (*ShowSeriesStatement) RequiredPrivileges ¶
func (s *ShowSeriesStatement) RequiredPrivileges() ExecutionPrivileges
RequiredPrivileges returns the privilege required to execute a ShowSeriesStatement.
func (*ShowSeriesStatement) String ¶
func (s *ShowSeriesStatement) String() string
String returns a string representation of the list series statement.
type ShowServersStatement ¶
type ShowServersStatement struct{}
ShowServersStatement represents a command for listing all servers.
func (*ShowServersStatement) RequiredPrivileges ¶
func (s *ShowServersStatement) RequiredPrivileges() ExecutionPrivileges
RequiredPrivileges returns the privilege required to execute a ShowServersStatement
func (*ShowServersStatement) String ¶
func (s *ShowServersStatement) String() string
String returns a string representation of the show servers command.
type ShowShardGroupsStatement ¶
type ShowShardGroupsStatement struct{}
ShowShardGroupsStatement represents a command for displaying shard groups in the cluster.
func (*ShowShardGroupsStatement) RequiredPrivileges ¶
func (s *ShowShardGroupsStatement) RequiredPrivileges() ExecutionPrivileges
RequiredPrivileges returns the privileges required to execute the statement.
func (*ShowShardGroupsStatement) String ¶
func (s *ShowShardGroupsStatement) String() string
String returns a string representation of the SHOW SHARD GROUPS command.
type ShowShardsStatement ¶
type ShowShardsStatement struct{}
ShowShardsStatement represents a command for displaying shards in the cluster.
func (*ShowShardsStatement) RequiredPrivileges ¶
func (s *ShowShardsStatement) RequiredPrivileges() ExecutionPrivileges
RequiredPrivileges returns the privileges required to execute the statement.
func (*ShowShardsStatement) String ¶
func (s *ShowShardsStatement) String() string
String returns a string representation.
type ShowStatsStatement ¶
type ShowStatsStatement struct { // Module Module string }
ShowStats statement displays statistics for a given module.
func (*ShowStatsStatement) RequiredPrivileges ¶
func (s *ShowStatsStatement) RequiredPrivileges() ExecutionPrivileges
RequiredPrivileges returns the privilege(s) required to execute a ShowStatsStatement
func (*ShowStatsStatement) String ¶
func (s *ShowStatsStatement) String() string
String returns a string representation of a ShowStatsStatement.
type ShowSubscriptionsStatement ¶
type ShowSubscriptionsStatement struct { }
ShowSubscriptionsStatement represents a command to show a list of subscriptions.
func (*ShowSubscriptionsStatement) RequiredPrivileges ¶
func (s *ShowSubscriptionsStatement) RequiredPrivileges() ExecutionPrivileges
RequiredPrivileges returns the privilege required to execute a ShowSubscriptionStatement
func (*ShowSubscriptionsStatement) String ¶
func (s *ShowSubscriptionsStatement) String() string
String returns a string representation of the ShowSubscriptionStatement.
type ShowTagKeysStatement ¶
type ShowTagKeysStatement struct { // Data sources that fields are extracted from. Sources Sources // An expression evaluated on data point. Condition Expr // Fields to sort results by SortFields SortFields // Maximum number of tag keys per measurement. Unlimited if zero. Limit int // Returns tag keys starting at an offset from the first row. Offset int // Maxiumum number of series to be returned. Unlimited if zero. SLimit int // Returns series starting at an offset from the first one. SOffset int }
ShowTagKeysStatement represents a command for listing tag keys.
func (*ShowTagKeysStatement) RequiredPrivileges ¶
func (s *ShowTagKeysStatement) RequiredPrivileges() ExecutionPrivileges
RequiredPrivileges returns the privilege(s) required to execute a ShowTagKeysStatement
func (*ShowTagKeysStatement) String ¶
func (s *ShowTagKeysStatement) String() string
String returns a string representation of the statement.
type ShowTagValuesStatement ¶
type ShowTagValuesStatement struct { // Data source that fields are extracted from. Sources Sources // Tag key(s) to pull values from. TagKeys []string // An expression evaluated on data point. Condition Expr // Fields to sort results by SortFields SortFields // Maximum number of rows to be returned. // Unlimited if zero. Limit int // Returns rows starting at an offset from the first row. Offset int }
ShowTagValuesStatement represents a command for listing tag values.
func (*ShowTagValuesStatement) RequiredPrivileges ¶
func (s *ShowTagValuesStatement) RequiredPrivileges() ExecutionPrivileges
RequiredPrivileges returns the privilege(s) required to execute a ShowTagValuesStatement
func (*ShowTagValuesStatement) String ¶
func (s *ShowTagValuesStatement) String() string
String returns a string representation of the statement.
type ShowUsersStatement ¶
type ShowUsersStatement struct{}
ShowUsersStatement represents a command for listing users.
func (*ShowUsersStatement) RequiredPrivileges ¶
func (s *ShowUsersStatement) RequiredPrivileges() ExecutionPrivileges
RequiredPrivileges returns the privilege(s) required to execute a ShowUsersStatement
func (*ShowUsersStatement) String ¶
func (s *ShowUsersStatement) String() string
String returns a string representation of the ShowUsersStatement.
type SortFields ¶
type SortFields []*SortField
SortFields represents an ordered list of ORDER BY fields
func (SortFields) String ¶
func (a SortFields) String() string
String returns a string representation of sort fields
type Source ¶
type Source interface { Node // contains filtered or unexported methods }
Source represents a source of data for a statement.
type Sources ¶
type Sources []Source
Sources represents a list of sources.
func (Sources) HasSystemSource ¶
HasSystemSource returns true if any of the sources are internal, system sources.
type Statement ¶
type Statement interface { Node RequiredPrivileges() ExecutionPrivileges // contains filtered or unexported methods }
Statement represents a single command in InfluxQL.
func MustParseStatement ¶
MustParseStatement parses a statement string and returns its AST. Panic on error.
func ParseStatement ¶
ParseStatement parses a statement string and returns its AST representation.
type Statements ¶
type Statements []Statement
Statements represents a list of statements.
func (Statements) String ¶
func (a Statements) String() string
String returns a string representation of the statements.
type StringIterator ¶
type StringIterator interface { Iterator Next() *StringPoint }
StringIterator represents a stream of string points.
type StringLiteral ¶
type StringLiteral struct {
Val string
}
StringLiteral represents a string literal.
func (*StringLiteral) String ¶
func (l *StringLiteral) String() string
String returns a string representation of the literal.
type StringPoint ¶
type StringPoint struct { Name string Tags Tags Time int64 Nil bool Value string Aux []interface{} }
StringPoint represents a point with a string value.
type TagSet ¶
TagSet is a fundamental concept within the query system. It represents a composite series, composed of multiple individual series that share a set of tag attributes.
func LimitTagSets ¶
LimitTagSets returns a tag set list with SLIMIT and SOFFSET applied.
type Tags ¶
type Tags struct {
// contains filtered or unexported fields
}
Tags represent a map of keys and values. It memoizes its key so it can be used efficiently during query execution.
type Target ¶
type Target struct { // Measurement to write into. Measurement *Measurement }
Target represents a target (destination) policy, measurement, and DB.
type TimeLiteral ¶
TimeLiteral represents a point-in-time literal.
func (*TimeLiteral) String ¶
func (l *TimeLiteral) String() string
String returns a string representation of the literal.
type Token ¶
type Token int
Token is a lexical token of the InfluxQL language.
const ( // Special tokens ILLEGAL Token = iota EOF WS // Literals IDENT // main NUMBER // 12345.67 DURATION_VAL // 13h STRING // "abc" BADSTRING // "abc BADESCAPE // \q TRUE // true FALSE // false REGEX // Regular expressions BADREGEX // `.* // Operators ADD // + SUB // - MUL // * DIV // / AND // AND OR // OR EQ // = NEQ // != EQREGEX // =~ NEQREGEX // !~ LT // < LTE // <= GT // > GTE // >= LPAREN // ( RPAREN // ) COMMA // , COLON // : SEMICOLON // ; DOT // . // Keywords ALL ALTER ANY AS ASC BEGIN BY CREATE CONTINUOUS DATA DATABASE DATABASES DEFAULT DELETE DESC DESTINATIONS DIAGNOSTICS DISTINCT DROP DURATION END EVERY EXISTS EXPLAIN FIELD FOR FORCE FROM GRANT GRANTS GROUP GROUPS IF IN INF INNER INSERT INTO KEY KEYS LIMIT META MEASUREMENT MEASUREMENTS NAME NOT OFFSET ON ORDER PASSWORD POLICY POLICIES PRIVILEGES QUERIES QUERY READ REPLICATION RESAMPLE RETENTION REVOKE SELECT SERIES SERVER SERVERS SET SHOW SHARD SHARDS SLIMIT SOFFSET STATS SUBSCRIPTION SUBSCRIPTIONS TAG TO USER USERS VALUES WHERE WITH WRITE )
func (Token) Precedence ¶
Precedence returns the operator precedence of the binary operator token.
type Valuer ¶
Valuer is the interface that wraps the Value() method.
Value returns the value and existence flag for a given key.