Versions in this module Expand all Collapse all v1 v1.0.0 Aug 18, 2026 Changes in this version + var ErrDuplicateEntity = errors.New("autoseed: duplicate entity name") + var ErrInvalidReference = errors.New("autoseed: reference names no fields") + var ErrInvalidScale = errors.New("autoseed: scale must not be negative") + var ErrNilSeed = errors.New("autoseed: seed is nil") + var ErrUnknownReference = errors.New("autoseed: reference targets an unknown entity") + var ErrUnsatisfiableCycle = errors.New("autoseed: unsatisfiable required foreign key cycle") + var ErrUnsatisfiableUniqueness = errors.New("autoseed: could not generate a unique value") + var ErrUnsupportedField = errors.New("autoseed: no inference rule for field") + func ApplyCoverageOverrides(entity Entity, rows []map[string]any) + func EnsureUnique(entity Entity, rows []map[string]any, seed *SeededSource) error + func JunctionIndices(participants []JunctionParticipant, driverTarget string, ...) []int + type DeferredReference struct + Entity string + Fields []string + Target string + type DependencyGraph struct + func NewDependencyGraph(entities []Entity) (*DependencyGraph, error) + func (g *DependencyGraph) Resolve() (*TopologicalSortResult, error) + type Entity struct + Fields []Field + Name string + References []Reference + UniqueConstraints [][]string + type EntityGenerationPlan struct + ChildCounts []int + Driver string + DriverFields []string + Entity string + JunctionParticipants []JunctionParticipant + RowCount int + type Field struct + AutoIncrement bool + Name string + Nullable bool + PrimaryKey bool + Size int + SoftDelete bool + Type reflect.Type + Unique bool + type GenerationPlan struct + Entities []EntityGenerationPlan + func PlanCoverage(entities []Entity, order []string, deferred []DeferredReference) (*GenerationPlan, error) + func PlanGeneration(entities []Entity, order []string, deferred []DeferredReference, ...) (*GenerationPlan, error) + type JunctionParticipant struct + Fields []string + Target string + type ModelSource interface + Entities func() ([]Entity, error) + type Option func(*Options) + func WithLocale(locale string) Option + func WithNilRate(rate float64) Option + func WithScale(scale int) Option + func WithSeed(seed uint64) Option + type Options struct + Locale string + NilRate float64 + Scale int + Seed uint64 + func NewOptions(opts ...Option) Options + type Plan struct + Deferred []DeferredReference + Order []string + Skipped []SkipReason + func Explain(source ModelSource, skipped ...SkipReason) (*Plan, error) + func (p *Plan) Report() string + type Reference struct + Fields []string + Nullable bool + Target string + type SeededSource struct + func NewSeededSource(seed uint64) *SeededSource + func (s *SeededSource) Entity(name string) *SeededSource + func (s *SeededSource) Field(name string) *SeededSource + func (s *SeededSource) Rand() *rand.Rand + func (s *SeededSource) Row(index int) *SeededSource + func (s *SeededSource) Seed() uint64 + type SkipReason struct + Entity string + Field string + Reason string + type TopologicalSortResult struct + Deferred []DeferredReference + Order []string