Documentation
¶
Overview ¶
Package compiler converts canonical view metadata and typed contracts into immutable SQL reader plans. Each graph starts with a detached spec.View snapshot owned by data.View.Spec. Enrichment updates that snapshot; only resolved SQL columns and paired field links need reader projections. Publication ends enrichment. Collector state, native caches, partitioners, templates and execution remain with their existing reader owners. This package does not parse authored DQL, register runtime components, scan rows, or execute SQL.
Index ¶
- Variables
- func Compile(input Input) (*sqlreader.Plan, error)
- func CompileSelectorBindings(component *spec.Component, inputType reflect.Type, root *data.View, ...) ([]sqlreader.SelectorBindingPlan, error)
- func CompileViewDependencies(input Input) ([]*sqlreader.ViewDependency, error)
- func CompileViewMetadata(input Input) (*data.View, error)
- func ResolveOutputField(component *spec.Component, outputType reflect.Type, slot OutputSlot) string
- type Input
- type OutputSlot
Constants ¶
This section is empty.
Variables ¶
var ( ViewSlot = OutputSlot{OutputName: "view", FieldName: "Data"} StatusSlot = OutputSlot{OutputName: "status", FieldName: "Status"} MetricsSlot = OutputSlot{OutputName: "metrics", FieldName: "Metrics"} )
Functions ¶
func CompileSelectorBindings ¶
func CompileViewDependencies ¶
func CompileViewDependencies(input Input) ([]*sqlreader.ViewDependency, error)
CompileViewDependencies compiles independent canonical views referenced by Bindly input bindings into the same reader plans used by route reads.
func CompileViewMetadata ¶ added in v1.1.0
CompileViewMetadata resolves the same output graph as a reader without compiling SQL programs, collectors, codecs, or an executable reader plan.
func ResolveOutputField ¶
ResolveOutputField resolves the exported output-struct field backing a reserved output slot. It first honors an explicit output-kind param whose Source.Name matches the slot output name (view also accepts body), then uses the slot's conventional field when no param claims it.
Types ¶
type Input ¶
type Input struct {
Const *constant.Values
CodecFactory xcodec.Factory
Component *spec.Component
InputType reflect.Type
OutputType reflect.Type
Bindings []bindly.BindingSpec
Predicate dexec.PredicateEvaluator
TypeLookup func(name string) (reflect.Type, error)
DirectViewField string
DirectViewType reflect.Type
Resources fs.FS
}
type OutputSlot ¶
OutputSlot describes one reserved output slot: the logical output name used by `output/...` params and the conventional exported field name used when no param claims the slot explicitly.