influxqb

package module
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

README

Influxqb - A simple Query builder for InfluxDB 1.x

Intro

Building strongly typed and secure InfluxQL queries from string is not always an easy task You have to take care of the sanitization, keep the distinction between function, identifier, numbers and string literals to build a valid query.

The influxQL parser contains all the required types to manually build a query from scratch. More importantly it also contains String() method on each type and statement. The parser then take care of escaping character, putting quotes or not, ...

This go package is built on top of the influxql parser and offers a more simple way to create queries.

Use

go get github.com/willena/influxqb

Todo

  • Add custom object for some statements
  • Add tests for "SHOW" queries
  • Cleanup files, Reorganize files
  • Throw errors if query does not met requirement when building
  • Add all known aggragation functions

Things that are working

  • select_stmt
  • alter_retention_policy_stmt
  • create_continuous_query_stmt
  • create_retention_policy_stmt
  • create_database_stmt
  • create_subscription_stmt
  • create_user_stmt
  • delete_stmt
  • drop_continuous_query_stmt
  • drop_database_stmt
  • drop_measurement_stmt
  • drop_retention_policy_stmt
  • drop_series_stmt
  • drop_shard_stmt
  • drop_subscription_stmt
  • drop_user_stmt
  • explain_stmt
  • explain_analyze_stmt
  • grant_stmt
  • revoke_stmt
  • kill_query_statement

Not tested

  • show_continuous_queries_stmt
  • show_databases_stmt
  • show_diagnostics_stmt
  • show_field_key_cardinality_stmt
  • show_field_keys_stmt
  • show_grants_stmt
  • show_measurement_cardinality_stmt
  • show_measurement_exact_cardinality_stmt
  • show_queries_stmt
  • show_measurements_stmt
  • show_retention_policies_stmt
  • show_series_stmt
  • show_shard_groups_stmt
  • show_stats_stmt
  • show_subscriptions_stmt
  • show_tag_values_stmt
  • show_series_cardinality_stmt
  • show_series_exact_cardinality_stmt
  • show_tag_key_cardinality_stmt
  • show_tag_key_exact_cardinality_stmt
  • show_shards_stmt
  • show_tag_keys_stmt
  • show_users_stmt
  • show_tag_values_cardinality_stmt

Example

package main 

import (
	"fmt"
	"github.com/influxdata/influxql"
	"github.com/willena/influxqb"
	"time"
)

func main() {

	builder := influxqb.NewSelectBuilder()
	builder.Select(influxqb.NewFunction("MEAN").WithArgs("colomn", time.Now(), 45.36, time.Hour),
		influxqb.NewField("MyField"),
	)
	builder.From("XTC_OLD'sk")
	builder.GroupBy(
		influxqb.NewField("GroupByField"),
		influxqb.NewTimeSampling(time.Hour),
	)
	builder.Fill(45)
	builder.Limit(250)
	builder.Offset(15)
	builder.SeriesLimit(2)
	builder.SeriesOffset(8)
	builder.Where(
		influxqb.And(
			influxqb.Eq(influxqb.Field{Name: "Tptp"}, "data"),
			influxqb.Eq("ooo", 16.55)),
		)

	fmt.Println(builder.Build())
}

Licence

   InfluxQb Go package
   Copyright 2022 Guillaume VILLENA aka "Willena"
   
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at
   
      http://www.apache.org/licenses/LICENSE-2.0
   
   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(LH interface{}, RH interface{}) *influxql.BinaryExpr

func And

func And(LH interface{}, RH interface{}) *influxql.BinaryExpr

func Divide

func Divide(LH interface{}, RH interface{}) *influxql.BinaryExpr

func Eq

func Eq(LH interface{}, RH interface{}) *influxql.BinaryExpr

func GreaterThan

func GreaterThan(LH interface{}, RH interface{}) *influxql.BinaryExpr

func GreaterThanEq

func GreaterThanEq(LH interface{}, RH interface{}) *influxql.BinaryExpr

func LessThan

func LessThan(LH interface{}, RH interface{}) *influxql.BinaryExpr

func LessThanEq

func LessThanEq(LH interface{}, RH interface{}) *influxql.BinaryExpr

func Modulus

func Modulus(LH interface{}, RH interface{}) *influxql.BinaryExpr

func Multiply

func Multiply(LH interface{}, RH interface{}) *influxql.BinaryExpr

func NotEq

func NotEq(LH interface{}, RH interface{}) *influxql.BinaryExpr

