core

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArgsEqual

func ArgsEqual(a, b []ArgValue) bool

Types

type ArgValue

type ArgValue struct {
	Position int
	Name     string
	Type     string
	Value    string
	Raw      any
}

type CacheKey

type CacheKey struct {
	TemplateID TemplateID
	ArgKey     string
}

func NewCacheKey

func NewCacheKey(templateID TemplateID, args []ArgValue) CacheKey

type FeatureMap

type FeatureMap map[string]float64

type Operation

type Operation uint8
const (
	OpSelect Operation = iota + 1
	OpWrite
	OpUtility
)

type Prediction

type Prediction struct {
	TemplateID           TemplateID
	Probability          float64
	Confidence           float64
	ContextOrder         int
	Source               string
	BorrowedFrom         TemplateID
	StructuralSimilarity float64
	StructuralOverlap    []string
}

type QueryEvent

type QueryEvent struct {
	EventID     uint64
	RequestID   string
	SessionID   string
	Route       string
	TemplateID  TemplateID
	Operation   Operation
	Cacheable   bool
	Args        []ArgValue
	ResultBytes int
	DBLatency   time.Duration
}

type StructuralNeighbor

type StructuralNeighbor struct {
	TemplateID TemplateID
	Similarity float64
	Overlap    []string
}

type Template

type Template struct {
	ID                      TemplateID
	Name                    string
	CanonicalSQL            string
	ExecutableSQL           string
	ExecutableSQLReady      bool
	Fingerprint             string
	FingerprintHash         uint64
	Operation               Operation
	Cacheable               bool
	ArgNames                []string
	ReadTables              []string
	WriteTables             []string
	TableDependenciesKnown  bool
	StructuralFeatures      FeatureMap
	StructuralFeaturesKnown bool
	ResultBytes             int
	DBLatency               time.Duration
	ExpectedRows            int
	EstimatedCost           time.Duration
}

type TemplateID

type TemplateID uint64

Jump to

Keyboard shortcuts

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