Skip to main content

internal/formation/rebuild.go

internal/formation · 66 lines · 5 declarations · source

Declarations

var ErrGenerationInference

var ErrGenerationInference = errors.New("generation inference failed before cutover")

source

type Rebuilder

type Rebuilder struct {
facts *pg.FactStore
extractor *extract.Extractor
}

source

func NewRebuilder

func NewRebuilder(facts *pg.FactStore, extractor *extract.Extractor) *Rebuilder

source

method Rebuilder.Rebuild

func (r *Rebuilder) Rebuild(ctx context.Context, schema pg.Schema, scope, source, key, principal string) (pg.GenerationResult, error)

Rebuild prepares all output while the old facts remain available. The one-source transaction checks that nothing changed meanwhile, and commits a receipt keyed by the operator's request. An interrupted preparation can cost another model attempt; an interrupted published operation reuses its recorded outcome. Provider bodies never enter the operator's error output.

source

method Rebuilder.rebuild

func (r *Rebuilder) rebuild(ctx context.Context, schema pg.Schema, scope, source, key, principal string, guard *pg.GenerationJobGuard) (pg.GenerationResult, error)

source