func Or

func Or(LH interface{}, RH interface{}) *influxql.BinaryExpr

func Subtract

func Subtract(LH interface{}, RH interface{}) *influxql.BinaryExpr

Types

type AlterRetentionPolicyBuilder

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

func NewAlterRetentionPolicyBuilder

func NewAlterRetentionPolicyBuilder() *AlterRetentionPolicyBuilder

func (*AlterRetentionPolicyBuilder) Build

func (*AlterRetentionPolicyBuilder) SetAsDefault

func (*AlterRetentionPolicyBuilder) WithDatabase

func (*AlterRetentionPolicyBuilder) WithDuration

func (*AlterRetentionPolicyBuilder) WithDurationString

func (b *AlterRetentionPolicyBuilder) WithDurationString(durationStr string) *AlterRetentionPolicyBuilder

func (*AlterRetentionPolicyBuilder) WithFutureLimit added in v1.0.4

func (b *AlterRetentionPolicyBuilder) WithFutureLimit(futureLimit *time.Duration) *AlterRetentionPolicyBuilder

func (*AlterRetentionPolicyBuilder) WithFutureLimitString added in v1.0.4

func (b *AlterRetentionPolicyBuilder) WithFutureLimitString(futureLimit string) *AlterRetentionPolicyBuilder

func (*AlterRetentionPolicyBuilder) WithPastLimit added in v1.0.4

func (*AlterRetentionPolicyBuilder) WithPastLimitString added in v1.0.4

func (b *AlterRetentionPolicyBuilder) WithPastLimitString(pastLimitStr string) *AlterRetentionPolicyBuilder

func (*AlterRetentionPolicyBuilder) WithPolicyName

func (b *AlterRetentionPolicyBuilder) WithPolicyName(policyName string) *AlterRetentionPolicyBuilder

func (*AlterRetentionPolicyBuilder) WithReplicationFactor

func (b *AlterRetentionPolicyBuilder) WithReplicationFactor(replication int) *AlterRetentionPolicyBuilder

func (*AlterRetentionPolicyBuilder) WithShardDuration

func (b *AlterRetentionPolicyBuilder) WithShardDuration(duration *time.Duration) *AlterRetentionPolicyBuilder

func (*AlterRetentionPolicyBuilder) WithShardDurationString

func (b *AlterRetentionPolicyBuilder) WithShardDurationString(durationStr string) *AlterRetentionPolicyBuilder

type BuilderIf

type BuilderIf interface {
	Build() (string, error)
}

type CreateContinuousQueryBuilder

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

func NewCreateContinuousQueryBuilder

func NewCreateContinuousQueryBuilder() *CreateContinuousQueryBuilder

func (*CreateContinuousQueryBuilder) Build

func (*CreateContinuousQueryBuilder) SelectBuilder

func (b *CreateContinuousQueryBuilder) SelectBuilder() *SelectBuilder

func (*CreateContinuousQueryBuilder) WithDatabase

func (*CreateContinuousQueryBuilder) WithName

func (*CreateContinuousQueryBuilder) WithResamplingInterval

func (b *CreateContinuousQueryBuilder) WithResamplingInterval(interval time.Duration) *CreateContinuousQueryBuilder

func (*CreateContinuousQueryBuilder) WithResamplingIntervalFromString

func (b *CreateContinuousQueryBuilder) WithResamplingIntervalFromString(str string) *CreateContinuousQueryBuilder

func (*CreateContinuousQueryBuilder) WithSelectBuilder

func (*CreateContinuousQueryBuilder) WithTimeout

func (*CreateContinuousQueryBuilder) WithTimeoutString

type CreateDatabaseBuilder

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

func NewCreateDatabaseBuilder

func NewCreateDatabaseBuilder() *CreateDatabaseBuilder

func (*CreateDatabaseBuilder) Build

func (b *CreateDatabaseBuilder) Build() (string, error)

func (*CreateDatabaseBuilder) WithName

func (*CreateDatabaseBuilder) WithRetentionPolicy

func (b *CreateDatabaseBuilder) WithRetentionPolicy(retentionPolicy *CreateRetentionPolicyBuilder) *CreateDatabaseBuilder

type CreateRetentionPolicyBuilder

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

func NewCreateRetentionPolicyBuilder

func NewCreateRetentionPolicyBuilder() *CreateRetentionPolicyBuilder

func (*CreateRetentionPolicyBuilder) Build

func (*CreateRetentionPolicyBuilder) SetAsDefault

