Documentation
¶
Overview ¶
Package writer provides the metadata-driven built-in mutation handler.
Index ¶
- type Action
- type DatabaseSnapshot
- type Field
- type Frame
- type FrameworkValidation
- type Handler
- func (h *Handler) CaptureInput(ctx context.Context, input any) (any, error)
- func (h *Handler) Execute(ctx context.Context, invocation rhandler.Invocation) (any, error)
- func (h *Handler) FinalizeOutcome(ctx context.Context, invocation rhandler.Invocation, _ any, ...) error
- func (h *Handler) InputType() reflect.Type
- func (h *Handler) OutputType() reflect.Type
- func (*Handler) RequiresReadMetadata() bool
- type Hooks
- type Link
- type Metadata
- type MutationActions
- type MutationFrames
- type OriginalInput
- type Program
- type Record
- type Relation
- type Stage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DatabaseSnapshot ¶
type DatabaseSnapshot struct {
Rows map[rowIdentity]reflect.Value
ByRecord map[*Record][]reflect.Value
}
DatabaseSnapshot indexes Current rows by role and identity. ByRecord keeps the load order so assembled Previous relations are deterministic.
type Field ¶
type Field struct {
Name string
Column string
Index []int
Has []int
AutoIncrement bool
RefDB string
RefTable string
RefColumn string
// contains filtered or unexported fields
}
Field is one compiled entity field.
type FrameworkValidation ¶
type FrameworkValidation struct{}
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler is the universal writer. Component-specific behavior is Metadata.
func (*Handler) CaptureInput ¶
func (*Handler) FinalizeOutcome ¶
func (*Handler) OutputType ¶
func (*Handler) RequiresReadMetadata ¶
type Metadata ¶
type Metadata struct {
Component *spec.Component
Operation string
InputField int
CurrentField int
OutputField int
EntityType reflect.Type
CurrentType reflect.Type
Table string
Keys []Field
Fields []Field
Sequence *Field
DeleteMarker *Field
ConcurrencyToken *Field
Invariants map[string][]Field
HookType reflect.Type
Root *Record
}
Metadata is the immutable, component-specific plan interpreted by Handler. It contains no generated executable phase code.
type MutationActions ¶
type MutationActions struct{ Rows []*Action }
type MutationFrames ¶
type MutationFrames struct{ Rows []*Frame }
type OriginalInput ¶
type OriginalInput struct{ Presence map[uintptr]originalPresence }
type Program ¶
type Program struct {
// contains filtered or unexported fields
}
Program is invocation-owned universal mutation state. The same type is used for every writer component; only Metadata and values differ.
type Record ¶
type Record struct {
Name string
Path string
Auxiliary bool
Selector string
EntityType reflect.Type
CurrentField int
Table string
Keys []Field
Fields []Field
Sequence *Field
DeleteMarker *Field
ConcurrencyToken *Field
Invariants map[string][]Field
HookType reflect.Type
Relations []*Relation
// contains filtered or unexported fields
}
Record is one writable role in a component graph.