cubecompose

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: Apache-2.0 Imports: 11 Imported by: 1 module, 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

Overview

Package cubecompose validates and renders bounded compositions of typed cube queries. Runtime execution and contract derivation remain report-owned.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithFrameContext

func WithFrameContext(ctx context.Context, frame FrameContext) context.Context

Types

type Catalog

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

func NewCatalog

func NewCatalog(fields ...Field) (*Catalog, error)

func (*Catalog) Lookup

func (c *Catalog) Lookup(name string) (Field, bool)

type Column

type Column struct {
	Name string `json:"name"`
	Type string `json:"type"`
	Role Role   `json:"role"`
	// contains filtered or unexported fields
}

func (Column) RuntimeType

func (c Column) RuntimeType() reflect.Type

RuntimeType returns the projected scalar type, or nil for a computed expression.

type Field

type Field struct {
	Name string
	// SQLName is the declared source output. Name may differ only for an
	// explicitly authored mapping established by the report source catalog.
	SQLName string
	Type    reflect.Type
	Role    Role
}

type Frame

type Frame struct {
	SQL  string
	Args []interface{}
}

Frame is one trusted, parameterized cube projection supplied to Render.

type FrameContext

type FrameContext struct {
	Frame     int
	Alignment string
	Snapshot  time.Time
}

FrameContext lets period-aware source predicates interpret elapsed alignment. All frames in a request share Snapshot; Datly does not infer business time rules.

func FrameContextFrom

func FrameContextFrom(ctx context.Context) (FrameContext, bool)

type Plan

type Plan struct {
	Columns    []Column
	Fields     [][]string
	FrameCount int
	Limit      int
	// contains filtered or unexported fields
}

func Compile

func Compile(SQL string, catalog *Catalog, frameCount, maxLimit int) (*Plan, error)

func (*Plan) Render

func (p *Plan) Render(frames []Frame) (string, []interface{}, error)

type Role

type Role string
const (
	Dimension Role = "dimension"
	Measure   Role = "measure"
	Computed  Role = "expression"
)

Jump to

Keyboard shortcuts

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