func (*CreateRetentionPolicyBuilder) WithDatabase

func (*CreateRetentionPolicyBuilder) WithDuration

func (*CreateRetentionPolicyBuilder) WithDurationString

func (b *CreateRetentionPolicyBuilder) WithDurationString(durationStr string) *CreateRetentionPolicyBuilder

func (*CreateRetentionPolicyBuilder) WithFutureLimit added in v1.0.4

func (*CreateRetentionPolicyBuilder) WithFutureLimitString added in v1.0.4

func (b *CreateRetentionPolicyBuilder) WithFutureLimitString(futureLimit string) *CreateRetentionPolicyBuilder

func (*CreateRetentionPolicyBuilder) WithPastLimit added in v1.0.4

func (*CreateRetentionPolicyBuilder) WithPastLimitString added in v1.0.4

func (b *CreateRetentionPolicyBuilder) WithPastLimitString(pastLimitStr string) *CreateRetentionPolicyBuilder

func (*CreateRetentionPolicyBuilder) WithPolicyName

func (b *CreateRetentionPolicyBuilder) WithPolicyName(policyName string) *CreateRetentionPolicyBuilder

func (*CreateRetentionPolicyBuilder) WithReplicationFactor

func (b *CreateRetentionPolicyBuilder) WithReplicationFactor(replication int) *CreateRetentionPolicyBuilder

func (*CreateRetentionPolicyBuilder) WithShardDuration

func (*CreateRetentionPolicyBuilder) WithShardDurationString

func (b *CreateRetentionPolicyBuilder) WithShardDurationString(durationStr string) *CreateRetentionPolicyBuilder

type CreateSubscriptionBuilder

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

func NewCreateSubscriptionBuilder

func NewCreateSubscriptionBuilder() *CreateSubscriptionBuilder

func (*CreateSubscriptionBuilder) Build

func (b *CreateSubscriptionBuilder) Build() (string, error)

func (*CreateSubscriptionBuilder) WithDatabase

func (*CreateSubscriptionBuilder) WithDestination

func (*CreateSubscriptionBuilder) WithDestinations

func (b *CreateSubscriptionBuilder) WithDestinations(str ...string) *CreateSubscriptionBuilder

func (*CreateSubscriptionBuilder) WithMode

func (*CreateSubscriptionBuilder) WithName

func (*CreateSubscriptionBuilder) WithRetentionPolicy

func (b *CreateSubscriptionBuilder) WithRetentionPolicy(str string) *CreateSubscriptionBuilder

type CreateUserBuilder

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

func NewCreateUserBuilder

func NewCreateUserBuilder() *CreateUserBuilder

func (*CreateUserBuilder) Admin

func (*CreateUserBuilder) Build

func (b *CreateUserBuilder) Build() (string, error)

func (*CreateUserBuilder) WithPassword

func (b *CreateUserBuilder) WithPassword(str string) *CreateUserBuilder

func (*CreateUserBuilder) WithUsername

func (b *CreateUserBuilder) WithUsername(str string) *CreateUserBuilder

type DeleteBuilder

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

func NewDeleteBuilder

func NewDeleteBuilder() *DeleteBuilder

func (*DeleteBuilder) Build

func (b *DeleteBuilder) Build() (string, error)

func (*DeleteBuilder) From

func (b *DeleteBuilder) From(source string) *DeleteBuilder

func (*DeleteBuilder) Where

func (b *DeleteBuilder) Where(condition interface{}) *DeleteBuilder

type DropContinuousQueryBuilder

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

func NewDropContinuousQuery

func NewDropContinuousQuery() *DropContinuousQueryBuilder

func (*DropContinuousQueryBuilder) Build

func (b *DropContinuousQueryBuilder) Build() (string, error)

func (*DropContinuousQueryBuilder) WithDatabase

func (*DropContinuousQueryBuilder) WithName

type DropDatabaseBuilder

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

func NewDropDatabase

func NewDropDatabase() *DropDatabaseBuilder

func (*DropDatabaseBuilder) Build

func (b *DropDatabaseBuilder) Build() (string, error)

func (*DropDatabaseBuilder) WithDatabase

func (b *DropDatabaseBuilder) WithDatabase(database string) *DropDatabaseBuilder

type DropMeasurementBuilder

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

func NewDropMeasurement

func NewDropMeasurement() *DropMeasurementBuilder

func (*DropMeasurementBuilder) Build

func (b *DropMeasurementBuilder) Build() (string, error)

