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