// Code generated by BobGen psql v0.41.1. DO NOT EDIT. // This file is meant to be re-generated in place and/or deleted at any time. package factory import ( "context" "testing" "time" models "github.com/Gleipnir-Technology/nidus-sync/models" "github.com/aarondl/opt/null" "github.com/aarondl/opt/omit" "github.com/aarondl/opt/omitnull" "github.com/jaswdr/faker/v2" "github.com/stephenafamo/bob" ) type FSSpeciesabundanceMod interface { Apply(context.Context, *FSSpeciesabundanceTemplate) } type FSSpeciesabundanceModFunc func(context.Context, *FSSpeciesabundanceTemplate) func (f FSSpeciesabundanceModFunc) Apply(ctx context.Context, n *FSSpeciesabundanceTemplate) { f(ctx, n) } type FSSpeciesabundanceModSlice []FSSpeciesabundanceMod func (mods FSSpeciesabundanceModSlice) Apply(ctx context.Context, n *FSSpeciesabundanceTemplate) { for _, f := range mods { f.Apply(ctx, n) } } // FSSpeciesabundanceTemplate is an object representing the database table. // all columns are optional and should be set by mods type FSSpeciesabundanceTemplate struct { OrganizationID func() int32 Bloodedfem func() null.Val[int16] Creationdate func() null.Val[int64] Creator func() null.Val[string] Eggs func() null.Val[int16] Editdate func() null.Val[int64] Editor func() null.Val[string] Females func() null.Val[int64] Gravidfem func() null.Val[int16] Globalid func() string Larvae func() null.Val[int16] Males func() null.Val[int16] Objectid func() int32 Poolstogen func() null.Val[int16] Processed func() null.Val[int16] Pupae func() null.Val[int16] Species func() null.Val[string] Total func() null.Val[int64] TrapdataID func() null.Val[string] Unknown func() null.Val[int16] CreatedDate func() null.Val[int64] CreatedUser func() null.Val[string] GeometryX func() null.Val[float64] GeometryY func() null.Val[float64] LastEditedDate func() null.Val[int64] LastEditedUser func() null.Val[string] Globalzscore func() null.Val[float64] H3R7 func() null.Val[string] H3R8 func() null.Val[string] R7score func() null.Val[float64] R8score func() null.Val[float64] Yearweek func() null.Val[int64] Updated func() time.Time r fsSpeciesabundanceR f *Factory alreadyPersisted bool } type fsSpeciesabundanceR struct { Organization *fsSpeciesabundanceROrganizationR } type fsSpeciesabundanceROrganizationR struct { o *OrganizationTemplate } // Apply mods to the FSSpeciesabundanceTemplate func (o *FSSpeciesabundanceTemplate) Apply(ctx context.Context, mods ...FSSpeciesabundanceMod) { for _, mod := range mods { mod.Apply(ctx, o) } } // setModelRels creates and sets the relationships on *models.FSSpeciesabundance // according to the relationships in the template. Nothing is inserted into the db func (t FSSpeciesabundanceTemplate) setModelRels(o *models.FSSpeciesabundance) { if t.r.Organization != nil { rel := t.r.Organization.o.Build() rel.R.FSSpeciesabundances = append(rel.R.FSSpeciesabundances, o) o.OrganizationID = rel.ID // h2 o.R.Organization = rel } } // BuildSetter returns an *models.FSSpeciesabundanceSetter // this does nothing with the relationship templates func (o FSSpeciesabundanceTemplate) BuildSetter() *models.FSSpeciesabundanceSetter { m := &models.FSSpeciesabundanceSetter{} if o.OrganizationID != nil { val := o.OrganizationID() m.OrganizationID = omit.From(val) } if o.Bloodedfem != nil { val := o.Bloodedfem() m.Bloodedfem = omitnull.FromNull(val) } if o.Creationdate != nil { val := o.Creationdate() m.Creationdate = omitnull.FromNull(val) } if o.Creator != nil { val := o.Creator() m.Creator = omitnull.FromNull(val) } if o.Eggs != nil { val := o.Eggs() m.Eggs = omitnull.FromNull(val) } if o.Editdate != nil { val := o.Editdate() m.Editdate = omitnull.FromNull(val) } if o.Editor != nil { val := o.Editor() m.Editor = omitnull.FromNull(val) } if o.Females != nil { val := o.Females() m.Females = omitnull.FromNull(val) } if o.Gravidfem != nil { val := o.Gravidfem() m.Gravidfem = omitnull.FromNull(val) } if o.Globalid != nil { val := o.Globalid() m.Globalid = omit.From(val) } if o.Larvae != nil { val := o.Larvae() m.Larvae = omitnull.FromNull(val) } if o.Males != nil { val := o.Males() m.Males = omitnull.FromNull(val) } if o.Objectid != nil { val := o.Objectid() m.Objectid = omit.From(val) } if o.Poolstogen != nil { val := o.Poolstogen() m.Poolstogen = omitnull.FromNull(val) } if o.Processed != nil { val := o.Processed() m.Processed = omitnull.FromNull(val) } if o.Pupae != nil { val := o.Pupae() m.Pupae = omitnull.FromNull(val) } if o.Species != nil { val := o.Species() m.Species = omitnull.FromNull(val) } if o.Total != nil { val := o.Total() m.Total = omitnull.FromNull(val) } if o.TrapdataID != nil { val := o.TrapdataID() m.TrapdataID = omitnull.FromNull(val) } if o.Unknown != nil { val := o.Unknown() m.Unknown = omitnull.FromNull(val) } if o.CreatedDate != nil { val := o.CreatedDate() m.CreatedDate = omitnull.FromNull(val) } if o.CreatedUser != nil { val := o.CreatedUser() m.CreatedUser = omitnull.FromNull(val) } if o.GeometryX != nil { val := o.GeometryX() m.GeometryX = omitnull.FromNull(val) } if o.GeometryY != nil { val := o.GeometryY() m.GeometryY = omitnull.FromNull(val) } if o.LastEditedDate != nil { val := o.LastEditedDate() m.LastEditedDate = omitnull.FromNull(val) } if o.LastEditedUser != nil { val := o.LastEditedUser() m.LastEditedUser = omitnull.FromNull(val) } if o.Globalzscore != nil { val := o.Globalzscore() m.Globalzscore = omitnull.FromNull(val) } if o.H3R7 != nil { val := o.H3R7() m.H3R7 = omitnull.FromNull(val) } if o.H3R8 != nil { val := o.H3R8() m.H3R8 = omitnull.FromNull(val) } if o.R7score != nil { val := o.R7score() m.R7score = omitnull.FromNull(val) } if o.R8score != nil { val := o.R8score() m.R8score = omitnull.FromNull(val) } if o.Yearweek != nil { val := o.Yearweek() m.Yearweek = omitnull.FromNull(val) } if o.Updated != nil { val := o.Updated() m.Updated = omit.From(val) } return m } // BuildManySetter returns an []*models.FSSpeciesabundanceSetter // this does nothing with the relationship templates func (o FSSpeciesabundanceTemplate) BuildManySetter(number int) []*models.FSSpeciesabundanceSetter { m := make([]*models.FSSpeciesabundanceSetter, number) for i := range m { m[i] = o.BuildSetter() } return m } // Build returns an *models.FSSpeciesabundance // Related objects are also created and placed in the .R field // NOTE: Objects are not inserted into the database. Use FSSpeciesabundanceTemplate.Create func (o FSSpeciesabundanceTemplate) Build() *models.FSSpeciesabundance { m := &models.FSSpeciesabundance{} if o.OrganizationID != nil { m.OrganizationID = o.OrganizationID() } if o.Bloodedfem != nil { m.Bloodedfem = o.Bloodedfem() } if o.Creationdate != nil { m.Creationdate = o.Creationdate() } if o.Creator != nil { m.Creator = o.Creator() } if o.Eggs != nil { m.Eggs = o.Eggs() } if o.Editdate != nil { m.Editdate = o.Editdate() } if o.Editor != nil { m.Editor = o.Editor() } if o.Females != nil { m.Females = o.Females() } if o.Gravidfem != nil { m.Gravidfem = o.Gravidfem() } if o.Globalid != nil { m.Globalid = o.Globalid() } if o.Larvae != nil { m.Larvae = o.Larvae() } if o.Males != nil { m.Males = o.Males() } if o.Objectid != nil { m.Objectid = o.Objectid() } if o.Poolstogen != nil { m.Poolstogen = o.Poolstogen() } if o.Processed != nil { m.Processed = o.Processed() } if o.Pupae != nil { m.Pupae = o.Pupae() } if o.Species != nil { m.Species = o.Species() } if o.Total != nil { m.Total = o.Total() } if o.TrapdataID != nil { m.TrapdataID = o.TrapdataID() } if o.Unknown != nil { m.Unknown = o.Unknown() } if o.CreatedDate != nil { m.CreatedDate = o.CreatedDate() } if o.CreatedUser != nil { m.CreatedUser = o.CreatedUser() } if o.GeometryX != nil { m.GeometryX = o.GeometryX() } if o.GeometryY != nil { m.GeometryY = o.GeometryY() } if o.LastEditedDate != nil { m.LastEditedDate = o.LastEditedDate() } if o.LastEditedUser != nil { m.LastEditedUser = o.LastEditedUser() } if o.Globalzscore != nil { m.Globalzscore = o.Globalzscore() } if o.H3R7 != nil { m.H3R7 = o.H3R7() } if o.H3R8 != nil { m.H3R8 = o.H3R8() } if o.R7score != nil { m.R7score = o.R7score() } if o.R8score != nil { m.R8score = o.R8score() } if o.Yearweek != nil { m.Yearweek = o.Yearweek() } if o.Updated != nil { m.Updated = o.Updated() } o.setModelRels(m) return m } // BuildMany returns an models.FSSpeciesabundanceSlice // Related objects are also created and placed in the .R field // NOTE: Objects are not inserted into the database. Use FSSpeciesabundanceTemplate.CreateMany func (o FSSpeciesabundanceTemplate) BuildMany(number int) models.FSSpeciesabundanceSlice { m := make(models.FSSpeciesabundanceSlice, number) for i := range m { m[i] = o.Build() } return m } func ensureCreatableFSSpeciesabundance(m *models.FSSpeciesabundanceSetter) { if !(m.OrganizationID.IsValue()) { val := random_int32(nil) m.OrganizationID = omit.From(val) } if !(m.Globalid.IsValue()) { val := random_string(nil) m.Globalid = omit.From(val) } if !(m.Objectid.IsValue()) { val := random_int32(nil) m.Objectid = omit.From(val) } } // insertOptRels creates and inserts any optional the relationships on *models.FSSpeciesabundance // according to the relationships in the template. // any required relationship should have already exist on the model func (o *FSSpeciesabundanceTemplate) insertOptRels(ctx context.Context, exec bob.Executor, m *models.FSSpeciesabundance) error { var err error return err } // Create builds a fsSpeciesabundance and inserts it into the database // Relations objects are also inserted and placed in the .R field func (o *FSSpeciesabundanceTemplate) Create(ctx context.Context, exec bob.Executor) (*models.FSSpeciesabundance, error) { var err error opt := o.BuildSetter() ensureCreatableFSSpeciesabundance(opt) if o.r.Organization == nil { FSSpeciesabundanceMods.WithNewOrganization().Apply(ctx, o) } var rel0 *models.Organization if o.r.Organization.o.alreadyPersisted { rel0 = o.r.Organization.o.Build() } else { rel0, err = o.r.Organization.o.Create(ctx, exec) if err != nil { return nil, err } } opt.OrganizationID = omit.From(rel0.ID) m, err := models.FSSpeciesabundances.Insert(opt).One(ctx, exec) if err != nil { return nil, err } m.R.Organization = rel0 if err := o.insertOptRels(ctx, exec, m); err != nil { return nil, err } return m, err } // MustCreate builds a fsSpeciesabundance and inserts it into the database // Relations objects are also inserted and placed in the .R field // panics if an error occurs func (o *FSSpeciesabundanceTemplate) MustCreate(ctx context.Context, exec bob.Executor) *models.FSSpeciesabundance { m, err := o.Create(ctx, exec) if err != nil { panic(err) } return m } // CreateOrFail builds a fsSpeciesabundance and inserts it into the database // Relations objects are also inserted and placed in the .R field // It calls `tb.Fatal(err)` on the test/benchmark if an error occurs func (o *FSSpeciesabundanceTemplate) CreateOrFail(ctx context.Context, tb testing.TB, exec bob.Executor) *models.FSSpeciesabundance { tb.Helper() m, err := o.Create(ctx, exec) if err != nil { tb.Fatal(err) return nil } return m } // CreateMany builds multiple fsSpeciesabundances and inserts them into the database // Relations objects are also inserted and placed in the .R field func (o FSSpeciesabundanceTemplate) CreateMany(ctx context.Context, exec bob.Executor, number int) (models.FSSpeciesabundanceSlice, error) { var err error m := make(models.FSSpeciesabundanceSlice, number) for i := range m { m[i], err = o.Create(ctx, exec) if err != nil { return nil, err } } return m, nil } // MustCreateMany builds multiple fsSpeciesabundances and inserts them into the database // Relations objects are also inserted and placed in the .R field // panics if an error occurs func (o FSSpeciesabundanceTemplate) MustCreateMany(ctx context.Context, exec bob.Executor, number int) models.FSSpeciesabundanceSlice { m, err := o.CreateMany(ctx, exec, number) if err != nil { panic(err) } return m } // CreateManyOrFail builds multiple fsSpeciesabundances and inserts them into the database // Relations objects are also inserted and placed in the .R field // It calls `tb.Fatal(err)` on the test/benchmark if an error occurs func (o FSSpeciesabundanceTemplate) CreateManyOrFail(ctx context.Context, tb testing.TB, exec bob.Executor, number int) models.FSSpeciesabundanceSlice { tb.Helper() m, err := o.CreateMany(ctx, exec, number) if err != nil { tb.Fatal(err) return nil } return m } // FSSpeciesabundance has methods that act as mods for the FSSpeciesabundanceTemplate var FSSpeciesabundanceMods fsSpeciesabundanceMods type fsSpeciesabundanceMods struct{} func (m fsSpeciesabundanceMods) RandomizeAllColumns(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModSlice{ FSSpeciesabundanceMods.RandomOrganizationID(f), FSSpeciesabundanceMods.RandomBloodedfem(f), FSSpeciesabundanceMods.RandomCreationdate(f), FSSpeciesabundanceMods.RandomCreator(f), FSSpeciesabundanceMods.RandomEggs(f), FSSpeciesabundanceMods.RandomEditdate(f), FSSpeciesabundanceMods.RandomEditor(f), FSSpeciesabundanceMods.RandomFemales(f), FSSpeciesabundanceMods.RandomGravidfem(f), FSSpeciesabundanceMods.RandomGlobalid(f), FSSpeciesabundanceMods.RandomLarvae(f), FSSpeciesabundanceMods.RandomMales(f), FSSpeciesabundanceMods.RandomObjectid(f), FSSpeciesabundanceMods.RandomPoolstogen(f), FSSpeciesabundanceMods.RandomProcessed(f), FSSpeciesabundanceMods.RandomPupae(f), FSSpeciesabundanceMods.RandomSpecies(f), FSSpeciesabundanceMods.RandomTotal(f), FSSpeciesabundanceMods.RandomTrapdataID(f), FSSpeciesabundanceMods.RandomUnknown(f), FSSpeciesabundanceMods.RandomCreatedDate(f), FSSpeciesabundanceMods.RandomCreatedUser(f), FSSpeciesabundanceMods.RandomGeometryX(f), FSSpeciesabundanceMods.RandomGeometryY(f), FSSpeciesabundanceMods.RandomLastEditedDate(f), FSSpeciesabundanceMods.RandomLastEditedUser(f), FSSpeciesabundanceMods.RandomGlobalzscore(f), FSSpeciesabundanceMods.RandomH3R7(f), FSSpeciesabundanceMods.RandomH3R8(f), FSSpeciesabundanceMods.RandomR7score(f), FSSpeciesabundanceMods.RandomR8score(f), FSSpeciesabundanceMods.RandomYearweek(f), FSSpeciesabundanceMods.RandomUpdated(f), } } // Set the model columns to this value func (m fsSpeciesabundanceMods) OrganizationID(val int32) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.OrganizationID = func() int32 { return val } }) } // Set the Column from the function func (m fsSpeciesabundanceMods) OrganizationIDFunc(f func() int32) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.OrganizationID = f }) } // Clear any values for the column func (m fsSpeciesabundanceMods) UnsetOrganizationID() FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.OrganizationID = nil }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used func (m fsSpeciesabundanceMods) RandomOrganizationID(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.OrganizationID = func() int32 { return random_int32(f) } }) } // Set the model columns to this value func (m fsSpeciesabundanceMods) Bloodedfem(val null.Val[int16]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Bloodedfem = func() null.Val[int16] { return val } }) } // Set the Column from the function func (m fsSpeciesabundanceMods) BloodedfemFunc(f func() null.Val[int16]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Bloodedfem = f }) } // Clear any values for the column func (m fsSpeciesabundanceMods) UnsetBloodedfem() FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Bloodedfem = nil }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is sometimes null func (m fsSpeciesabundanceMods) RandomBloodedfem(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Bloodedfem = func() null.Val[int16] { if f == nil { f = &defaultFaker } val := random_int16(f) return null.From(val) } }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is never null func (m fsSpeciesabundanceMods) RandomBloodedfemNotNull(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Bloodedfem = func() null.Val[int16] { if f == nil { f = &defaultFaker } val := random_int16(f) return null.From(val) } }) } // Set the model columns to this value func (m fsSpeciesabundanceMods) Creationdate(val null.Val[int64]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Creationdate = func() null.Val[int64] { return val } }) } // Set the Column from the function func (m fsSpeciesabundanceMods) CreationdateFunc(f func() null.Val[int64]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Creationdate = f }) } // Clear any values for the column func (m fsSpeciesabundanceMods) UnsetCreationdate() FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Creationdate = nil }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is sometimes null func (m fsSpeciesabundanceMods) RandomCreationdate(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Creationdate = func() null.Val[int64] { if f == nil { f = &defaultFaker } val := random_int64(f) return null.From(val) } }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is never null func (m fsSpeciesabundanceMods) RandomCreationdateNotNull(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Creationdate = func() null.Val[int64] { if f == nil { f = &defaultFaker } val := random_int64(f) return null.From(val) } }) } // Set the model columns to this value func (m fsSpeciesabundanceMods) Creator(val null.Val[string]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Creator = func() null.Val[string] { return val } }) } // Set the Column from the function func (m fsSpeciesabundanceMods) CreatorFunc(f func() null.Val[string]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Creator = f }) } // Clear any values for the column func (m fsSpeciesabundanceMods) UnsetCreator() FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Creator = nil }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is sometimes null func (m fsSpeciesabundanceMods) RandomCreator(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Creator = func() null.Val[string] { if f == nil { f = &defaultFaker } val := random_string(f) return null.From(val) } }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is never null func (m fsSpeciesabundanceMods) RandomCreatorNotNull(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Creator = func() null.Val[string] { if f == nil { f = &defaultFaker } val := random_string(f) return null.From(val) } }) } // Set the model columns to this value func (m fsSpeciesabundanceMods) Eggs(val null.Val[int16]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Eggs = func() null.Val[int16] { return val } }) } // Set the Column from the function func (m fsSpeciesabundanceMods) EggsFunc(f func() null.Val[int16]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Eggs = f }) } // Clear any values for the column func (m fsSpeciesabundanceMods) UnsetEggs() FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Eggs = nil }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is sometimes null func (m fsSpeciesabundanceMods) RandomEggs(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Eggs = func() null.Val[int16] { if f == nil { f = &defaultFaker } val := random_int16(f) return null.From(val) } }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is never null func (m fsSpeciesabundanceMods) RandomEggsNotNull(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Eggs = func() null.Val[int16] { if f == nil { f = &defaultFaker } val := random_int16(f) return null.From(val) } }) } // Set the model columns to this value func (m fsSpeciesabundanceMods) Editdate(val null.Val[int64]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Editdate = func() null.Val[int64] { return val } }) } // Set the Column from the function func (m fsSpeciesabundanceMods) EditdateFunc(f func() null.Val[int64]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Editdate = f }) } // Clear any values for the column func (m fsSpeciesabundanceMods) UnsetEditdate() FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Editdate = nil }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is sometimes null func (m fsSpeciesabundanceMods) RandomEditdate(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Editdate = func() null.Val[int64] { if f == nil { f = &defaultFaker } val := random_int64(f) return null.From(val) } }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is never null func (m fsSpeciesabundanceMods) RandomEditdateNotNull(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Editdate = func() null.Val[int64] { if f == nil { f = &defaultFaker } val := random_int64(f) return null.From(val) } }) } // Set the model columns to this value func (m fsSpeciesabundanceMods) Editor(val null.Val[string]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Editor = func() null.Val[string] { return val } }) } // Set the Column from the function func (m fsSpeciesabundanceMods) EditorFunc(f func() null.Val[string]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Editor = f }) } // Clear any values for the column func (m fsSpeciesabundanceMods) UnsetEditor() FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Editor = nil }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is sometimes null func (m fsSpeciesabundanceMods) RandomEditor(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Editor = func() null.Val[string] { if f == nil { f = &defaultFaker } val := random_string(f) return null.From(val) } }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is never null func (m fsSpeciesabundanceMods) RandomEditorNotNull(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Editor = func() null.Val[string] { if f == nil { f = &defaultFaker } val := random_string(f) return null.From(val) } }) } // Set the model columns to this value func (m fsSpeciesabundanceMods) Females(val null.Val[int64]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Females = func() null.Val[int64] { return val } }) } // Set the Column from the function func (m fsSpeciesabundanceMods) FemalesFunc(f func() null.Val[int64]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Females = f }) } // Clear any values for the column func (m fsSpeciesabundanceMods) UnsetFemales() FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Females = nil }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is sometimes null func (m fsSpeciesabundanceMods) RandomFemales(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Females = func() null.Val[int64] { if f == nil { f = &defaultFaker } val := random_int64(f) return null.From(val) } }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is never null func (m fsSpeciesabundanceMods) RandomFemalesNotNull(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Females = func() null.Val[int64] { if f == nil { f = &defaultFaker } val := random_int64(f) return null.From(val) } }) } // Set the model columns to this value func (m fsSpeciesabundanceMods) Gravidfem(val null.Val[int16]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Gravidfem = func() null.Val[int16] { return val } }) } // Set the Column from the function func (m fsSpeciesabundanceMods) GravidfemFunc(f func() null.Val[int16]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Gravidfem = f }) } // Clear any values for the column func (m fsSpeciesabundanceMods) UnsetGravidfem() FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Gravidfem = nil }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is sometimes null func (m fsSpeciesabundanceMods) RandomGravidfem(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Gravidfem = func() null.Val[int16] { if f == nil { f = &defaultFaker } val := random_int16(f) return null.From(val) } }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is never null func (m fsSpeciesabundanceMods) RandomGravidfemNotNull(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Gravidfem = func() null.Val[int16] { if f == nil { f = &defaultFaker } val := random_int16(f) return null.From(val) } }) } // Set the model columns to this value func (m fsSpeciesabundanceMods) Globalid(val string) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Globalid = func() string { return val } }) } // Set the Column from the function func (m fsSpeciesabundanceMods) GlobalidFunc(f func() string) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Globalid = f }) } // Clear any values for the column func (m fsSpeciesabundanceMods) UnsetGlobalid() FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Globalid = nil }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used func (m fsSpeciesabundanceMods) RandomGlobalid(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Globalid = func() string { return random_string(f) } }) } // Set the model columns to this value func (m fsSpeciesabundanceMods) Larvae(val null.Val[int16]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Larvae = func() null.Val[int16] { return val } }) } // Set the Column from the function func (m fsSpeciesabundanceMods) LarvaeFunc(f func() null.Val[int16]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Larvae = f }) } // Clear any values for the column func (m fsSpeciesabundanceMods) UnsetLarvae() FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Larvae = nil }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is sometimes null func (m fsSpeciesabundanceMods) RandomLarvae(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Larvae = func() null.Val[int16] { if f == nil { f = &defaultFaker } val := random_int16(f) return null.From(val) } }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is never null func (m fsSpeciesabundanceMods) RandomLarvaeNotNull(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Larvae = func() null.Val[int16] { if f == nil { f = &defaultFaker } val := random_int16(f) return null.From(val) } }) } // Set the model columns to this value func (m fsSpeciesabundanceMods) Males(val null.Val[int16]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Males = func() null.Val[int16] { return val } }) } // Set the Column from the function func (m fsSpeciesabundanceMods) MalesFunc(f func() null.Val[int16]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Males = f }) } // Clear any values for the column func (m fsSpeciesabundanceMods) UnsetMales() FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Males = nil }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is sometimes null func (m fsSpeciesabundanceMods) RandomMales(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Males = func() null.Val[int16] { if f == nil { f = &defaultFaker } val := random_int16(f) return null.From(val) } }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is never null func (m fsSpeciesabundanceMods) RandomMalesNotNull(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Males = func() null.Val[int16] { if f == nil { f = &defaultFaker } val := random_int16(f) return null.From(val) } }) } // Set the model columns to this value func (m fsSpeciesabundanceMods) Objectid(val int32) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Objectid = func() int32 { return val } }) } // Set the Column from the function func (m fsSpeciesabundanceMods) ObjectidFunc(f func() int32) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Objectid = f }) } // Clear any values for the column func (m fsSpeciesabundanceMods) UnsetObjectid() FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Objectid = nil }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used func (m fsSpeciesabundanceMods) RandomObjectid(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Objectid = func() int32 { return random_int32(f) } }) } // Set the model columns to this value func (m fsSpeciesabundanceMods) Poolstogen(val null.Val[int16]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Poolstogen = func() null.Val[int16] { return val } }) } // Set the Column from the function func (m fsSpeciesabundanceMods) PoolstogenFunc(f func() null.Val[int16]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Poolstogen = f }) } // Clear any values for the column func (m fsSpeciesabundanceMods) UnsetPoolstogen() FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Poolstogen = nil }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is sometimes null func (m fsSpeciesabundanceMods) RandomPoolstogen(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Poolstogen = func() null.Val[int16] { if f == nil { f = &defaultFaker } val := random_int16(f) return null.From(val) } }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is never null func (m fsSpeciesabundanceMods) RandomPoolstogenNotNull(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Poolstogen = func() null.Val[int16] { if f == nil { f = &defaultFaker } val := random_int16(f) return null.From(val) } }) } // Set the model columns to this value func (m fsSpeciesabundanceMods) Processed(val null.Val[int16]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Processed = func() null.Val[int16] { return val } }) } // Set the Column from the function func (m fsSpeciesabundanceMods) ProcessedFunc(f func() null.Val[int16]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Processed = f }) } // Clear any values for the column func (m fsSpeciesabundanceMods) UnsetProcessed() FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Processed = nil }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is sometimes null func (m fsSpeciesabundanceMods) RandomProcessed(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Processed = func() null.Val[int16] { if f == nil { f = &defaultFaker } val := random_int16(f) return null.From(val) } }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is never null func (m fsSpeciesabundanceMods) RandomProcessedNotNull(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Processed = func() null.Val[int16] { if f == nil { f = &defaultFaker } val := random_int16(f) return null.From(val) } }) } // Set the model columns to this value func (m fsSpeciesabundanceMods) Pupae(val null.Val[int16]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Pupae = func() null.Val[int16] { return val } }) } // Set the Column from the function func (m fsSpeciesabundanceMods) PupaeFunc(f func() null.Val[int16]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Pupae = f }) } // Clear any values for the column func (m fsSpeciesabundanceMods) UnsetPupae() FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Pupae = nil }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is sometimes null func (m fsSpeciesabundanceMods) RandomPupae(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Pupae = func() null.Val[int16] { if f == nil { f = &defaultFaker } val := random_int16(f) return null.From(val) } }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is never null func (m fsSpeciesabundanceMods) RandomPupaeNotNull(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Pupae = func() null.Val[int16] { if f == nil { f = &defaultFaker } val := random_int16(f) return null.From(val) } }) } // Set the model columns to this value func (m fsSpeciesabundanceMods) Species(val null.Val[string]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Species = func() null.Val[string] { return val } }) } // Set the Column from the function func (m fsSpeciesabundanceMods) SpeciesFunc(f func() null.Val[string]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Species = f }) } // Clear any values for the column func (m fsSpeciesabundanceMods) UnsetSpecies() FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Species = nil }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is sometimes null func (m fsSpeciesabundanceMods) RandomSpecies(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Species = func() null.Val[string] { if f == nil { f = &defaultFaker } val := random_string(f) return null.From(val) } }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is never null func (m fsSpeciesabundanceMods) RandomSpeciesNotNull(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Species = func() null.Val[string] { if f == nil { f = &defaultFaker } val := random_string(f) return null.From(val) } }) } // Set the model columns to this value func (m fsSpeciesabundanceMods) Total(val null.Val[int64]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Total = func() null.Val[int64] { return val } }) } // Set the Column from the function func (m fsSpeciesabundanceMods) TotalFunc(f func() null.Val[int64]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Total = f }) } // Clear any values for the column func (m fsSpeciesabundanceMods) UnsetTotal() FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Total = nil }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is sometimes null func (m fsSpeciesabundanceMods) RandomTotal(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Total = func() null.Val[int64] { if f == nil { f = &defaultFaker } val := random_int64(f) return null.From(val) } }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is never null func (m fsSpeciesabundanceMods) RandomTotalNotNull(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Total = func() null.Val[int64] { if f == nil { f = &defaultFaker } val := random_int64(f) return null.From(val) } }) } // Set the model columns to this value func (m fsSpeciesabundanceMods) TrapdataID(val null.Val[string]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.TrapdataID = func() null.Val[string] { return val } }) } // Set the Column from the function func (m fsSpeciesabundanceMods) TrapdataIDFunc(f func() null.Val[string]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.TrapdataID = f }) } // Clear any values for the column func (m fsSpeciesabundanceMods) UnsetTrapdataID() FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.TrapdataID = nil }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is sometimes null func (m fsSpeciesabundanceMods) RandomTrapdataID(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.TrapdataID = func() null.Val[string] { if f == nil { f = &defaultFaker } val := random_string(f) return null.From(val) } }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is never null func (m fsSpeciesabundanceMods) RandomTrapdataIDNotNull(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.TrapdataID = func() null.Val[string] { if f == nil { f = &defaultFaker } val := random_string(f) return null.From(val) } }) } // Set the model columns to this value func (m fsSpeciesabundanceMods) Unknown(val null.Val[int16]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Unknown = func() null.Val[int16] { return val } }) } // Set the Column from the function func (m fsSpeciesabundanceMods) UnknownFunc(f func() null.Val[int16]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Unknown = f }) } // Clear any values for the column func (m fsSpeciesabundanceMods) UnsetUnknown() FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Unknown = nil }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is sometimes null func (m fsSpeciesabundanceMods) RandomUnknown(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Unknown = func() null.Val[int16] { if f == nil { f = &defaultFaker } val := random_int16(f) return null.From(val) } }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is never null func (m fsSpeciesabundanceMods) RandomUnknownNotNull(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Unknown = func() null.Val[int16] { if f == nil { f = &defaultFaker } val := random_int16(f) return null.From(val) } }) } // Set the model columns to this value func (m fsSpeciesabundanceMods) CreatedDate(val null.Val[int64]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.CreatedDate = func() null.Val[int64] { return val } }) } // Set the Column from the function func (m fsSpeciesabundanceMods) CreatedDateFunc(f func() null.Val[int64]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.CreatedDate = f }) } // Clear any values for the column func (m fsSpeciesabundanceMods) UnsetCreatedDate() FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.CreatedDate = nil }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is sometimes null func (m fsSpeciesabundanceMods) RandomCreatedDate(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.CreatedDate = func() null.Val[int64] { if f == nil { f = &defaultFaker } val := random_int64(f) return null.From(val) } }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is never null func (m fsSpeciesabundanceMods) RandomCreatedDateNotNull(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.CreatedDate = func() null.Val[int64] { if f == nil { f = &defaultFaker } val := random_int64(f) return null.From(val) } }) } // Set the model columns to this value func (m fsSpeciesabundanceMods) CreatedUser(val null.Val[string]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.CreatedUser = func() null.Val[string] { return val } }) } // Set the Column from the function func (m fsSpeciesabundanceMods) CreatedUserFunc(f func() null.Val[string]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.CreatedUser = f }) } // Clear any values for the column func (m fsSpeciesabundanceMods) UnsetCreatedUser() FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.CreatedUser = nil }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is sometimes null func (m fsSpeciesabundanceMods) RandomCreatedUser(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.CreatedUser = func() null.Val[string] { if f == nil { f = &defaultFaker } val := random_string(f) return null.From(val) } }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is never null func (m fsSpeciesabundanceMods) RandomCreatedUserNotNull(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.CreatedUser = func() null.Val[string] { if f == nil { f = &defaultFaker } val := random_string(f) return null.From(val) } }) } // Set the model columns to this value func (m fsSpeciesabundanceMods) GeometryX(val null.Val[float64]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.GeometryX = func() null.Val[float64] { return val } }) } // Set the Column from the function func (m fsSpeciesabundanceMods) GeometryXFunc(f func() null.Val[float64]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.GeometryX = f }) } // Clear any values for the column func (m fsSpeciesabundanceMods) UnsetGeometryX() FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.GeometryX = nil }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is sometimes null func (m fsSpeciesabundanceMods) RandomGeometryX(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.GeometryX = func() null.Val[float64] { if f == nil { f = &defaultFaker } val := random_float64(f) return null.From(val) } }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is never null func (m fsSpeciesabundanceMods) RandomGeometryXNotNull(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.GeometryX = func() null.Val[float64] { if f == nil { f = &defaultFaker } val := random_float64(f) return null.From(val) } }) } // Set the model columns to this value func (m fsSpeciesabundanceMods) GeometryY(val null.Val[float64]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.GeometryY = func() null.Val[float64] { return val } }) } // Set the Column from the function func (m fsSpeciesabundanceMods) GeometryYFunc(f func() null.Val[float64]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.GeometryY = f }) } // Clear any values for the column func (m fsSpeciesabundanceMods) UnsetGeometryY() FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.GeometryY = nil }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is sometimes null func (m fsSpeciesabundanceMods) RandomGeometryY(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.GeometryY = func() null.Val[float64] { if f == nil { f = &defaultFaker } val := random_float64(f) return null.From(val) } }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is never null func (m fsSpeciesabundanceMods) RandomGeometryYNotNull(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.GeometryY = func() null.Val[float64] { if f == nil { f = &defaultFaker } val := random_float64(f) return null.From(val) } }) } // Set the model columns to this value func (m fsSpeciesabundanceMods) LastEditedDate(val null.Val[int64]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.LastEditedDate = func() null.Val[int64] { return val } }) } // Set the Column from the function func (m fsSpeciesabundanceMods) LastEditedDateFunc(f func() null.Val[int64]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.LastEditedDate = f }) } // Clear any values for the column func (m fsSpeciesabundanceMods) UnsetLastEditedDate() FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.LastEditedDate = nil }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is sometimes null func (m fsSpeciesabundanceMods) RandomLastEditedDate(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.LastEditedDate = func() null.Val[int64] { if f == nil { f = &defaultFaker } val := random_int64(f) return null.From(val) } }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is never null func (m fsSpeciesabundanceMods) RandomLastEditedDateNotNull(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.LastEditedDate = func() null.Val[int64] { if f == nil { f = &defaultFaker } val := random_int64(f) return null.From(val) } }) } // Set the model columns to this value func (m fsSpeciesabundanceMods) LastEditedUser(val null.Val[string]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.LastEditedUser = func() null.Val[string] { return val } }) } // Set the Column from the function func (m fsSpeciesabundanceMods) LastEditedUserFunc(f func() null.Val[string]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.LastEditedUser = f }) } // Clear any values for the column func (m fsSpeciesabundanceMods) UnsetLastEditedUser() FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.LastEditedUser = nil }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is sometimes null func (m fsSpeciesabundanceMods) RandomLastEditedUser(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.LastEditedUser = func() null.Val[string] { if f == nil { f = &defaultFaker } val := random_string(f) return null.From(val) } }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is never null func (m fsSpeciesabundanceMods) RandomLastEditedUserNotNull(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.LastEditedUser = func() null.Val[string] { if f == nil { f = &defaultFaker } val := random_string(f) return null.From(val) } }) } // Set the model columns to this value func (m fsSpeciesabundanceMods) Globalzscore(val null.Val[float64]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Globalzscore = func() null.Val[float64] { return val } }) } // Set the Column from the function func (m fsSpeciesabundanceMods) GlobalzscoreFunc(f func() null.Val[float64]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Globalzscore = f }) } // Clear any values for the column func (m fsSpeciesabundanceMods) UnsetGlobalzscore() FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Globalzscore = nil }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is sometimes null func (m fsSpeciesabundanceMods) RandomGlobalzscore(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Globalzscore = func() null.Val[float64] { if f == nil { f = &defaultFaker } val := random_float64(f) return null.From(val) } }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is never null func (m fsSpeciesabundanceMods) RandomGlobalzscoreNotNull(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Globalzscore = func() null.Val[float64] { if f == nil { f = &defaultFaker } val := random_float64(f) return null.From(val) } }) } // Set the model columns to this value func (m fsSpeciesabundanceMods) H3R7(val null.Val[string]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.H3R7 = func() null.Val[string] { return val } }) } // Set the Column from the function func (m fsSpeciesabundanceMods) H3R7Func(f func() null.Val[string]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.H3R7 = f }) } // Clear any values for the column func (m fsSpeciesabundanceMods) UnsetH3R7() FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.H3R7 = nil }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is sometimes null func (m fsSpeciesabundanceMods) RandomH3R7(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.H3R7 = func() null.Val[string] { if f == nil { f = &defaultFaker } val := random_string(f) return null.From(val) } }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is never null func (m fsSpeciesabundanceMods) RandomH3R7NotNull(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.H3R7 = func() null.Val[string] { if f == nil { f = &defaultFaker } val := random_string(f) return null.From(val) } }) } // Set the model columns to this value func (m fsSpeciesabundanceMods) H3R8(val null.Val[string]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.H3R8 = func() null.Val[string] { return val } }) } // Set the Column from the function func (m fsSpeciesabundanceMods) H3R8Func(f func() null.Val[string]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.H3R8 = f }) } // Clear any values for the column func (m fsSpeciesabundanceMods) UnsetH3R8() FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.H3R8 = nil }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is sometimes null func (m fsSpeciesabundanceMods) RandomH3R8(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.H3R8 = func() null.Val[string] { if f == nil { f = &defaultFaker } val := random_string(f) return null.From(val) } }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is never null func (m fsSpeciesabundanceMods) RandomH3R8NotNull(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.H3R8 = func() null.Val[string] { if f == nil { f = &defaultFaker } val := random_string(f) return null.From(val) } }) } // Set the model columns to this value func (m fsSpeciesabundanceMods) R7score(val null.Val[float64]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.R7score = func() null.Val[float64] { return val } }) } // Set the Column from the function func (m fsSpeciesabundanceMods) R7scoreFunc(f func() null.Val[float64]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.R7score = f }) } // Clear any values for the column func (m fsSpeciesabundanceMods) UnsetR7score() FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.R7score = nil }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is sometimes null func (m fsSpeciesabundanceMods) RandomR7score(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.R7score = func() null.Val[float64] { if f == nil { f = &defaultFaker } val := random_float64(f) return null.From(val) } }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is never null func (m fsSpeciesabundanceMods) RandomR7scoreNotNull(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.R7score = func() null.Val[float64] { if f == nil { f = &defaultFaker } val := random_float64(f) return null.From(val) } }) } // Set the model columns to this value func (m fsSpeciesabundanceMods) R8score(val null.Val[float64]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.R8score = func() null.Val[float64] { return val } }) } // Set the Column from the function func (m fsSpeciesabundanceMods) R8scoreFunc(f func() null.Val[float64]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.R8score = f }) } // Clear any values for the column func (m fsSpeciesabundanceMods) UnsetR8score() FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.R8score = nil }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is sometimes null func (m fsSpeciesabundanceMods) RandomR8score(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.R8score = func() null.Val[float64] { if f == nil { f = &defaultFaker } val := random_float64(f) return null.From(val) } }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is never null func (m fsSpeciesabundanceMods) RandomR8scoreNotNull(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.R8score = func() null.Val[float64] { if f == nil { f = &defaultFaker } val := random_float64(f) return null.From(val) } }) } // Set the model columns to this value func (m fsSpeciesabundanceMods) Yearweek(val null.Val[int64]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Yearweek = func() null.Val[int64] { return val } }) } // Set the Column from the function func (m fsSpeciesabundanceMods) YearweekFunc(f func() null.Val[int64]) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Yearweek = f }) } // Clear any values for the column func (m fsSpeciesabundanceMods) UnsetYearweek() FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Yearweek = nil }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is sometimes null func (m fsSpeciesabundanceMods) RandomYearweek(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Yearweek = func() null.Val[int64] { if f == nil { f = &defaultFaker } val := random_int64(f) return null.From(val) } }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used // The generated value is never null func (m fsSpeciesabundanceMods) RandomYearweekNotNull(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Yearweek = func() null.Val[int64] { if f == nil { f = &defaultFaker } val := random_int64(f) return null.From(val) } }) } // Set the model columns to this value func (m fsSpeciesabundanceMods) Updated(val time.Time) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Updated = func() time.Time { return val } }) } // Set the Column from the function func (m fsSpeciesabundanceMods) UpdatedFunc(f func() time.Time) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Updated = f }) } // Clear any values for the column func (m fsSpeciesabundanceMods) UnsetUpdated() FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Updated = nil }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used func (m fsSpeciesabundanceMods) RandomUpdated(f *faker.Faker) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) { o.Updated = func() time.Time { return random_time_Time(f) } }) } func (m fsSpeciesabundanceMods) WithParentsCascading() FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(ctx context.Context, o *FSSpeciesabundanceTemplate) { if isDone, _ := fsSpeciesabundanceWithParentsCascadingCtx.Value(ctx); isDone { return } ctx = fsSpeciesabundanceWithParentsCascadingCtx.WithValue(ctx, true) { related := o.f.NewOrganizationWithContext(ctx, OrganizationMods.WithParentsCascading()) m.WithOrganization(related).Apply(ctx, o) } }) } func (m fsSpeciesabundanceMods) WithOrganization(rel *OrganizationTemplate) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(ctx context.Context, o *FSSpeciesabundanceTemplate) { o.r.Organization = &fsSpeciesabundanceROrganizationR{ o: rel, } }) } func (m fsSpeciesabundanceMods) WithNewOrganization(mods ...OrganizationMod) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(ctx context.Context, o *FSSpeciesabundanceTemplate) { related := o.f.NewOrganizationWithContext(ctx, mods...) m.WithOrganization(related).Apply(ctx, o) }) } func (m fsSpeciesabundanceMods) WithExistingOrganization(em *models.Organization) FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(ctx context.Context, o *FSSpeciesabundanceTemplate) { o.r.Organization = &fsSpeciesabundanceROrganizationR{ o: o.f.FromExistingOrganization(em), } }) } func (m fsSpeciesabundanceMods) WithoutOrganization() FSSpeciesabundanceMod { return FSSpeciesabundanceModFunc(func(ctx context.Context, o *FSSpeciesabundanceTemplate) { o.r.Organization = nil }) }