func (*DropMeasurementBuilder) WithMeasurement

func (b *DropMeasurementBuilder) WithMeasurement(Measurement string) *DropMeasurementBuilder

type DropRetentionPolicyBuilder

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

func NewDropRetentionPolicy

func NewDropRetentionPolicy() *DropRetentionPolicyBuilder

func (*DropRetentionPolicyBuilder) Build

func (b *DropRetentionPolicyBuilder) Build() (string, error)

func (*DropRetentionPolicyBuilder) WithDatabase

func (*DropRetentionPolicyBuilder) WithRetentionPolicy

func (b *DropRetentionPolicyBuilder) WithRetentionPolicy(RetentionPolicy string) *DropRetentionPolicyBuilder

type DropSeriesBuilder

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

func NewDropSeries

func NewDropSeries() *DropSeriesBuilder

func (*DropSeriesBuilder) Build

func (b *DropSeriesBuilder) Build() (string, error)

func (*DropSeriesBuilder) From

func (b *DropSeriesBuilder) From(sources ...*Measurement) *DropSeriesBuilder

func (*DropSeriesBuilder) Where

func (b *DropSeriesBuilder) Where(condition interface{}) *DropSeriesBuilder

type DropShardBuilder

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

func NewDropShard

func NewDropShard() *DropShardBuilder

func (*DropShardBuilder) Build

func (b *DropShardBuilder) Build() (string, error)

func (*DropShardBuilder) WithShard

func (b *DropShardBuilder) WithShard(id uint64) *DropShardBuilder

type DropSubscriptionBuilder

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

func NewDropSubscription

func NewDropSubscription() *DropSubscriptionBuilder

func (*DropSubscriptionBuilder) Build

func (b *DropSubscriptionBuilder) Build() (string, error)

func (*DropSubscriptionBuilder) WithDatabase

func (*DropSubscriptionBuilder) WithName

func (*DropSubscriptionBuilder) WithRetentionPolicy

func (b *DropSubscriptionBuilder) WithRetentionPolicy(policy string) *DropSubscriptionBuilder

type DropUserBuilder

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

func NewDropUser

func NewDropUser() *DropUserBuilder

func (*DropUserBuilder) Build

func (b *DropUserBuilder) Build() (string, error)

func (*DropUserBuilder) WithUsername

func (b *DropUserBuilder) WithUsername(username string) *DropUserBuilder

type ExplainBuilder

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

func NewExplainBuilder

func NewExplainBuilder() *ExplainBuilder

func (*ExplainBuilder) Analyze

func (b *ExplainBuilder) Analyze() *ExplainBuilder

func (*ExplainBuilder) Build

func (b *ExplainBuilder) Build() (string, error)

func (*ExplainBuilder) SelectBuilder

func (b *ExplainBuilder) SelectBuilder() *SelectBuilder

func (*ExplainBuilder) WithSelectBuilder

func (b *ExplainBuilder) WithSelectBuilder(builder *SelectBuilder) *ExplainBuilder

type Field

type Field struct {
	Name  string
	Alias string
	Type  influxql.DataType
}

func NewField

func NewField(name string) *Field

func (*Field) WithAlias

func (f *Field) WithAlias(str string) *Field

func (*Field) WithName

func (f *Field) WithName(str string) *Field

func (*Field) WithType

func (f *Field) WithType(inType influxql.DataType) *Field

type FieldIf

type FieldIf interface {
	// contains filtered or unexported methods
}

type FillLinear

type FillLinear struct{}

type FillNoFill

type FillNoFill struct{}

type FillNull

type FillNull struct{}

type FillNumber

type FillNumber struct {
	Value float64
}

type FillOption

type FillOption interface {
	// contains filtered or unexported methods
}

func FillFromStr

func FillFromStr(str string) FillOption

type FillPrevious

type FillPrevious struct{}

type Function

type Function struct {
	Name  string
	Args  []interface{}
	Alias string
}

func NewFunction

func NewFunction(functionName string) *Function

func (*Function) WithAlias

func (f *Function) WithAlias(alias string) *Function

func (*Function) WithArg

func (f *Function) WithArg(arg interface{}) *Function

func (*Function) WithArgs

func (f *Function) WithArgs(args ...interface{}) *Function

type GrantBuilder

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

func NewGrantBuilder

func NewGrantBuilder() *GrantBuilder

func (*GrantBuilder) Admin

func (b *GrantBuilder) Admin() *GrantBuilder

