compiler

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package compiler validates canonical component metadata and produces the target-neutral handler AST.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EntityInvariants

func EntityInvariants(entity *plan.EntityPlan) ([]plan.InvariantGroup, error)

EntityInvariants compiles authored field groups without mutating the entity plan. Field order remains canonical and group names share typecatalog naming.

Types

type Compiler

type Compiler struct{}

Compiler validates canonical metadata and builds target-neutral plans.

func (*Compiler) BuildInput

func (c *Compiler) BuildInput(request Request, rootType string) (Request, error)

BuildInput derives mutation request state from the canonical writable graph. It returns detached metadata; authored parameters retain their authority.

func (*Compiler) Compile

func (c *Compiler) Compile(request Request) (*plan.Plan, error)

Compile builds one root write plan.

func (*Compiler) RefineCurrentField

func (c *Compiler) RefineCurrentField(field plan.CurrentField, currentType, entityType string) (plan.CurrentField, error)

RefineCurrentField incorporates final canonical Go type identities into one declared projection. It does not infer whether a runtime query loaded it.

type CurrentBinding

type CurrentBinding struct {
	Lookup       *plan.LookupProjection
	ViewIdentity string
	Param        string
}

CurrentBinding maps one canonical record-view identity to the ordinary component input parameter that supplies its current rows.

type EntityHookCompiler

type EntityHookCompiler struct {
	Types *typecatalog.Resolver
	// CanonicalType applies generated alias authority when declarations use
	// package-local aliases for separately owned entities or contracts.
	CanonicalType func(string) (string, error)
}

EntityHookCompiler validates authored hook contracts before target lowering. Instantiation and Bindly invocation lifetime belong to the generated program.

func (EntityHookCompiler) Compile

func (c EntityHookCompiler) Compile(request EntityHookRequest) (spec.TypeRef, error)

type EntityHookRequest

type EntityHookRequest struct{ Hook, Entity, Parent, Input, Output string }

EntityHookRequest carries canonical entity/parent identities, not runtime values. Parent is empty only at the root, whose typed parent is NoParent.

type Request

type Request struct {
	Component    *spec.Component
	ViewBindings map[string]string
	Operation    plan.Operation
	Input        string
	Output       string
	Current      string
	Currents     []CurrentBinding
	Table        string
	Key          string
}

Request contains canonical, already-refined authority for one root plan.

Jump to

Keyboard shortcuts

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