query

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2026 License: Apache-2.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CSVBytes

func CSVBytes(columns []string, rows [][]any) ([]byte, error)

func VisualRequestToQuery

func VisualRequestToQuery(databaseID, schema, table string, fields []string, aggregation, aggregationField, filterField, filterValue string) (queryir.Query, error)

func WriteCSV

func WriteCSV(w io.Writer, columns []string, rows [][]any) error

Types

type Compiler

type Compiler func(queryir.Query) (queryir.Compiled, error)

type DatasetResult

type DatasetResult struct {
	SQL       string         `json:"sql"`
	Columns   []string       `json:"columns"`
	Rows      [][]any        `json:"rows"`
	Meta      map[string]any `json:"meta"`
	ChartSpec core.ChartSpec `json:"chartspec"`
}

type DatasetService

type DatasetService struct {
	Queries core.QueryService
	Compile Compiler
	Expand  *Expander
}

func (DatasetService) ExportCSV

func (s DatasetService) ExportCSV(ctx context.Context, q queryir.Query, w io.Writer) error

func (DatasetService) Run

func (DatasetService) RunDashboardCard

func (s DatasetService) RunDashboardCard(ctx context.Context, board core.Dashboard, cardID string, values map[string]any, questions core.QuestionStore) (DatasetResult, error)

func (DatasetService) RunNativeQuestion

func (s DatasetService) RunNativeQuestion(ctx context.Context, question core.Question, values map[string]any) (DatasetResult, error)

RunNativeQuestion binds the saved parameter definitions before using the same read-only executor and result limits as the query editor.

type Expander

type Expander struct {
	Fields    core.FieldStore
	Models    core.ModelStore
	Metrics   core.MetricStore
	Segments  core.SegmentStore
	Questions core.QuestionStore
}

func (*Expander) Expand

func (e *Expander) Expand(q queryir.Query) (queryir.Query, error)

Jump to

Keyboard shortcuts

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