func (*GrantBuilder) Build

func (b *GrantBuilder) Build() (string, error)

func (*GrantBuilder) WithDatabase

func (b *GrantBuilder) WithDatabase(database string) *GrantBuilder

func (*GrantBuilder) WithPrivilege

func (b *GrantBuilder) WithPrivilege(privilege influxql.Privilege) *GrantBuilder

func (*GrantBuilder) WithUsername

func (b *GrantBuilder) WithUsername(username string) *GrantBuilder

type GroupByIf

type GroupByIf interface {
	// contains filtered or unexported methods
}

type KillQueryBuilder

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

func NewKillQueryBuilder

func NewKillQueryBuilder() *KillQueryBuilder

func (*KillQueryBuilder) Build

func (b *KillQueryBuilder) Build() (string, error)

func (*KillQueryBuilder) OnHost

func (b *KillQueryBuilder) OnHost(str string) *KillQueryBuilder

func (*KillQueryBuilder) WithQueryId

func (b *KillQueryBuilder) WithQueryId(id uint64) *KillQueryBuilder

type Math

type Math struct {
	Expr  []interface{}
	Alias string
}

func NewMath

func NewMath() *Math

func (*Math) WithAlias

func (m *Math) WithAlias(alias string) *Math

func (*Math) WithExpr

func (m *Math) WithExpr(elements ...interface{}) *Math

type MathExpr

type MathExpr struct {
	Expr  string
	Alias string
}

func NewMathExpr

func NewMathExpr(expr string) *MathExpr

func (*MathExpr) WithAlias

func (m *MathExpr) WithAlias(alias string) *MathExpr

type MathExprIf

type MathExprIf interface {
	// contains filtered or unexported methods
}

type Measurement

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

func NewMeasurement

func NewMeasurement() *Measurement

func (*Measurement) Name

func (m *Measurement) Name(str string) *Measurement

func (*Measurement) Regex

func (m *Measurement) Regex(regex *regexp.Regexp) *Measurement

func (*Measurement) WithDatabase

func (m *Measurement) WithDatabase(str string) *Measurement

func (*Measurement) WithPolicy

func (m *Measurement) WithPolicy(str string) *Measurement

type Order

type Order bool
const ASC Order = true
const DESC Order = false

type Parenthesis

type Parenthesis struct {
	Expr []interface{}
}

type RevokeBuilder

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

func NewRevokeBuilder

func NewRevokeBuilder() *RevokeBuilder

func (*RevokeBuilder) Admin

func (b *RevokeBuilder) Admin() *RevokeBuilder

func (*RevokeBuilder) Build

func (b *RevokeBuilder) Build() (string, error)

func (*RevokeBuilder) FromUsername

func (b *RevokeBuilder) FromUsername(username string) *RevokeBuilder

func (*RevokeBuilder) OnDatabase

func (b *RevokeBuilder) OnDatabase(database string) *RevokeBuilder

func (*RevokeBuilder) WithPrivilege

func (b *RevokeBuilder) WithPrivilege(privilege influxql.Privilege) *RevokeBuilder

type SelectBuilder

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

func NewSelectBuilder

func NewSelectBuilder() *SelectBuilder

func (*SelectBuilder) AddFrom

func (q *SelectBuilder) AddFrom(fields ...string) *SelectBuilder

func (*SelectBuilder) AddFromRegex

func (q *SelectBuilder) AddFromRegex(regexes ...*regexp.Regexp) *SelectBuilder

func (*SelectBuilder) AddFromSubQuery

func (q *SelectBuilder) AddFromSubQuery(fields ...*SelectBuilder) *SelectBuilder

func (*SelectBuilder) AddGroupBy

func (q *SelectBuilder) AddGroupBy(fields ...GroupByIf) *SelectBuilder

func (*SelectBuilder) AddSelect

func (q *SelectBuilder) AddSelect(fields ...interface{}) *SelectBuilder

func (*SelectBuilder) Build

func (q *SelectBuilder) Build() (string, error)

func (*SelectBuilder) Fill

func (q *SelectBuilder) Fill(fillOption interface{}) *SelectBuilder

func (*SelectBuilder) From

func (q *SelectBuilder) From(sources ...string) *SelectBuilder

func (*SelectBuilder) FromMeasurements added in v1.0.5

func (q *SelectBuilder) FromMeasurements(sources ...*Measurement) *SelectBuilder

func (*SelectBuilder) FromRegex

