Documentation
¶
Overview ¶
Package plan defines normalization and shape-planning responsibilities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ComponentRoute ¶ added in v0.38.0
type ComponentRoute struct {
Path string
FieldName string
Type reflect.Type
InputType reflect.Type
OutputType reflect.Type
InputName string
OutputName string
ViewName string
SourceURL string
SummaryURL string
Name string
RoutePath string
Method string
Connector string
Marshaller string
Handler string
Report *dqlshape.ReportDirective
}
type Planner ¶
type Planner struct{}
Planner normalizes scan descriptors into shape plan.
func (*Planner) Plan ¶
func (p *Planner) Plan(ctx context.Context, scanned *shape.ScanResult, _ ...shape.PlanOption) (*shape.PlanResult, error)
Plan implements shape.Planner.
type Relation ¶
type Relation struct {
Name string
Parent string
Holder string
Ref string
Table string
Kind string
Raw string
ColumnsConfig map[string]*ViewColumnConfig
On []*RelationLink
Warnings []string
}
Relation is normalized relation metadata extracted from DQL joins.
type RelationLink ¶
type RelationLink struct {
ParentField string
ParentNamespace string
ParentColumn string
RefField string
RefNamespace string
RefColumn string
Expression string
}
RelationLink represents one parent/ref join predicate.
type Result ¶
type Result struct {
RootType reflect.Type
EmbedFS *embed.FS
Fields []*Field
ByPath map[string]*Field
Views []*View
ViewsByName map[string]*View
States []*State
Components []*ComponentRoute
Types []*Type
ColumnsDiscovery bool
Const map[string]string
TypeContext *typectx.Context
Directives *dqlshape.Directives
Diagnostics []*dqlshape.Diagnostic
}
Result is normalized shape plan produced from scan descriptors.
func ResultFrom ¶ added in v0.38.0
func ResultFrom(a *shape.PlanResult) (*Result, bool)
ResultFrom extracts the typed plan result from a PlanResult. Returns (nil, false) when a is nil or contains an unexpected concrete type.
func (*Result) ShapeSpecKind ¶ added in v0.38.0
ShapeSpecKind implements shape.PlanSpec.
type SelfReference ¶ added in v0.38.0
SelfReference captures self-join tree metadata parsed from DQL.
type State ¶
type State struct {
state.Parameter `yaml:",inline"`
QuerySelector string
OutputDataType string
EmitOutput bool
}
State is a normalized parameter field plan.
func (*State) KindString ¶ added in v0.38.0
type Type ¶
type Type struct {
Name string
Alias string
DataType string
Cardinality string
Package string
ModulePath string
}
Type is normalized type metadata collected during compile.
type View ¶
type View struct {
Path string
Name string
Ref string
Mode string
Table string
Module string
Connector string
CacheRef string
Partitioner string
PartitionedConcurrency int
RelationalConcurrency int
SQL string
SQLURI string
Summary string
SummaryURL string
SummaryName string
Relations []*Relation
Holder string
AllowNulls *bool
Groupable *bool
SelectorNamespace string
SelectorLimit *int
SelectorNoLimit *bool
SelectorCriteria *bool
SelectorProjection *bool
SelectorOrderBy *bool
SelectorOffset *bool
SelectorPage *bool
SelectorFilterable []string
SelectorOrderByColumns map[string]string
SchemaType string
ColumnsDiscovery bool
Self *SelfReference
Cardinality string
ElementType reflect.Type
FieldType reflect.Type
Declaration *ViewDeclaration
}
View is a normalized view field plan.
type ViewColumnConfig ¶ added in v0.38.0
ViewColumnConfig captures declaration-level per-column overrides.
type ViewDeclaration ¶
type ViewDeclaration struct {
Tag string
TypeName string
Dest string
Codec string
CodecArgs []string
HandlerName string
HandlerArgs []string
StatusCode *int
ErrorMessage string
QuerySelector string
CacheRef string
Limit *int
Cacheable *bool
When string
Scope string
DataType string
Of string
Value string
Async bool
Output bool
Predicates []*ViewPredicate
ColumnsConfig map[string]*ViewColumnConfig
}
ViewDeclaration captures declaration options used to derive a view from DQL directives.