Help us shape the future of Go! Take the 2026 Go Developer Survey

querybuilder

package
v0.24.1 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockTable

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

func NewMockTable

func NewMockTable(projectId, datasetId, tableId string) *MockTable

func (*MockTable) Fqn

func (t *MockTable) Fqn() *TableFqnExpr

func (*MockTable) NumericCol

func (t *MockTable) NumericCol(name string) *NumericColExpr

func (*MockTable) TextCol

func (t *MockTable) TextCol(name string) *TextColExpr

func (*MockTable) TimeCol

func (t *MockTable) TimeCol(name string) *TimeColExpr

type QueryBuilder

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

func NewQueryBuilder

func NewQueryBuilder(table TableExpr, cols []Expr) *QueryBuilder

func (*QueryBuilder) GetTimeRange

func (b *QueryBuilder) GetTimeRange() (time.Time, time.Time, error)

func (*QueryBuilder) GetTimeSegment

func (b *QueryBuilder) GetTimeSegment() (time.Duration, error)

func (*QueryBuilder) OrderBy

func (b *QueryBuilder) OrderBy(orderBy ...OrderByExpr) *QueryBuilder

func (*QueryBuilder) ToSql

func (b *QueryBuilder) ToSql(dialect Dialect) (string, error)

func (*QueryBuilder) WithCte added in v0.4.16

func (b *QueryBuilder) WithCte(name string, query CteExpr) *QueryBuilder

func (*QueryBuilder) WithFieldTimeRange

func (b *QueryBuilder) WithFieldTimeRange(col *TimeColExpr, from, to time.Time) *QueryBuilder

func (*QueryBuilder) WithFilter

func (b *QueryBuilder) WithFilter(filter CondExpr) *QueryBuilder

func (*QueryBuilder) WithGroupBy added in v0.1.8

func (b *QueryBuilder) WithGroupBy(groupBy ...Expr) *QueryBuilder

func (*QueryBuilder) WithLimit

func (b *QueryBuilder) WithLimit(limit int64) *QueryBuilder

func (*QueryBuilder) WithSegment

func (b *QueryBuilder) WithSegment(segment TextExpr) *QueryBuilder

func (*QueryBuilder) WithSegmentFiltered added in v0.1.10

func (b *QueryBuilder) WithSegmentFiltered(segment TextExpr, values []string, isExcluding bool) *QueryBuilder

func (*QueryBuilder) WithShiftedTimeSegment

func (b *QueryBuilder) WithShiftedTimeSegment(col *TimeColExpr, segment time.Duration, timeShift time.Duration) *QueryBuilder

func (*QueryBuilder) WithTimeRange

func (b *QueryBuilder) WithTimeRange(from, to time.Time) (*QueryBuilder, error)

func (*QueryBuilder) WithTimeRangeExpr added in v0.14.1

func (b *QueryBuilder) WithTimeRangeExpr(from, to Expr) *QueryBuilder

WithTimeRangeExpr sets arbitrary expressions for the lower (inclusive) and upper (exclusive) bounds of the time-range WHERE clause. Useful for emitting SQL with placeholder bounds (e.g. {from}, {to}) instead of materialized timestamp literals. Requires the time column to be set via WithTimeSegment / WithShiftedTimeSegment / WithFieldTimeRange; otherwise the WHERE clause is omitted (same gate as the time.Time-based path).

func (*QueryBuilder) WithTimeSegment

func (b *QueryBuilder) WithTimeSegment(col *TimeColExpr, segment time.Duration) *QueryBuilder

type TableLike

type TableLike interface {
	Fqn() *TableFqnExpr
}

Jump to

Keyboard shortcuts

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