func (q *SelectBuilder) FromRegex(regexes ...*regexp.Regexp) *SelectBuilder

func (*SelectBuilder) FromSubQuery

func (q *SelectBuilder) FromSubQuery(subQuery *SelectBuilder) *SelectBuilder

func (*SelectBuilder) GroupBy

func (q *SelectBuilder) GroupBy(fields ...GroupByIf) *SelectBuilder

func (*SelectBuilder) Into

func (q *SelectBuilder) Into(mesurement *Measurement) *SelectBuilder

func (*SelectBuilder) Limit

func (q *SelectBuilder) Limit(limit int) *SelectBuilder

func (*SelectBuilder) Offset

func (q *SelectBuilder) Offset(offset int) *SelectBuilder

func (*SelectBuilder) OrderBy

func (q *SelectBuilder) OrderBy(str string, order Order) *SelectBuilder

func (*SelectBuilder) Select

func (q *SelectBuilder) Select(fields ...interface{}) *SelectBuilder

func (*SelectBuilder) SeriesLimit

func (q *SelectBuilder) SeriesLimit(limit int) *SelectBuilder

func (*SelectBuilder) SeriesOffset

func (q *SelectBuilder) SeriesOffset(offset int) *SelectBuilder

func (*SelectBuilder) Where

func (q *SelectBuilder) Where(expr interface{}) *SelectBuilder

func (*SelectBuilder) WithTimeZone

func (q *SelectBuilder) WithTimeZone(timeZone interface{}) *SelectBuilder

type ShowContinuousQueries

type ShowContinuousQueries struct{}

func NewShowContinuousQueries

func NewShowContinuousQueries() *ShowContinuousQueries

func (*ShowContinuousQueries) Build

func (b *ShowContinuousQueries) Build() (string, error)

type ShowDatabases

type ShowDatabases struct{}

func NewShowDatabases

func NewShowDatabases() *ShowDatabases

func (*ShowDatabases) Build

func (b *ShowDatabases) Build() (string, error)

type ShowDiagnostics

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

func NewShowDiagnostics

func NewShowDiagnostics() *ShowDiagnostics

func (*ShowDiagnostics) Build

func (b *ShowDiagnostics) Build() (string, error)

func (*ShowDiagnostics) ForModule

func (b *ShowDiagnostics) ForModule(str string) *ShowDiagnostics

type ShowFieldKeyCardinality

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

func NewShowFieldKeyCardinality

func NewShowFieldKeyCardinality() *ShowFieldKeyCardinality

func (*ShowFieldKeyCardinality) Build

func (b *ShowFieldKeyCardinality) Build() (string, error)

func (*ShowFieldKeyCardinality) Exact

func (*ShowFieldKeyCardinality) From

func (*ShowFieldKeyCardinality) GroupBy

func (*ShowFieldKeyCardinality) Limit

func (*ShowFieldKeyCardinality) Offset

func (*ShowFieldKeyCardinality) OnDatabase

func (*ShowFieldKeyCardinality) Where

func (b *ShowFieldKeyCardinality) Where(condition interface{}) *ShowFieldKeyCardinality

type ShowFieldKeys

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

func NewShowFieldKeys

func NewShowFieldKeys() *ShowFieldKeys

func (*ShowFieldKeys) Build

func (b *ShowFieldKeys) Build() (string, error)

func (*ShowFieldKeys) From

func (b *ShowFieldKeys) From(meaurements ...*Measurement) *ShowFieldKeys

func (*ShowFieldKeys) Limit

func (b *ShowFieldKeys) Limit(limit int) *ShowFieldKeys

func (*ShowFieldKeys) Offset

func (b *ShowFieldKeys) Offset(offset int) *ShowFieldKeys

func (*ShowFieldKeys) WithDatabse

func (b *ShowFieldKeys) WithDatabse(database string) *ShowFieldKeys

type ShowGrants

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

func NewShowGrants

func NewShowGrants() *ShowGrants

func (*ShowGrants) Build

func (b *ShowGrants) Build() (string, error)

func (*ShowGrants) ForUser

func (b *ShowGrants) ForUser(user string) *ShowGrants

type ShowMeasurementCardinality

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

func NewShowMeasurementCardinality

func NewShowMeasurementCardinality() *ShowMeasurementCardinality

func (*ShowMeasurementCardinality) Build

func (b *ShowMeasurementCardinality) Build() (string, error)

func (*ShowMeasurementCardinality) Exact

func (*ShowMeasurementCardinality) From

