analytics

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2026 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnalyticsPlanAliasFact added in v0.1.0

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

AnalyticsPlanAliasFact is one renderer-owned identity for an alias that a provider plan can name. It retains only an opaque matcher and stable schema identities. It never retains SQL, binds, predicates, actor data, or physical table, column, index, and schema names.

func (AnalyticsPlanAliasFact) FieldIDs added in v0.1.0

func (fact AnalyticsPlanAliasFact) FieldIDs() []policyir.FieldID

func (AnalyticsPlanAliasFact) Matches added in v0.1.0

func (fact AnalyticsPlanAliasFact) Matches(candidate string) bool

Matches compares an untrusted provider-plan alias with the renderer-owned token. Zero and incomplete facts always fail closed.

func (AnalyticsPlanAliasFact) ModelID added in v0.1.0

func (fact AnalyticsPlanAliasFact) ModelID() policyir.ModelID

func (AnalyticsPlanAliasFact) RelationID added in v0.1.0

func (fact AnalyticsPlanAliasFact) RelationID() (policyir.RelationID, bool)

func (AnalyticsPlanAliasFact) Role added in v0.1.0

type AnalyticsPlanAliasRole added in v0.1.0

type AnalyticsPlanAliasRole uint8

AnalyticsPlanAliasRole classifies only the renderer-owned alias, not a provider plan node. A sanitizer must combine this closed provenance with the provider node kind and may never turn a derived alias into physical access.

const (
	AnalyticsPlanAliasPhysicalAccess AnalyticsPlanAliasRole = iota + 1
	AnalyticsPlanAliasCorrelatedRelation
	AnalyticsPlanAliasAggregate
	AnalyticsPlanAliasMaterialize
	AnalyticsPlanAliasStructural
)

type AnalyticsPlanMap added in v0.1.0

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

AnalyticsPlanMap is the immutable alias identity map for one exact rendered analytics statement. Every returned slice is caller-owned. A missing match remains missing; the map never guesses from an alias naming convention.

func (AnalyticsPlanMap) AliasFacts added in v0.1.0

func (plan AnalyticsPlanMap) AliasFacts() []AnalyticsPlanAliasFact

func (AnalyticsPlanMap) MatchingAliasFacts added in v0.1.0

func (plan AnalyticsPlanMap) MatchingAliasFacts(candidate string) []AnalyticsPlanAliasFact

type Column

type Column struct {
	Term     golem.FrozenAnalyticsTerm
	Alias    string
	Type     compilerir.LogicalTypeIR
	Nullable bool
}

type FieldAuthorizationError

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

FieldAuthorizationError identifies an analytical field only by its public logical name and stable identity. Provider details and physical names never enter this error, so the runtime can safely preserve the name in its public FORBIDDEN response while retaining the underlying reason for trusted logs.

func (*FieldAuthorizationError) Error

func (failure *FieldAuthorizationError) Error() string

func (*FieldAuthorizationError) FieldID

func (failure *FieldAuthorizationError) FieldID() golem.FieldID

func (*FieldAuthorizationError) LogicalName

func (failure *FieldAuthorizationError) LogicalName() string

type Plan

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

func Caller

func Caller(request golem.FrozenAnalyticsRequest, registry *schema.Registry, providers policyir.ProviderSet, policies PolicySet, limits readplan.Limits) (Plan, error)

func System

func System(request golem.FrozenAnalyticsRequest, registry *schema.Registry, providers policyir.ProviderSet, limits readplan.Limits) (Plan, error)

func (Plan) AuthorizedRead

func (plan Plan) AuthorizedRead() readplan.Plan

func (Plan) Field

func (plan Plan) Field(id golem.FieldID) (schema.Field, bool)

func (Plan) RelationPath

func (plan Plan) RelationPath() []RelationHop

func (Plan) Request

func (plan Plan) Request() golem.FrozenAnalyticsRequest

type PolicySet

type PolicySet interface {
	Policy(policyir.ModelID) (policyir.Policy, bool)
}

type RelationHop

type RelationHop struct {
	Endpoint   schema.RelationEndpoint
	Authorized readplan.Plan
}

type RenderOptions

type RenderOptions struct {
	MaxContributionRows   int
	MaxIntermediateGroups int
	MaxResultRows         int
}

type Statement

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

func Render

func Render(plan Plan, registry *schema.Registry, provider policyir.Provider, capabilities policysql.CapabilityProof, options ...RenderOptions) (Statement, error)

func (Statement) Args

func (s Statement) Args() []any

func (Statement) Columns

func (s Statement) Columns() []Column

func (Statement) Grouped

func (s Statement) Grouped() bool

func (Statement) Guarded

func (s Statement) Guarded() bool

func (Statement) LimitOverflow

func (s Statement) LimitOverflow(contributionRows, intermediateGroups int64, resultRows int) string

func (Statement) PlanMap added in v0.1.0

func (s Statement) PlanMap() AnalyticsPlanMap

func (Statement) ResultOverflow

func (s Statement) ResultOverflow(rowCount int) bool

func (Statement) SQL

func (s Statement) SQL() string

func (Statement) ScanColumnCount

func (s Statement) ScanColumnCount() int

Directories

Path Synopsis
Package contract normalizes the compiler-owned analytical contract.
Package contract normalizes the compiler-owned analytical contract.

Jump to

Keyboard shortcuts

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