nidus-sync/factory/history_pool.bob.go
Eli Ribble 9010726707
Add initial synchronization of Fieldseeker data by oauth
This involves a lot of copy-pasta of code from the previous version of
this logic in another code base. It'll need to be cleaned up, but for
now I need something sooner rather than later.
2025-11-07 08:34:32 +00:00

2231 lines
64 KiB
Go

// 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"
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 HistoryPoolMod interface {
Apply(context.Context, *HistoryPoolTemplate)
}
type HistoryPoolModFunc func(context.Context, *HistoryPoolTemplate)
func (f HistoryPoolModFunc) Apply(ctx context.Context, n *HistoryPoolTemplate) {
f(ctx, n)
}
type HistoryPoolModSlice []HistoryPoolMod
func (mods HistoryPoolModSlice) Apply(ctx context.Context, n *HistoryPoolTemplate) {
for _, f := range mods {
f.Apply(ctx, n)
}
}
// HistoryPoolTemplate is an object representing the database table.
// all columns are optional and should be set by mods
type HistoryPoolTemplate struct {
OrganizationID func() null.Val[int32]
Comments func() null.Val[string]
Creationdate func() null.Val[int64]
Creator func() null.Val[string]
Datesent func() null.Val[int64]
Datetested func() null.Val[int64]
Diseasepos func() null.Val[string]
Diseasetested func() null.Val[string]
Editdate func() null.Val[int64]
Editor func() null.Val[string]
Gatewaysync func() null.Val[int16]
Globalid func() null.Val[string]
Lab func() null.Val[string]
LabID func() null.Val[string]
Objectid func() int32
Poolyear func() null.Val[int16]
Processed func() null.Val[int16]
Sampleid func() null.Val[string]
Survtech func() null.Val[string]
Testmethod func() null.Val[string]
Testtech func() null.Val[string]
TrapdataID func() null.Val[string]
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]
Vectorsurvcollectionid func() null.Val[string]
Vectorsurvpoolid func() null.Val[string]
Vectorsurvtrapdataid func() null.Val[string]
Version func() int32
r historyPoolR
f *Factory
alreadyPersisted bool
}
type historyPoolR struct {
Organization *historyPoolROrganizationR
}
type historyPoolROrganizationR struct {
o *OrganizationTemplate
}
// Apply mods to the HistoryPoolTemplate
func (o *HistoryPoolTemplate) Apply(ctx context.Context, mods ...HistoryPoolMod) {
for _, mod := range mods {
mod.Apply(ctx, o)
}
}
// setModelRels creates and sets the relationships on *models.HistoryPool
// according to the relationships in the template. Nothing is inserted into the db
func (t HistoryPoolTemplate) setModelRels(o *models.HistoryPool) {
if t.r.Organization != nil {
rel := t.r.Organization.o.Build()
rel.R.HistoryPools = append(rel.R.HistoryPools, o)
o.OrganizationID = null.From(rel.ID) // h2
o.R.Organization = rel
}
}
// BuildSetter returns an *models.HistoryPoolSetter
// this does nothing with the relationship templates
func (o HistoryPoolTemplate) BuildSetter() *models.HistoryPoolSetter {
m := &models.HistoryPoolSetter{}
if o.OrganizationID != nil {
val := o.OrganizationID()
m.OrganizationID = 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.Datesent != nil {
val := o.Datesent()
m.Datesent = omitnull.FromNull(val)
}
if o.Datetested != nil {
val := o.Datetested()
m.Datetested = omitnull.FromNull(val)
}
if o.Diseasepos != nil {
val := o.Diseasepos()
m.Diseasepos = omitnull.FromNull(val)
}
if o.Diseasetested != nil {
val := o.Diseasetested()
m.Diseasetested = 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.Lab != nil {
val := o.Lab()
m.Lab = omitnull.FromNull(val)
}
if o.LabID != nil {
val := o.LabID()
m.LabID = omitnull.FromNull(val)
}
if o.Objectid != nil {
val := o.Objectid()
m.Objectid = omit.From(val)
}
if o.Poolyear != nil {
val := o.Poolyear()
m.Poolyear = omitnull.FromNull(val)
}
if o.Processed != nil {
val := o.Processed()
m.Processed = omitnull.FromNull(val)
}
if o.Sampleid != nil {
val := o.Sampleid()
m.Sampleid = omitnull.FromNull(val)
}
if o.Survtech != nil {
val := o.Survtech()
m.Survtech = omitnull.FromNull(val)
}
if o.Testmethod != nil {
val := o.Testmethod()
m.Testmethod = omitnull.FromNull(val)
}
if o.Testtech != nil {
val := o.Testtech()
m.Testtech = omitnull.FromNull(val)
}
if o.TrapdataID != nil {
val := o.TrapdataID()
m.TrapdataID = 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.Vectorsurvcollectionid != nil {
val := o.Vectorsurvcollectionid()
m.Vectorsurvcollectionid = omitnull.FromNull(val)
}
if o.Vectorsurvpoolid != nil {
val := o.Vectorsurvpoolid()
m.Vectorsurvpoolid = omitnull.FromNull(val)
}
if o.Vectorsurvtrapdataid != nil {
val := o.Vectorsurvtrapdataid()
m.Vectorsurvtrapdataid = omitnull.FromNull(val)
}
if o.Version != nil {
val := o.Version()
m.Version = omit.From(val)
}
return m
}
// BuildManySetter returns an []*models.HistoryPoolSetter
// this does nothing with the relationship templates
func (o HistoryPoolTemplate) BuildManySetter(number int) []*models.HistoryPoolSetter {
m := make([]*models.HistoryPoolSetter, number)
for i := range m {
m[i] = o.BuildSetter()
}
return m
}
// Build returns an *models.HistoryPool
// Related objects are also created and placed in the .R field
// NOTE: Objects are not inserted into the database. Use HistoryPoolTemplate.Create
func (o HistoryPoolTemplate) Build() *models.HistoryPool {
m := &models.HistoryPool{}
if o.OrganizationID != nil {
m.OrganizationID = o.OrganizationID()
}
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.Datesent != nil {
m.Datesent = o.Datesent()
}
if o.Datetested != nil {
m.Datetested = o.Datetested()
}
if o.Diseasepos != nil {
m.Diseasepos = o.Diseasepos()
}
if o.Diseasetested != nil {
m.Diseasetested = o.Diseasetested()
}
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.Lab != nil {
m.Lab = o.Lab()
}
if o.LabID != nil {
m.LabID = o.LabID()
}
if o.Objectid != nil {
m.Objectid = o.Objectid()
}
if o.Poolyear != nil {
m.Poolyear = o.Poolyear()
}
if o.Processed != nil {
m.Processed = o.Processed()
}
if o.Sampleid != nil {
m.Sampleid = o.Sampleid()
}
if o.Survtech != nil {
m.Survtech = o.Survtech()
}
if o.Testmethod != nil {
m.Testmethod = o.Testmethod()
}
if o.Testtech != nil {
m.Testtech = o.Testtech()
}
if o.TrapdataID != nil {
m.TrapdataID = o.TrapdataID()
}
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.Vectorsurvcollectionid != nil {
m.Vectorsurvcollectionid = o.Vectorsurvcollectionid()
}
if o.Vectorsurvpoolid != nil {
m.Vectorsurvpoolid = o.Vectorsurvpoolid()
}
if o.Vectorsurvtrapdataid != nil {
m.Vectorsurvtrapdataid = o.Vectorsurvtrapdataid()
}
if o.Version != nil {
m.Version = o.Version()
}
o.setModelRels(m)
return m
}
// BuildMany returns an models.HistoryPoolSlice
// Related objects are also created and placed in the .R field
// NOTE: Objects are not inserted into the database. Use HistoryPoolTemplate.CreateMany
func (o HistoryPoolTemplate) BuildMany(number int) models.HistoryPoolSlice {
m := make(models.HistoryPoolSlice, number)
for i := range m {
m[i] = o.Build()
}
return m
}
func ensureCreatableHistoryPool(m *models.HistoryPoolSetter) {
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.HistoryPool
// according to the relationships in the template.
// any required relationship should have already exist on the model
func (o *HistoryPoolTemplate) insertOptRels(ctx context.Context, exec bob.Executor, m *models.HistoryPool) error {
var err error
isOrganizationDone, _ := historyPoolRelOrganizationCtx.Value(ctx)
if !isOrganizationDone && o.r.Organization != nil {
ctx = historyPoolRelOrganizationCtx.WithValue(ctx, true)
if o.r.Organization.o.alreadyPersisted {
m.R.Organization = o.r.Organization.o.Build()
} else {
var rel0 *models.Organization
rel0, err = o.r.Organization.o.Create(ctx, exec)
if err != nil {
return err
}
err = m.AttachOrganization(ctx, exec, rel0)
if err != nil {
return err
}
}
}
return err
}
// Create builds a historyPool and inserts it into the database
// Relations objects are also inserted and placed in the .R field
func (o *HistoryPoolTemplate) Create(ctx context.Context, exec bob.Executor) (*models.HistoryPool, error) {
var err error
opt := o.BuildSetter()
ensureCreatableHistoryPool(opt)
m, err := models.HistoryPools.Insert(opt).One(ctx, exec)
if err != nil {
return nil, err
}
if err := o.insertOptRels(ctx, exec, m); err != nil {
return nil, err
}
return m, err
}
// MustCreate builds a historyPool and inserts it into the database
// Relations objects are also inserted and placed in the .R field
// panics if an error occurs
func (o *HistoryPoolTemplate) MustCreate(ctx context.Context, exec bob.Executor) *models.HistoryPool {
m, err := o.Create(ctx, exec)
if err != nil {
panic(err)
}
return m
}
// CreateOrFail builds a historyPool 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 *HistoryPoolTemplate) CreateOrFail(ctx context.Context, tb testing.TB, exec bob.Executor) *models.HistoryPool {
tb.Helper()
m, err := o.Create(ctx, exec)
if err != nil {
tb.Fatal(err)
return nil
}
return m
}
// CreateMany builds multiple historyPools and inserts them into the database
// Relations objects are also inserted and placed in the .R field
func (o HistoryPoolTemplate) CreateMany(ctx context.Context, exec bob.Executor, number int) (models.HistoryPoolSlice, error) {
var err error
m := make(models.HistoryPoolSlice, number)
for i := range m {
m[i], err = o.Create(ctx, exec)
if err != nil {
return nil, err
}
}
return m, nil
}
// MustCreateMany builds multiple historyPools and inserts them into the database
// Relations objects are also inserted and placed in the .R field
// panics if an error occurs
func (o HistoryPoolTemplate) MustCreateMany(ctx context.Context, exec bob.Executor, number int) models.HistoryPoolSlice {
m, err := o.CreateMany(ctx, exec, number)
if err != nil {
panic(err)
}
return m
}
// CreateManyOrFail builds multiple historyPools 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 HistoryPoolTemplate) CreateManyOrFail(ctx context.Context, tb testing.TB, exec bob.Executor, number int) models.HistoryPoolSlice {
tb.Helper()
m, err := o.CreateMany(ctx, exec, number)
if err != nil {
tb.Fatal(err)
return nil
}
return m
}
// HistoryPool has methods that act as mods for the HistoryPoolTemplate
var HistoryPoolMods historyPoolMods
type historyPoolMods struct{}
func (m historyPoolMods) RandomizeAllColumns(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModSlice{
HistoryPoolMods.RandomOrganizationID(f),
HistoryPoolMods.RandomComments(f),
HistoryPoolMods.RandomCreationdate(f),
HistoryPoolMods.RandomCreator(f),
HistoryPoolMods.RandomDatesent(f),
HistoryPoolMods.RandomDatetested(f),
HistoryPoolMods.RandomDiseasepos(f),
HistoryPoolMods.RandomDiseasetested(f),
HistoryPoolMods.RandomEditdate(f),
HistoryPoolMods.RandomEditor(f),
HistoryPoolMods.RandomGatewaysync(f),
HistoryPoolMods.RandomGlobalid(f),
HistoryPoolMods.RandomLab(f),
HistoryPoolMods.RandomLabID(f),
HistoryPoolMods.RandomObjectid(f),
HistoryPoolMods.RandomPoolyear(f),
HistoryPoolMods.RandomProcessed(f),
HistoryPoolMods.RandomSampleid(f),
HistoryPoolMods.RandomSurvtech(f),
HistoryPoolMods.RandomTestmethod(f),
HistoryPoolMods.RandomTesttech(f),
HistoryPoolMods.RandomTrapdataID(f),
HistoryPoolMods.RandomCreatedDate(f),
HistoryPoolMods.RandomCreatedUser(f),
HistoryPoolMods.RandomGeometryX(f),
HistoryPoolMods.RandomGeometryY(f),
HistoryPoolMods.RandomLastEditedDate(f),
HistoryPoolMods.RandomLastEditedUser(f),
HistoryPoolMods.RandomVectorsurvcollectionid(f),
HistoryPoolMods.RandomVectorsurvpoolid(f),
HistoryPoolMods.RandomVectorsurvtrapdataid(f),
HistoryPoolMods.RandomVersion(f),
}
}
// Set the model columns to this value
func (m historyPoolMods) OrganizationID(val null.Val[int32]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.OrganizationID = func() null.Val[int32] { return val }
})
}
// Set the Column from the function
func (m historyPoolMods) OrganizationIDFunc(f func() null.Val[int32]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.OrganizationID = f
})
}
// Clear any values for the column
func (m historyPoolMods) UnsetOrganizationID() HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.OrganizationID = 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 historyPoolMods) RandomOrganizationID(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.OrganizationID = func() null.Val[int32] {
if f == nil {
f = &defaultFaker
}
val := random_int32(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 historyPoolMods) RandomOrganizationIDNotNull(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.OrganizationID = func() null.Val[int32] {
if f == nil {
f = &defaultFaker
}
val := random_int32(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m historyPoolMods) Comments(val null.Val[string]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Comments = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m historyPoolMods) CommentsFunc(f func() null.Val[string]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Comments = f
})
}
// Clear any values for the column
func (m historyPoolMods) UnsetComments() HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) RandomComments(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) RandomCommentsNotNull(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) Creationdate(val null.Val[int64]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Creationdate = func() null.Val[int64] { return val }
})
}
// Set the Column from the function
func (m historyPoolMods) CreationdateFunc(f func() null.Val[int64]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Creationdate = f
})
}
// Clear any values for the column
func (m historyPoolMods) UnsetCreationdate() HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) RandomCreationdate(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) RandomCreationdateNotNull(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) Creator(val null.Val[string]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Creator = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m historyPoolMods) CreatorFunc(f func() null.Val[string]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Creator = f
})
}
// Clear any values for the column
func (m historyPoolMods) UnsetCreator() HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) RandomCreator(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) RandomCreatorNotNull(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) Datesent(val null.Val[int64]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Datesent = func() null.Val[int64] { return val }
})
}
// Set the Column from the function
func (m historyPoolMods) DatesentFunc(f func() null.Val[int64]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Datesent = f
})
}
// Clear any values for the column
func (m historyPoolMods) UnsetDatesent() HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Datesent = 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 historyPoolMods) RandomDatesent(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Datesent = 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 historyPoolMods) RandomDatesentNotNull(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Datesent = 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 historyPoolMods) Datetested(val null.Val[int64]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Datetested = func() null.Val[int64] { return val }
})
}
// Set the Column from the function
func (m historyPoolMods) DatetestedFunc(f func() null.Val[int64]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Datetested = f
})
}
// Clear any values for the column
func (m historyPoolMods) UnsetDatetested() HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Datetested = 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 historyPoolMods) RandomDatetested(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Datetested = 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 historyPoolMods) RandomDatetestedNotNull(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Datetested = 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 historyPoolMods) Diseasepos(val null.Val[string]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Diseasepos = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m historyPoolMods) DiseaseposFunc(f func() null.Val[string]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Diseasepos = f
})
}
// Clear any values for the column
func (m historyPoolMods) UnsetDiseasepos() HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Diseasepos = 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 historyPoolMods) RandomDiseasepos(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Diseasepos = 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 historyPoolMods) RandomDiseaseposNotNull(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Diseasepos = 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 historyPoolMods) Diseasetested(val null.Val[string]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Diseasetested = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m historyPoolMods) DiseasetestedFunc(f func() null.Val[string]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Diseasetested = f
})
}
// Clear any values for the column
func (m historyPoolMods) UnsetDiseasetested() HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Diseasetested = 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 historyPoolMods) RandomDiseasetested(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Diseasetested = 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 historyPoolMods) RandomDiseasetestedNotNull(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Diseasetested = 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 historyPoolMods) Editdate(val null.Val[int64]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Editdate = func() null.Val[int64] { return val }
})
}
// Set the Column from the function
func (m historyPoolMods) EditdateFunc(f func() null.Val[int64]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Editdate = f
})
}
// Clear any values for the column
func (m historyPoolMods) UnsetEditdate() HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) RandomEditdate(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) RandomEditdateNotNull(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) Editor(val null.Val[string]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Editor = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m historyPoolMods) EditorFunc(f func() null.Val[string]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Editor = f
})
}
// Clear any values for the column
func (m historyPoolMods) UnsetEditor() HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) RandomEditor(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) RandomEditorNotNull(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) Gatewaysync(val null.Val[int16]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Gatewaysync = func() null.Val[int16] { return val }
})
}
// Set the Column from the function
func (m historyPoolMods) GatewaysyncFunc(f func() null.Val[int16]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Gatewaysync = f
})
}
// Clear any values for the column
func (m historyPoolMods) UnsetGatewaysync() HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) RandomGatewaysync(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) RandomGatewaysyncNotNull(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) Globalid(val null.Val[string]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Globalid = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m historyPoolMods) GlobalidFunc(f func() null.Val[string]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Globalid = f
})
}
// Clear any values for the column
func (m historyPoolMods) UnsetGlobalid() HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) RandomGlobalid(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) RandomGlobalidNotNull(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) Lab(val null.Val[string]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Lab = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m historyPoolMods) LabFunc(f func() null.Val[string]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Lab = f
})
}
// Clear any values for the column
func (m historyPoolMods) UnsetLab() HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Lab = 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 historyPoolMods) RandomLab(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Lab = 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 historyPoolMods) RandomLabNotNull(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Lab = 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 historyPoolMods) LabID(val null.Val[string]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.LabID = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m historyPoolMods) LabIDFunc(f func() null.Val[string]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.LabID = f
})
}
// Clear any values for the column
func (m historyPoolMods) UnsetLabID() HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.LabID = 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 historyPoolMods) RandomLabID(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.LabID = 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 historyPoolMods) RandomLabIDNotNull(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.LabID = 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 historyPoolMods) Objectid(val int32) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Objectid = func() int32 { return val }
})
}
// Set the Column from the function
func (m historyPoolMods) ObjectidFunc(f func() int32) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Objectid = f
})
}
// Clear any values for the column
func (m historyPoolMods) UnsetObjectid() HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) RandomObjectid(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Objectid = func() int32 {
return random_int32(f)
}
})
}
// Set the model columns to this value
func (m historyPoolMods) Poolyear(val null.Val[int16]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Poolyear = func() null.Val[int16] { return val }
})
}
// Set the Column from the function
func (m historyPoolMods) PoolyearFunc(f func() null.Val[int16]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Poolyear = f
})
}
// Clear any values for the column
func (m historyPoolMods) UnsetPoolyear() HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Poolyear = 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 historyPoolMods) RandomPoolyear(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Poolyear = 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 historyPoolMods) RandomPoolyearNotNull(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Poolyear = 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 historyPoolMods) Processed(val null.Val[int16]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Processed = func() null.Val[int16] { return val }
})
}
// Set the Column from the function
func (m historyPoolMods) ProcessedFunc(f func() null.Val[int16]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Processed = f
})
}
// Clear any values for the column
func (m historyPoolMods) UnsetProcessed() HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) RandomProcessed(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) RandomProcessedNotNull(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) Sampleid(val null.Val[string]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Sampleid = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m historyPoolMods) SampleidFunc(f func() null.Val[string]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Sampleid = f
})
}
// Clear any values for the column
func (m historyPoolMods) UnsetSampleid() HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Sampleid = 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 historyPoolMods) RandomSampleid(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Sampleid = 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 historyPoolMods) RandomSampleidNotNull(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Sampleid = 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 historyPoolMods) Survtech(val null.Val[string]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Survtech = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m historyPoolMods) SurvtechFunc(f func() null.Val[string]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Survtech = f
})
}
// Clear any values for the column
func (m historyPoolMods) UnsetSurvtech() HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Survtech = 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 historyPoolMods) RandomSurvtech(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Survtech = 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 historyPoolMods) RandomSurvtechNotNull(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Survtech = 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 historyPoolMods) Testmethod(val null.Val[string]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Testmethod = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m historyPoolMods) TestmethodFunc(f func() null.Val[string]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Testmethod = f
})
}
// Clear any values for the column
func (m historyPoolMods) UnsetTestmethod() HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Testmethod = 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 historyPoolMods) RandomTestmethod(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Testmethod = 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 historyPoolMods) RandomTestmethodNotNull(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Testmethod = 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 historyPoolMods) Testtech(val null.Val[string]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Testtech = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m historyPoolMods) TesttechFunc(f func() null.Val[string]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Testtech = f
})
}
// Clear any values for the column
func (m historyPoolMods) UnsetTesttech() HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Testtech = 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 historyPoolMods) RandomTesttech(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Testtech = 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 historyPoolMods) RandomTesttechNotNull(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Testtech = 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 historyPoolMods) TrapdataID(val null.Val[string]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.TrapdataID = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m historyPoolMods) TrapdataIDFunc(f func() null.Val[string]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.TrapdataID = f
})
}
// Clear any values for the column
func (m historyPoolMods) UnsetTrapdataID() HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) RandomTrapdataID(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) RandomTrapdataIDNotNull(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) CreatedDate(val null.Val[int64]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.CreatedDate = func() null.Val[int64] { return val }
})
}
// Set the Column from the function
func (m historyPoolMods) CreatedDateFunc(f func() null.Val[int64]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.CreatedDate = f
})
}
// Clear any values for the column
func (m historyPoolMods) UnsetCreatedDate() HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) RandomCreatedDate(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) RandomCreatedDateNotNull(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) CreatedUser(val null.Val[string]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.CreatedUser = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m historyPoolMods) CreatedUserFunc(f func() null.Val[string]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.CreatedUser = f
})
}
// Clear any values for the column
func (m historyPoolMods) UnsetCreatedUser() HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) RandomCreatedUser(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) RandomCreatedUserNotNull(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) GeometryX(val null.Val[float64]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.GeometryX = func() null.Val[float64] { return val }
})
}
// Set the Column from the function
func (m historyPoolMods) GeometryXFunc(f func() null.Val[float64]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.GeometryX = f
})
}
// Clear any values for the column
func (m historyPoolMods) UnsetGeometryX() HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) RandomGeometryX(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) RandomGeometryXNotNull(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) GeometryY(val null.Val[float64]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.GeometryY = func() null.Val[float64] { return val }
})
}
// Set the Column from the function
func (m historyPoolMods) GeometryYFunc(f func() null.Val[float64]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.GeometryY = f
})
}
// Clear any values for the column
func (m historyPoolMods) UnsetGeometryY() HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) RandomGeometryY(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) RandomGeometryYNotNull(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) LastEditedDate(val null.Val[int64]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.LastEditedDate = func() null.Val[int64] { return val }
})
}
// Set the Column from the function
func (m historyPoolMods) LastEditedDateFunc(f func() null.Val[int64]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.LastEditedDate = f
})
}
// Clear any values for the column
func (m historyPoolMods) UnsetLastEditedDate() HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) RandomLastEditedDate(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) RandomLastEditedDateNotNull(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) LastEditedUser(val null.Val[string]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.LastEditedUser = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m historyPoolMods) LastEditedUserFunc(f func() null.Val[string]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.LastEditedUser = f
})
}
// Clear any values for the column
func (m historyPoolMods) UnsetLastEditedUser() HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) RandomLastEditedUser(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) RandomLastEditedUserNotNull(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) Vectorsurvcollectionid(val null.Val[string]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Vectorsurvcollectionid = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m historyPoolMods) VectorsurvcollectionidFunc(f func() null.Val[string]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Vectorsurvcollectionid = f
})
}
// Clear any values for the column
func (m historyPoolMods) UnsetVectorsurvcollectionid() HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Vectorsurvcollectionid = 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 historyPoolMods) RandomVectorsurvcollectionid(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Vectorsurvcollectionid = 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 historyPoolMods) RandomVectorsurvcollectionidNotNull(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Vectorsurvcollectionid = 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 historyPoolMods) Vectorsurvpoolid(val null.Val[string]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Vectorsurvpoolid = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m historyPoolMods) VectorsurvpoolidFunc(f func() null.Val[string]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Vectorsurvpoolid = f
})
}
// Clear any values for the column
func (m historyPoolMods) UnsetVectorsurvpoolid() HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Vectorsurvpoolid = 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 historyPoolMods) RandomVectorsurvpoolid(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Vectorsurvpoolid = 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 historyPoolMods) RandomVectorsurvpoolidNotNull(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Vectorsurvpoolid = 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 historyPoolMods) Vectorsurvtrapdataid(val null.Val[string]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Vectorsurvtrapdataid = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m historyPoolMods) VectorsurvtrapdataidFunc(f func() null.Val[string]) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Vectorsurvtrapdataid = f
})
}
// Clear any values for the column
func (m historyPoolMods) UnsetVectorsurvtrapdataid() HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Vectorsurvtrapdataid = 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 historyPoolMods) RandomVectorsurvtrapdataid(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Vectorsurvtrapdataid = 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 historyPoolMods) RandomVectorsurvtrapdataidNotNull(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Vectorsurvtrapdataid = 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 historyPoolMods) Version(val int32) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Version = func() int32 { return val }
})
}
// Set the Column from the function
func (m historyPoolMods) VersionFunc(f func() int32) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Version = f
})
}
// Clear any values for the column
func (m historyPoolMods) UnsetVersion() HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
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 historyPoolMods) RandomVersion(f *faker.Faker) HistoryPoolMod {
return HistoryPoolModFunc(func(_ context.Context, o *HistoryPoolTemplate) {
o.Version = func() int32 {
return random_int32(f)
}
})
}
func (m historyPoolMods) WithParentsCascading() HistoryPoolMod {
return HistoryPoolModFunc(func(ctx context.Context, o *HistoryPoolTemplate) {
if isDone, _ := historyPoolWithParentsCascadingCtx.Value(ctx); isDone {
return
}
ctx = historyPoolWithParentsCascadingCtx.WithValue(ctx, true)
{
related := o.f.NewOrganizationWithContext(ctx, OrganizationMods.WithParentsCascading())
m.WithOrganization(related).Apply(ctx, o)
}
})
}
func (m historyPoolMods) WithOrganization(rel *OrganizationTemplate) HistoryPoolMod {
return HistoryPoolModFunc(func(ctx context.Context, o *HistoryPoolTemplate) {
o.r.Organization = &historyPoolROrganizationR{
o: rel,
}
})
}
func (m historyPoolMods) WithNewOrganization(mods ...OrganizationMod) HistoryPoolMod {
return HistoryPoolModFunc(func(ctx context.Context, o *HistoryPoolTemplate) {
related := o.f.NewOrganizationWithContext(ctx, mods...)
m.WithOrganization(related).Apply(ctx, o)
})
}
func (m historyPoolMods) WithExistingOrganization(em *models.Organization) HistoryPoolMod {
return HistoryPoolModFunc(func(ctx context.Context, o *HistoryPoolTemplate) {
o.r.Organization = &historyPoolROrganizationR{
o: o.f.FromExistingOrganization(em),
}
})
}
func (m historyPoolMods) WithoutOrganization() HistoryPoolMod {
return HistoryPoolModFunc(func(ctx context.Context, o *HistoryPoolTemplate) {
o.r.Organization = nil
})
}