func (*ShowMeasurementCardinality) GroupBy

func (*ShowMeasurementCardinality) Limit

func (*ShowMeasurementCardinality) Offset

func (*ShowMeasurementCardinality) OnDatabase

func (*ShowMeasurementCardinality) Where

func (b *ShowMeasurementCardinality) Where(condition interface{}) *ShowMeasurementCardinality

type ShowMeasurements

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

func NewShowMeasurements

func NewShowMeasurements() *ShowMeasurements

func (*ShowMeasurements) Build

func (b *ShowMeasurements) Build() (string, error)

func (*ShowMeasurements) Limit

func (b *ShowMeasurements) Limit(limit int) *ShowMeasurements

func (*ShowMeasurements) Offset

func (b *ShowMeasurements) Offset(offset int) *ShowMeasurements

func (*ShowMeasurements) OnDatabase

func (b *ShowMeasurements) OnDatabase(db string) *ShowMeasurements

func (*ShowMeasurements) Where

func (b *ShowMeasurements) Where(condition interface{}) *ShowMeasurements

func (*ShowMeasurements) WithMeasurement

func (b *ShowMeasurements) WithMeasurement(regexp *regexp.Regexp) *ShowMeasurements

type ShowQueries

type ShowQueries struct{}

func NewShowQueries

func NewShowQueries() *ShowQueries

func (*ShowQueries) Build

func (b *ShowQueries) Build() (string, error)

type ShowRetentionPolicies

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

func NewShowRetentionPolicies

func NewShowRetentionPolicies() *ShowRetentionPolicies

func (*ShowRetentionPolicies) Build

func (b *ShowRetentionPolicies) Build() (string, error)

func (*ShowRetentionPolicies) WithDatabse

type ShowSeries

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

func NewShowSeries

func NewShowSeries() *ShowSeries

func (*ShowSeries) Build

func (b *ShowSeries) Build() (string, error)

func (*ShowSeries) Limit

func (b *ShowSeries) Limit(limit int) *ShowSeries

func (*ShowSeries) Offset

func (b *ShowSeries) Offset(offset int) *ShowSeries

func (*ShowSeries) OnDatabase

func (b *ShowSeries) OnDatabase(db string) *ShowSeries

func (*ShowSeries) Where

func (b *ShowSeries) Where(condition interface{}) *ShowSeries

func (*ShowSeries) WithMeasurement

func (b *ShowSeries) WithMeasurement(sources ...*Measurement) *ShowSeries

type ShowSeriesCadinality

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

func NewShowSeriesCadinality

func NewShowSeriesCadinality() *ShowSeriesCadinality

func (*ShowSeriesCadinality) Build

func (b *ShowSeriesCadinality) Build() (string, error)

func (*ShowSeriesCadinality) Excat

func (*ShowSeriesCadinality) From

func (b *ShowSeriesCadinality) From(measuremnts ...*Measurement) *ShowSeriesCadinality

func (*ShowSeriesCadinality) GroupBy

func (b *ShowSeriesCadinality) GroupBy(fields ...GroupByIf) *ShowSeriesCadinality

func (*ShowSeriesCadinality) Limit

func (*ShowSeriesCadinality) Offset

func (b *ShowSeriesCadinality) Offset(offset int) *ShowSeriesCadinality

func (*ShowSeriesCadinality) OnDatabase

func (*ShowSeriesCadinality) Where

func (b *ShowSeriesCadinality) Where(condition interface{}) *ShowSeriesCadinality

type ShowShardGroups

type ShowShardGroups struct{}

func NewShowShardGroup

func NewShowShardGroup() *ShowShardGroups

func (*ShowShardGroups) Build

func (b *ShowShardGroups) Build() (string, error)

type ShowShards

type ShowShards struct{}

func NewShowShards

func NewShowShards() *ShowShards

func (*ShowShards) Build

func (b *ShowShards) Build() (string, error)

type ShowStats

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

func NewShowStats

func NewShowStats() *ShowStats

func (*ShowStats) Build

func (b *ShowStats) Build() (string, error)

func (*ShowStats) ForComponent

func (b *ShowStats) ForComponent(component string) *ShowStats

func (*ShowStats) ForIndexes

func (b *ShowStats) ForIndexes() *ShowStats

type ShowSubscriptions

type ShowSubscriptions struct{}

func NewShowSubscriptions

func NewShowSubscriptions() *ShowSubscriptions

func (*ShowSubscriptions) Build

func (b *ShowSubscriptions) Build() (string, error)

