// 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 HistorySamplelocationMod interface { Apply(context.Context, *HistorySamplelocationTemplate) } type HistorySamplelocationModFunc func(context.Context, *HistorySamplelocationTemplate) func (f HistorySamplelocationModFunc) Apply(ctx context.Context, n *HistorySamplelocationTemplate) { f(ctx, n) } type HistorySamplelocationModSlice []HistorySamplelocationMod func (mods HistorySamplelocationModSlice) Apply(ctx context.Context, n *HistorySamplelocationTemplate) { for _, f := range mods { f.Apply(ctx, n) } } // HistorySamplelocationTemplate is an object representing the database table. // all columns are optional and should be set by mods type HistorySamplelocationTemplate struct { OrganizationID func() int32 Accessdesc func() null.Val[string] Active func() null.Val[int16] Comments func() null.Val[string] Creationdate func() null.Val[int64] Creator func() null.Val[string] Description func() null.Val[string] Externalid func() null.Val[string] Editdate func() null.Val[int64] Editor func() null.Val[string] Gatewaysync func() null.Val[int16] Globalid func() null.Val[string] Habitat func() null.Val[string] Locationnumber func() null.Val[int64] Name func() null.Val[string] Nextactiondatescheduled func() null.Val[int64] Objectid func() int32 Priority func() null.Val[string] Usetype func() null.Val[string] Zone func() null.Val[string] Zone2 func() null.Val[string] Created func() null.Val[time.Time] 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] Version func() int32 r historySamplelocationR f *Factory alreadyPersisted bool } type historySamplelocationR struct { Organization *historySamplelocationROrganizationR } type historySamplelocationROrganizationR struct { o *OrganizationTemplate } // Apply mods to the HistorySamplelocationTemplate func (o *HistorySamplelocationTemplate) Apply(ctx context.Context, mods ...HistorySamplelocationMod) { for _, mod := range mods { mod.Apply(ctx, o) } } // setModelRels creates and sets the relationships on *models.HistorySamplelocation // according to the relationships in the template. Nothing is inserted into the db func (t HistorySamplelocationTemplate) setModelRels(o *models.HistorySamplelocation) { if t.r.Organization != nil { rel := t.r.Organization.o.Build() rel.R.HistorySamplelocations = append(rel.R.HistorySamplelocations, o) o.OrganizationID = rel.ID // h2 o.R.Organization = rel } } // BuildSetter returns an *models.HistorySamplelocationSetter // this does nothing with the relationship templates func (o HistorySamplelocationTemplate) BuildSetter() *models.HistorySamplelocationSetter { m := &models.HistorySamplelocationSetter{} if o.OrganizationID != nil { val := o.OrganizationID() m.OrganizationID = omit.From(val) } if o.Accessdesc != nil { val := o.Accessdesc() m.Accessdesc = omitnull.FromNull(val) } if o.Active != nil { val := o.Active() m.Active = omitnull.FromNull(val) } if o.Comments != nil { val := o.Comments() m.Comments = 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.Description != nil { val := o.Description() m.Description = omitnull.FromNull(val) } if o.Externalid != nil { val := o.Externalid() m.Externalid = 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.Gatewaysync != nil { val := o.Gatewaysync() m.Gatewaysync = omitnull.FromNull(val) } if o.Globalid != nil { val := o.Globalid() m.Globalid = omitnull.FromNull(val) } if o.Habitat != nil { val := o.Habitat() m.Habitat = omitnull.FromNull(val) } if o.Locationnumber != nil { val := o.Locationnumber() m.Locationnumber = omitnull.FromNull(val) } if o.Name != nil { val := o.Name() m.Name = omitnull.FromNull(val) } if o.Nextactiondatescheduled != nil { val := o.Nextactiondatescheduled() m.Nextactiondatescheduled = omitnull.FromNull(val) } if o.Objectid != nil { val := o.Objectid() m.Objectid = omit.From(val) } if o.Priority != nil { val := o.Priority() m.Priority = omitnull.FromNull(val) } if o.Usetype != nil { val := o.Usetype() m.Usetype = omitnull.FromNull(val) } if o.Zone != nil { val := o.Zone() m.Zone = omitnull.FromNull(val) } if o.Zone2 != nil { val := o.Zone2() m.Zone2 = omitnull.FromNull(val) } if o.Created != nil { val := o.Created() m.Created = 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.Version != nil { val := o.Version() m.Version = omit.From(val) } return m } // BuildManySetter returns an []*models.HistorySamplelocationSetter // this does nothing with the relationship templates func (o HistorySamplelocationTemplate) BuildManySetter(number int) []*models.HistorySamplelocationSetter { m := make([]*models.HistorySamplelocationSetter, number) for i := range m { m[i] = o.BuildSetter() } return m } // Build returns an *models.HistorySamplelocation // Related objects are also created and placed in the .R field // NOTE: Objects are not inserted into the database. Use HistorySamplelocationTemplate.Create func (o HistorySamplelocationTemplate) Build() *models.HistorySamplelocation { m := &models.HistorySamplelocation{} if o.OrganizationID != nil { m.OrganizationID = o.OrganizationID() } if o.Accessdesc != nil { m.Accessdesc = o.Accessdesc() } if o.Active != nil { m.Active = o.Active() } if o.Comments != nil { m.Comments = o.Comments() } if o.Creationdate != nil { m.Creationdate = o.Creationdate() } if o.Creator != nil { m.Creator = o.Creator() } if o.Description != nil { m.Description = o.Description() } if o.Externalid != nil { m.Externalid = o.Externalid() } if o.Editdate != nil { m.Editdate = o.Editdate() } if o.Editor != nil { m.Editor = o.Editor() } if o.Gatewaysync != nil { m.Gatewaysync = o.Gatewaysync() } if o.Globalid != nil { m.Globalid = o.Globalid() } if o.Habitat != nil { m.Habitat = o.Habitat() } if o.Locationnumber != nil { m.Locationnumber = o.Locationnumber() } if o.Name != nil { m.Name = o.Name() } if o.Nextactiondatescheduled != nil { m.Nextactiondatescheduled = o.Nextactiondatescheduled() } if o.Objectid != nil { m.Objectid = o.Objectid() } if o.Priority != nil { m.Priority = o.Priority() } if o.Usetype != nil { m.Usetype = o.Usetype() } if o.Zone != nil { m.Zone = o.Zone() } if o.Zone2 != nil { m.Zone2 = o.Zone2() } if o.Created != nil { m.Created = o.Created() } 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.Version != nil { m.Version = o.Version() } o.setModelRels(m) return m } // BuildMany returns an models.HistorySamplelocationSlice // Related objects are also created and placed in the .R field // NOTE: Objects are not inserted into the database. Use HistorySamplelocationTemplate.CreateMany func (o HistorySamplelocationTemplate) BuildMany(number int) models.HistorySamplelocationSlice { m := make(models.HistorySamplelocationSlice, number) for i := range m { m[i] = o.Build() } return m } func ensureCreatableHistorySamplelocation(m *models.HistorySamplelocationSetter) { if !(m.OrganizationID.IsValue()) { val := random_int32(nil) m.OrganizationID = omit.From(val) } if !(m.Objectid.IsValue()) { val := random_int32(nil) m.Objectid = omit.From(val) } if !(m.Version.IsValue()) { val := random_int32(nil) m.Version = omit.From(val) } } // insertOptRels creates and inserts any optional the relationships on *models.HistorySamplelocation // according to the relationships in the template. // any required relationship should have already exist on the model func (o *HistorySamplelocationTemplate) insertOptRels(ctx context.Context, exec bob.Executor, m *models.HistorySamplelocation) error { var err error return err } // Create builds a historySamplelocation and inserts it into the database // Relations objects are also inserted and placed in the .R field func (o *HistorySamplelocationTemplate) Create(ctx context.Context, exec bob.Executor) (*models.HistorySamplelocation, error) { var err error opt := o.BuildSetter() ensureCreatableHistorySamplelocation(opt) if o.r.Organization == nil { HistorySamplelocationMods.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.HistorySamplelocations.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 historySamplelocation and inserts it into the database // Relations objects are also inserted and placed in the .R field // panics if an error occurs func (o *HistorySamplelocationTemplate) MustCreate(ctx context.Context, exec bob.Executor) *models.HistorySamplelocation { m, err := o.Create(ctx, exec) if err != nil { panic(err) } return m } // CreateOrFail builds a historySamplelocation 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 *HistorySamplelocationTemplate) CreateOrFail(ctx context.Context, tb testing.TB, exec bob.Executor) *models.HistorySamplelocation { tb.Helper() m, err := o.Create(ctx, exec) if err != nil { tb.Fatal(err) return nil } return m } // CreateMany builds multiple historySamplelocations and inserts them into the database // Relations objects are also inserted and placed in the .R field func (o HistorySamplelocationTemplate) CreateMany(ctx context.Context, exec bob.Executor, number int) (models.HistorySamplelocationSlice, error) { var err error m := make(models.HistorySamplelocationSlice, number) for i := range m { m[i], err = o.Create(ctx, exec) if err != nil { return nil, err } } return m, nil } // MustCreateMany builds multiple historySamplelocations and inserts them into the database // Relations objects are also inserted and placed in the .R field // panics if an error occurs func (o HistorySamplelocationTemplate) MustCreateMany(ctx context.Context, exec bob.Executor, number int) models.HistorySamplelocationSlice { m, err := o.CreateMany(ctx, exec, number) if err != nil { panic(err) } return m } // CreateManyOrFail builds multiple historySamplelocations 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 HistorySamplelocationTemplate) CreateManyOrFail(ctx context.Context, tb testing.TB, exec bob.Executor, number int) models.HistorySamplelocationSlice { tb.Helper() m, err := o.CreateMany(ctx, exec, number) if err != nil { tb.Fatal(err) return nil } return m } // HistorySamplelocation has methods that act as mods for the HistorySamplelocationTemplate var HistorySamplelocationMods historySamplelocationMods type historySamplelocationMods struct{} func (m historySamplelocationMods) RandomizeAllColumns(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModSlice{ HistorySamplelocationMods.RandomOrganizationID(f), HistorySamplelocationMods.RandomAccessdesc(f), HistorySamplelocationMods.RandomActive(f), HistorySamplelocationMods.RandomComments(f), HistorySamplelocationMods.RandomCreationdate(f), HistorySamplelocationMods.RandomCreator(f), HistorySamplelocationMods.RandomDescription(f), HistorySamplelocationMods.RandomExternalid(f), HistorySamplelocationMods.RandomEditdate(f), HistorySamplelocationMods.RandomEditor(f), HistorySamplelocationMods.RandomGatewaysync(f), HistorySamplelocationMods.RandomGlobalid(f), HistorySamplelocationMods.RandomHabitat(f), HistorySamplelocationMods.RandomLocationnumber(f), HistorySamplelocationMods.RandomName(f), HistorySamplelocationMods.RandomNextactiondatescheduled(f), HistorySamplelocationMods.RandomObjectid(f), HistorySamplelocationMods.RandomPriority(f), HistorySamplelocationMods.RandomUsetype(f), HistorySamplelocationMods.RandomZone(f), HistorySamplelocationMods.RandomZone2(f), HistorySamplelocationMods.RandomCreated(f), HistorySamplelocationMods.RandomCreatedDate(f), HistorySamplelocationMods.RandomCreatedUser(f), HistorySamplelocationMods.RandomGeometryX(f), HistorySamplelocationMods.RandomGeometryY(f), HistorySamplelocationMods.RandomLastEditedDate(f), HistorySamplelocationMods.RandomLastEditedUser(f), HistorySamplelocationMods.RandomVersion(f), } } // Set the model columns to this value func (m historySamplelocationMods) OrganizationID(val int32) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.OrganizationID = func() int32 { return val } }) } // Set the Column from the function func (m historySamplelocationMods) OrganizationIDFunc(f func() int32) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.OrganizationID = f }) } // Clear any values for the column func (m historySamplelocationMods) UnsetOrganizationID() HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { 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 historySamplelocationMods) RandomOrganizationID(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.OrganizationID = func() int32 { return random_int32(f) } }) } // Set the model columns to this value func (m historySamplelocationMods) Accessdesc(val null.Val[string]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Accessdesc = func() null.Val[string] { return val } }) } // Set the Column from the function func (m historySamplelocationMods) AccessdescFunc(f func() null.Val[string]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Accessdesc = f }) } // Clear any values for the column func (m historySamplelocationMods) UnsetAccessdesc() HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Accessdesc = 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 historySamplelocationMods) RandomAccessdesc(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Accessdesc = 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 historySamplelocationMods) RandomAccessdescNotNull(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Accessdesc = 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 historySamplelocationMods) Active(val null.Val[int16]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Active = func() null.Val[int16] { return val } }) } // Set the Column from the function func (m historySamplelocationMods) ActiveFunc(f func() null.Val[int16]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Active = f }) } // Clear any values for the column func (m historySamplelocationMods) UnsetActive() HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Active = 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 historySamplelocationMods) RandomActive(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Active = 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 historySamplelocationMods) RandomActiveNotNull(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Active = 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 historySamplelocationMods) Comments(val null.Val[string]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Comments = func() null.Val[string] { return val } }) } // Set the Column from the function func (m historySamplelocationMods) CommentsFunc(f func() null.Val[string]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Comments = f }) } // Clear any values for the column func (m historySamplelocationMods) UnsetComments() HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Comments = 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 historySamplelocationMods) RandomComments(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Comments = 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 historySamplelocationMods) RandomCommentsNotNull(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Comments = 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 historySamplelocationMods) Creationdate(val null.Val[int64]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Creationdate = func() null.Val[int64] { return val } }) } // Set the Column from the function func (m historySamplelocationMods) CreationdateFunc(f func() null.Val[int64]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Creationdate = f }) } // Clear any values for the column func (m historySamplelocationMods) UnsetCreationdate() HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { 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 historySamplelocationMods) RandomCreationdate(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { 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 historySamplelocationMods) RandomCreationdateNotNull(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { 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 historySamplelocationMods) Creator(val null.Val[string]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Creator = func() null.Val[string] { return val } }) } // Set the Column from the function func (m historySamplelocationMods) CreatorFunc(f func() null.Val[string]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Creator = f }) } // Clear any values for the column func (m historySamplelocationMods) UnsetCreator() HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { 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 historySamplelocationMods) RandomCreator(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { 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 historySamplelocationMods) RandomCreatorNotNull(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { 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 historySamplelocationMods) Description(val null.Val[string]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Description = func() null.Val[string] { return val } }) } // Set the Column from the function func (m historySamplelocationMods) DescriptionFunc(f func() null.Val[string]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Description = f }) } // Clear any values for the column func (m historySamplelocationMods) UnsetDescription() HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Description = 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 historySamplelocationMods) RandomDescription(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Description = 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 historySamplelocationMods) RandomDescriptionNotNull(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Description = 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 historySamplelocationMods) Externalid(val null.Val[string]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Externalid = func() null.Val[string] { return val } }) } // Set the Column from the function func (m historySamplelocationMods) ExternalidFunc(f func() null.Val[string]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Externalid = f }) } // Clear any values for the column func (m historySamplelocationMods) UnsetExternalid() HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Externalid = 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 historySamplelocationMods) RandomExternalid(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Externalid = 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 historySamplelocationMods) RandomExternalidNotNull(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Externalid = 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 historySamplelocationMods) Editdate(val null.Val[int64]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Editdate = func() null.Val[int64] { return val } }) } // Set the Column from the function func (m historySamplelocationMods) EditdateFunc(f func() null.Val[int64]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Editdate = f }) } // Clear any values for the column func (m historySamplelocationMods) UnsetEditdate() HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { 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 historySamplelocationMods) RandomEditdate(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { 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 historySamplelocationMods) RandomEditdateNotNull(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { 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 historySamplelocationMods) Editor(val null.Val[string]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Editor = func() null.Val[string] { return val } }) } // Set the Column from the function func (m historySamplelocationMods) EditorFunc(f func() null.Val[string]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Editor = f }) } // Clear any values for the column func (m historySamplelocationMods) UnsetEditor() HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { 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 historySamplelocationMods) RandomEditor(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { 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 historySamplelocationMods) RandomEditorNotNull(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { 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 historySamplelocationMods) Gatewaysync(val null.Val[int16]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Gatewaysync = func() null.Val[int16] { return val } }) } // Set the Column from the function func (m historySamplelocationMods) GatewaysyncFunc(f func() null.Val[int16]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Gatewaysync = f }) } // Clear any values for the column func (m historySamplelocationMods) UnsetGatewaysync() HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Gatewaysync = 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 historySamplelocationMods) RandomGatewaysync(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Gatewaysync = 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 historySamplelocationMods) RandomGatewaysyncNotNull(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Gatewaysync = 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 historySamplelocationMods) Globalid(val null.Val[string]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Globalid = func() null.Val[string] { return val } }) } // Set the Column from the function func (m historySamplelocationMods) GlobalidFunc(f func() null.Val[string]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Globalid = f }) } // Clear any values for the column func (m historySamplelocationMods) UnsetGlobalid() HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Globalid = 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 historySamplelocationMods) RandomGlobalid(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Globalid = 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 historySamplelocationMods) RandomGlobalidNotNull(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Globalid = 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 historySamplelocationMods) Habitat(val null.Val[string]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Habitat = func() null.Val[string] { return val } }) } // Set the Column from the function func (m historySamplelocationMods) HabitatFunc(f func() null.Val[string]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Habitat = f }) } // Clear any values for the column func (m historySamplelocationMods) UnsetHabitat() HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Habitat = 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 historySamplelocationMods) RandomHabitat(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Habitat = 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 historySamplelocationMods) RandomHabitatNotNull(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Habitat = 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 historySamplelocationMods) Locationnumber(val null.Val[int64]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Locationnumber = func() null.Val[int64] { return val } }) } // Set the Column from the function func (m historySamplelocationMods) LocationnumberFunc(f func() null.Val[int64]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Locationnumber = f }) } // Clear any values for the column func (m historySamplelocationMods) UnsetLocationnumber() HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Locationnumber = 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 historySamplelocationMods) RandomLocationnumber(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Locationnumber = 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 historySamplelocationMods) RandomLocationnumberNotNull(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Locationnumber = 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 historySamplelocationMods) Name(val null.Val[string]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Name = func() null.Val[string] { return val } }) } // Set the Column from the function func (m historySamplelocationMods) NameFunc(f func() null.Val[string]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Name = f }) } // Clear any values for the column func (m historySamplelocationMods) UnsetName() HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Name = 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 historySamplelocationMods) RandomName(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Name = 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 historySamplelocationMods) RandomNameNotNull(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Name = 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 historySamplelocationMods) Nextactiondatescheduled(val null.Val[int64]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Nextactiondatescheduled = func() null.Val[int64] { return val } }) } // Set the Column from the function func (m historySamplelocationMods) NextactiondatescheduledFunc(f func() null.Val[int64]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Nextactiondatescheduled = f }) } // Clear any values for the column func (m historySamplelocationMods) UnsetNextactiondatescheduled() HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Nextactiondatescheduled = 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 historySamplelocationMods) RandomNextactiondatescheduled(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Nextactiondatescheduled = 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 historySamplelocationMods) RandomNextactiondatescheduledNotNull(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Nextactiondatescheduled = 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 historySamplelocationMods) Objectid(val int32) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Objectid = func() int32 { return val } }) } // Set the Column from the function func (m historySamplelocationMods) ObjectidFunc(f func() int32) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Objectid = f }) } // Clear any values for the column func (m historySamplelocationMods) UnsetObjectid() HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { 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 historySamplelocationMods) RandomObjectid(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Objectid = func() int32 { return random_int32(f) } }) } // Set the model columns to this value func (m historySamplelocationMods) Priority(val null.Val[string]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Priority = func() null.Val[string] { return val } }) } // Set the Column from the function func (m historySamplelocationMods) PriorityFunc(f func() null.Val[string]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Priority = f }) } // Clear any values for the column func (m historySamplelocationMods) UnsetPriority() HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Priority = 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 historySamplelocationMods) RandomPriority(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Priority = 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 historySamplelocationMods) RandomPriorityNotNull(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Priority = 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 historySamplelocationMods) Usetype(val null.Val[string]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Usetype = func() null.Val[string] { return val } }) } // Set the Column from the function func (m historySamplelocationMods) UsetypeFunc(f func() null.Val[string]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Usetype = f }) } // Clear any values for the column func (m historySamplelocationMods) UnsetUsetype() HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Usetype = 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 historySamplelocationMods) RandomUsetype(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Usetype = 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 historySamplelocationMods) RandomUsetypeNotNull(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Usetype = 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 historySamplelocationMods) Zone(val null.Val[string]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Zone = func() null.Val[string] { return val } }) } // Set the Column from the function func (m historySamplelocationMods) ZoneFunc(f func() null.Val[string]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Zone = f }) } // Clear any values for the column func (m historySamplelocationMods) UnsetZone() HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Zone = 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 historySamplelocationMods) RandomZone(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Zone = 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 historySamplelocationMods) RandomZoneNotNull(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Zone = 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 historySamplelocationMods) Zone2(val null.Val[string]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Zone2 = func() null.Val[string] { return val } }) } // Set the Column from the function func (m historySamplelocationMods) Zone2Func(f func() null.Val[string]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Zone2 = f }) } // Clear any values for the column func (m historySamplelocationMods) UnsetZone2() HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Zone2 = 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 historySamplelocationMods) RandomZone2(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Zone2 = 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 historySamplelocationMods) RandomZone2NotNull(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Zone2 = 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 historySamplelocationMods) Created(val null.Val[time.Time]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Created = func() null.Val[time.Time] { return val } }) } // Set the Column from the function func (m historySamplelocationMods) CreatedFunc(f func() null.Val[time.Time]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Created = f }) } // Clear any values for the column func (m historySamplelocationMods) UnsetCreated() HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Created = 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 historySamplelocationMods) RandomCreated(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Created = func() null.Val[time.Time] { if f == nil { f = &defaultFaker } val := random_time_Time(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 historySamplelocationMods) RandomCreatedNotNull(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Created = func() null.Val[time.Time] { if f == nil { f = &defaultFaker } val := random_time_Time(f) return null.From(val) } }) } // Set the model columns to this value func (m historySamplelocationMods) CreatedDate(val null.Val[int64]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.CreatedDate = func() null.Val[int64] { return val } }) } // Set the Column from the function func (m historySamplelocationMods) CreatedDateFunc(f func() null.Val[int64]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.CreatedDate = f }) } // Clear any values for the column func (m historySamplelocationMods) UnsetCreatedDate() HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { 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 historySamplelocationMods) RandomCreatedDate(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { 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 historySamplelocationMods) RandomCreatedDateNotNull(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { 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 historySamplelocationMods) CreatedUser(val null.Val[string]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.CreatedUser = func() null.Val[string] { return val } }) } // Set the Column from the function func (m historySamplelocationMods) CreatedUserFunc(f func() null.Val[string]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.CreatedUser = f }) } // Clear any values for the column func (m historySamplelocationMods) UnsetCreatedUser() HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { 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 historySamplelocationMods) RandomCreatedUser(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { 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 historySamplelocationMods) RandomCreatedUserNotNull(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { 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 historySamplelocationMods) GeometryX(val null.Val[float64]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.GeometryX = func() null.Val[float64] { return val } }) } // Set the Column from the function func (m historySamplelocationMods) GeometryXFunc(f func() null.Val[float64]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.GeometryX = f }) } // Clear any values for the column func (m historySamplelocationMods) UnsetGeometryX() HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { 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 historySamplelocationMods) RandomGeometryX(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { 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 historySamplelocationMods) RandomGeometryXNotNull(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { 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 historySamplelocationMods) GeometryY(val null.Val[float64]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.GeometryY = func() null.Val[float64] { return val } }) } // Set the Column from the function func (m historySamplelocationMods) GeometryYFunc(f func() null.Val[float64]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.GeometryY = f }) } // Clear any values for the column func (m historySamplelocationMods) UnsetGeometryY() HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { 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 historySamplelocationMods) RandomGeometryY(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { 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 historySamplelocationMods) RandomGeometryYNotNull(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { 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 historySamplelocationMods) LastEditedDate(val null.Val[int64]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.LastEditedDate = func() null.Val[int64] { return val } }) } // Set the Column from the function func (m historySamplelocationMods) LastEditedDateFunc(f func() null.Val[int64]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.LastEditedDate = f }) } // Clear any values for the column func (m historySamplelocationMods) UnsetLastEditedDate() HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { 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 historySamplelocationMods) RandomLastEditedDate(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { 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 historySamplelocationMods) RandomLastEditedDateNotNull(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { 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 historySamplelocationMods) LastEditedUser(val null.Val[string]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.LastEditedUser = func() null.Val[string] { return val } }) } // Set the Column from the function func (m historySamplelocationMods) LastEditedUserFunc(f func() null.Val[string]) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.LastEditedUser = f }) } // Clear any values for the column func (m historySamplelocationMods) UnsetLastEditedUser() HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { 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 historySamplelocationMods) RandomLastEditedUser(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { 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 historySamplelocationMods) RandomLastEditedUserNotNull(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { 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 historySamplelocationMods) Version(val int32) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Version = func() int32 { return val } }) } // Set the Column from the function func (m historySamplelocationMods) VersionFunc(f func() int32) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Version = f }) } // Clear any values for the column func (m historySamplelocationMods) UnsetVersion() HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Version = nil }) } // Generates a random value for the column using the given faker // if faker is nil, a default faker is used func (m historySamplelocationMods) RandomVersion(f *faker.Faker) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(_ context.Context, o *HistorySamplelocationTemplate) { o.Version = func() int32 { return random_int32(f) } }) } func (m historySamplelocationMods) WithParentsCascading() HistorySamplelocationMod { return HistorySamplelocationModFunc(func(ctx context.Context, o *HistorySamplelocationTemplate) { if isDone, _ := historySamplelocationWithParentsCascadingCtx.Value(ctx); isDone { return } ctx = historySamplelocationWithParentsCascadingCtx.WithValue(ctx, true) { related := o.f.NewOrganizationWithContext(ctx, OrganizationMods.WithParentsCascading()) m.WithOrganization(related).Apply(ctx, o) } }) } func (m historySamplelocationMods) WithOrganization(rel *OrganizationTemplate) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(ctx context.Context, o *HistorySamplelocationTemplate) { o.r.Organization = &historySamplelocationROrganizationR{ o: rel, } }) } func (m historySamplelocationMods) WithNewOrganization(mods ...OrganizationMod) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(ctx context.Context, o *HistorySamplelocationTemplate) { related := o.f.NewOrganizationWithContext(ctx, mods...) m.WithOrganization(related).Apply(ctx, o) }) } func (m historySamplelocationMods) WithExistingOrganization(em *models.Organization) HistorySamplelocationMod { return HistorySamplelocationModFunc(func(ctx context.Context, o *HistorySamplelocationTemplate) { o.r.Organization = &historySamplelocationROrganizationR{ o: o.f.FromExistingOrganization(em), } }) } func (m historySamplelocationMods) WithoutOrganization() HistorySamplelocationMod { return HistorySamplelocationModFunc(func(ctx context.Context, o *HistorySamplelocationTemplate) { o.r.Organization = nil }) }