type ShowTagKeyCardinality

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

func NewShowTagKeyCardinality

func NewShowTagKeyCardinality() *ShowTagKeyCardinality

func (*ShowTagKeyCardinality) Build

func (b *ShowTagKeyCardinality) Build() (string, error)

func (*ShowTagKeyCardinality) Exact

func (*ShowTagKeyCardinality) From

func (*ShowTagKeyCardinality) GroupBy

func (b *ShowTagKeyCardinality) GroupBy(fields ...GroupByIf) *ShowTagKeyCardinality

func (*ShowTagKeyCardinality) Limit

func (*ShowTagKeyCardinality) Offset

func (b *ShowTagKeyCardinality) Offset(offset int) *ShowTagKeyCardinality

func (*ShowTagKeyCardinality) OnDatabase

func (*ShowTagKeyCardinality) Where

func (b *ShowTagKeyCardinality) Where(condition interface{}) *ShowTagKeyCardinality

type ShowTagKeys

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

func NewShowTagKeys

func NewShowTagKeys() *ShowTagKeys

func (*ShowTagKeys) Build

func (b *ShowTagKeys) Build() (string, error)

func (*ShowTagKeys) From

func (b *ShowTagKeys) From(sources ...*Measurement) *ShowTagKeys

func (*ShowTagKeys) Limit

func (b *ShowTagKeys) Limit(limit int) *ShowTagKeys

func (*ShowTagKeys) Offset

func (b *ShowTagKeys) Offset(offset int) *ShowTagKeys

func (*ShowTagKeys) OnDatabase

func (b *ShowTagKeys) OnDatabase(str string) *ShowTagKeys

func (*ShowTagKeys) SLimit

func (b *ShowTagKeys) SLimit(limit int) *ShowTagKeys

func (*ShowTagKeys) SOffset

func (b *ShowTagKeys) SOffset(offset int) *ShowTagKeys

func (*ShowTagKeys) Where

func (b *ShowTagKeys) Where(condition interface{}) *ShowTagKeys

type ShowTagValues

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

func NewShowTagValues

func NewShowTagValues() *ShowTagValues

func (*ShowTagValues) Build

func (b *ShowTagValues) Build() (string, error)

func (*ShowTagValues) From

func (b *ShowTagValues) From(sources ...*Measurement) *ShowTagValues

func (*ShowTagValues) Limit

func (b *ShowTagValues) Limit(limit int) *ShowTagValues

func (*ShowTagValues) Offset

func (b *ShowTagValues) Offset(offset int) *ShowTagValues

func (*ShowTagValues) OnDatabase

func (b *ShowTagValues) OnDatabase(str string) *ShowTagValues

func (*ShowTagValues) Where

func (b *ShowTagValues) Where(condition interface{}) *ShowTagValues

func (*ShowTagValues) WithTagKey

func (b *ShowTagValues) WithTagKey(operator influxql.Token, tagKey influxql.Literal) *ShowTagValues

TODO : Rewrite with custom objects

type ShowTagValuesCardinality

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

func NewShowTagValuesCardinality

func NewShowTagValuesCardinality() *ShowTagValuesCardinality

func (*ShowTagValuesCardinality) Build

func (b *ShowTagValuesCardinality) Build() (string, error)

func (*ShowTagValuesCardinality) Exact

func (*ShowTagValuesCardinality) From

func (*ShowTagValuesCardinality) GroupBy

func (*ShowTagValuesCardinality) Limit

func (*ShowTagValuesCardinality) Offset

func (*ShowTagValuesCardinality) OnDatabase

func (*ShowTagValuesCardinality) Where

func (b *ShowTagValuesCardinality) Where(condition interface{}) *ShowTagValuesCardinality

func (*ShowTagValuesCardinality) WithTagKey

type ShowUsers

type ShowUsers struct{}

func NewShowUsers

func NewShowUsers() *ShowUsers

func (*ShowUsers) Build

func (b *ShowUsers) Build() (string, error)

type SubscriptionMode

type SubscriptionMode string
const ALL SubscriptionMode = "ALL"
const ANY SubscriptionMode = "ANY"

type TimeSampling

type TimeSampling struct {
	Interval time.Duration
}

func NewTimeSampling

func NewTimeSampling(it time.Duration) *TimeSampling

type Wildcard

type Wildcard struct {
	FieldIf
}

func NewWildcardField

func NewWildcardField() *Wildcard

Jump to

Keyboard shortcuts

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