nidus-sync/db/factory/fieldseeker.stormdrain.bob.go
Eli Ribble 7c4fb02908
Move to latest bobgen, add fieldseeker schema references
This is an intermediate step between shifting from the old fs_* prefixed
table names to an entire fieldseeker schema. At this point we have both,
and we aren't doing much with the new schema but compiling.
2025-12-02 00:28:14 +00:00

1372 lines
44 KiB
Go

// Code generated by BobGen psql v0.42.0. 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"
enums "github.com/Gleipnir-Technology/nidus-sync/db/enums"
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/gofrs/uuid/v5"
"github.com/jaswdr/faker/v2"
"github.com/stephenafamo/bob"
)
type FieldseekerStormdrainMod interface {
Apply(context.Context, *FieldseekerStormdrainTemplate)
}
type FieldseekerStormdrainModFunc func(context.Context, *FieldseekerStormdrainTemplate)
func (f FieldseekerStormdrainModFunc) Apply(ctx context.Context, n *FieldseekerStormdrainTemplate) {
f(ctx, n)
}
type FieldseekerStormdrainModSlice []FieldseekerStormdrainMod
func (mods FieldseekerStormdrainModSlice) Apply(ctx context.Context, n *FieldseekerStormdrainTemplate) {
for _, f := range mods {
f.Apply(ctx, n)
}
}
// FieldseekerStormdrainTemplate is an object representing the database table.
// all columns are optional and should be set by mods
type FieldseekerStormdrainTemplate struct {
Objectid func() int64
Nexttreatmentdate func() null.Val[time.Time]
Lasttreatdate func() null.Val[time.Time]
Lastaction func() null.Val[string]
Symbology func() null.Val[enums.FieldseekerStormdrainStormdrainsymbologyEnum]
Globalid func() null.Val[uuid.UUID]
CreatedUser func() null.Val[string]
CreatedDate func() null.Val[time.Time]
LastEditedUser func() null.Val[string]
LastEditedDate func() null.Val[time.Time]
Laststatus func() null.Val[string]
Zone func() null.Val[string]
Zone2 func() null.Val[string]
Creationdate func() null.Val[time.Time]
Creator func() null.Val[string]
Editdate func() null.Val[time.Time]
Editor func() null.Val[string]
Type func() null.Val[string]
Jurisdiction func() null.Val[string]
f *Factory
alreadyPersisted bool
}
// Apply mods to the FieldseekerStormdrainTemplate
func (o *FieldseekerStormdrainTemplate) Apply(ctx context.Context, mods ...FieldseekerStormdrainMod) {
for _, mod := range mods {
mod.Apply(ctx, o)
}
}
// setModelRels creates and sets the relationships on *models.FieldseekerStormdrain
// according to the relationships in the template. Nothing is inserted into the db
func (t FieldseekerStormdrainTemplate) setModelRels(o *models.FieldseekerStormdrain) {}
// BuildSetter returns an *models.FieldseekerStormdrainSetter
// this does nothing with the relationship templates
func (o FieldseekerStormdrainTemplate) BuildSetter() *models.FieldseekerStormdrainSetter {
m := &models.FieldseekerStormdrainSetter{}
if o.Objectid != nil {
val := o.Objectid()
m.Objectid = omit.From(val)
}
if o.Nexttreatmentdate != nil {
val := o.Nexttreatmentdate()
m.Nexttreatmentdate = omitnull.FromNull(val)
}
if o.Lasttreatdate != nil {
val := o.Lasttreatdate()
m.Lasttreatdate = omitnull.FromNull(val)
}
if o.Lastaction != nil {
val := o.Lastaction()
m.Lastaction = omitnull.FromNull(val)
}
if o.Symbology != nil {
val := o.Symbology()
m.Symbology = omitnull.FromNull(val)
}
if o.Globalid != nil {
val := o.Globalid()
m.Globalid = omitnull.FromNull(val)
}
if o.CreatedUser != nil {
val := o.CreatedUser()
m.CreatedUser = omitnull.FromNull(val)
}
if o.CreatedDate != nil {
val := o.CreatedDate()
m.CreatedDate = omitnull.FromNull(val)
}
if o.LastEditedUser != nil {
val := o.LastEditedUser()
m.LastEditedUser = omitnull.FromNull(val)
}
if o.LastEditedDate != nil {
val := o.LastEditedDate()
m.LastEditedDate = omitnull.FromNull(val)
}
if o.Laststatus != nil {
val := o.Laststatus()
m.Laststatus = omitnull.FromNull(val)
}
if o.Zone != nil {
val := o.Zone()
m.Zone = omitnull.FromNull(val)
}
if o.Zone2 != nil {
val := o.Zone2()
m.Zone2 = omitnull.FromNull(val)
}
if o.Creationdate != nil {
val := o.Creationdate()
m.Creationdate = omitnull.FromNull(val)
}
if o.Creator != nil {
val := o.Creator()
m.Creator = 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.Type != nil {
val := o.Type()
m.Type = omitnull.FromNull(val)
}
if o.Jurisdiction != nil {
val := o.Jurisdiction()
m.Jurisdiction = omitnull.FromNull(val)
}
return m
}
// BuildManySetter returns an []*models.FieldseekerStormdrainSetter
// this does nothing with the relationship templates
func (o FieldseekerStormdrainTemplate) BuildManySetter(number int) []*models.FieldseekerStormdrainSetter {
m := make([]*models.FieldseekerStormdrainSetter, number)
for i := range m {
m[i] = o.BuildSetter()
}
return m
}
// Build returns an *models.FieldseekerStormdrain
// Related objects are also created and placed in the .R field
// NOTE: Objects are not inserted into the database. Use FieldseekerStormdrainTemplate.Create
func (o FieldseekerStormdrainTemplate) Build() *models.FieldseekerStormdrain {
m := &models.FieldseekerStormdrain{}
if o.Objectid != nil {
m.Objectid = o.Objectid()
}
if o.Nexttreatmentdate != nil {
m.Nexttreatmentdate = o.Nexttreatmentdate()
}
if o.Lasttreatdate != nil {
m.Lasttreatdate = o.Lasttreatdate()
}
if o.Lastaction != nil {
m.Lastaction = o.Lastaction()
}
if o.Symbology != nil {
m.Symbology = o.Symbology()
}
if o.Globalid != nil {
m.Globalid = o.Globalid()
}
if o.CreatedUser != nil {
m.CreatedUser = o.CreatedUser()
}
if o.CreatedDate != nil {
m.CreatedDate = o.CreatedDate()
}
if o.LastEditedUser != nil {
m.LastEditedUser = o.LastEditedUser()
}
if o.LastEditedDate != nil {
m.LastEditedDate = o.LastEditedDate()
}
if o.Laststatus != nil {
m.Laststatus = o.Laststatus()
}
if o.Zone != nil {
m.Zone = o.Zone()
}
if o.Zone2 != nil {
m.Zone2 = o.Zone2()
}
if o.Creationdate != nil {
m.Creationdate = o.Creationdate()
}
if o.Creator != nil {
m.Creator = o.Creator()
}
if o.Editdate != nil {
m.Editdate = o.Editdate()
}
if o.Editor != nil {
m.Editor = o.Editor()
}
if o.Type != nil {
m.Type = o.Type()
}
if o.Jurisdiction != nil {
m.Jurisdiction = o.Jurisdiction()
}
o.setModelRels(m)
return m
}
// BuildMany returns an models.FieldseekerStormdrainSlice
// Related objects are also created and placed in the .R field
// NOTE: Objects are not inserted into the database. Use FieldseekerStormdrainTemplate.CreateMany
func (o FieldseekerStormdrainTemplate) BuildMany(number int) models.FieldseekerStormdrainSlice {
m := make(models.FieldseekerStormdrainSlice, number)
for i := range m {
m[i] = o.Build()
}
return m
}
func ensureCreatableFieldseekerStormdrain(m *models.FieldseekerStormdrainSetter) {
}
// insertOptRels creates and inserts any optional the relationships on *models.FieldseekerStormdrain
// according to the relationships in the template.
// any required relationship should have already exist on the model
func (o *FieldseekerStormdrainTemplate) insertOptRels(ctx context.Context, exec bob.Executor, m *models.FieldseekerStormdrain) error {
var err error
return err
}
// Create builds a fieldseekerStormdrain and inserts it into the database
// Relations objects are also inserted and placed in the .R field
func (o *FieldseekerStormdrainTemplate) Create(ctx context.Context, exec bob.Executor) (*models.FieldseekerStormdrain, error) {
var err error
opt := o.BuildSetter()
ensureCreatableFieldseekerStormdrain(opt)
m, err := models.FieldseekerStormdrains.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 fieldseekerStormdrain and inserts it into the database
// Relations objects are also inserted and placed in the .R field
// panics if an error occurs
func (o *FieldseekerStormdrainTemplate) MustCreate(ctx context.Context, exec bob.Executor) *models.FieldseekerStormdrain {
m, err := o.Create(ctx, exec)
if err != nil {
panic(err)
}
return m
}
// CreateOrFail builds a fieldseekerStormdrain 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 *FieldseekerStormdrainTemplate) CreateOrFail(ctx context.Context, tb testing.TB, exec bob.Executor) *models.FieldseekerStormdrain {
tb.Helper()
m, err := o.Create(ctx, exec)
if err != nil {
tb.Fatal(err)
return nil
}
return m
}
// CreateMany builds multiple fieldseekerStormdrains and inserts them into the database
// Relations objects are also inserted and placed in the .R field
func (o FieldseekerStormdrainTemplate) CreateMany(ctx context.Context, exec bob.Executor, number int) (models.FieldseekerStormdrainSlice, error) {
var err error
m := make(models.FieldseekerStormdrainSlice, number)
for i := range m {
m[i], err = o.Create(ctx, exec)
if err != nil {
return nil, err
}
}
return m, nil
}
// MustCreateMany builds multiple fieldseekerStormdrains and inserts them into the database
// Relations objects are also inserted and placed in the .R field
// panics if an error occurs
func (o FieldseekerStormdrainTemplate) MustCreateMany(ctx context.Context, exec bob.Executor, number int) models.FieldseekerStormdrainSlice {
m, err := o.CreateMany(ctx, exec, number)
if err != nil {
panic(err)
}
return m
}
// CreateManyOrFail builds multiple fieldseekerStormdrains 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 FieldseekerStormdrainTemplate) CreateManyOrFail(ctx context.Context, tb testing.TB, exec bob.Executor, number int) models.FieldseekerStormdrainSlice {
tb.Helper()
m, err := o.CreateMany(ctx, exec, number)
if err != nil {
tb.Fatal(err)
return nil
}
return m
}
// FieldseekerStormdrain has methods that act as mods for the FieldseekerStormdrainTemplate
var FieldseekerStormdrainMods fieldseekerStormdrainMods
type fieldseekerStormdrainMods struct{}
func (m fieldseekerStormdrainMods) RandomizeAllColumns(f *faker.Faker) FieldseekerStormdrainMod {
return FieldseekerStormdrainModSlice{
FieldseekerStormdrainMods.RandomObjectid(f),
FieldseekerStormdrainMods.RandomNexttreatmentdate(f),
FieldseekerStormdrainMods.RandomLasttreatdate(f),
FieldseekerStormdrainMods.RandomLastaction(f),
FieldseekerStormdrainMods.RandomSymbology(f),
FieldseekerStormdrainMods.RandomGlobalid(f),
FieldseekerStormdrainMods.RandomCreatedUser(f),
FieldseekerStormdrainMods.RandomCreatedDate(f),
FieldseekerStormdrainMods.RandomLastEditedUser(f),
FieldseekerStormdrainMods.RandomLastEditedDate(f),
FieldseekerStormdrainMods.RandomLaststatus(f),
FieldseekerStormdrainMods.RandomZone(f),
FieldseekerStormdrainMods.RandomZone2(f),
FieldseekerStormdrainMods.RandomCreationdate(f),
FieldseekerStormdrainMods.RandomCreator(f),
FieldseekerStormdrainMods.RandomEditdate(f),
FieldseekerStormdrainMods.RandomEditor(f),
FieldseekerStormdrainMods.RandomType(f),
FieldseekerStormdrainMods.RandomJurisdiction(f),
}
}
// Set the model columns to this value
func (m fieldseekerStormdrainMods) Objectid(val int64) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Objectid = func() int64 { return val }
})
}
// Set the Column from the function
func (m fieldseekerStormdrainMods) ObjectidFunc(f func() int64) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Objectid = f
})
}
// Clear any values for the column
func (m fieldseekerStormdrainMods) UnsetObjectid() FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
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 fieldseekerStormdrainMods) RandomObjectid(f *faker.Faker) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Objectid = func() int64 {
return random_int64(f)
}
})
}
// Set the model columns to this value
func (m fieldseekerStormdrainMods) Nexttreatmentdate(val null.Val[time.Time]) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Nexttreatmentdate = func() null.Val[time.Time] { return val }
})
}
// Set the Column from the function
func (m fieldseekerStormdrainMods) NexttreatmentdateFunc(f func() null.Val[time.Time]) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Nexttreatmentdate = f
})
}
// Clear any values for the column
func (m fieldseekerStormdrainMods) UnsetNexttreatmentdate() FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Nexttreatmentdate = 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 fieldseekerStormdrainMods) RandomNexttreatmentdate(f *faker.Faker) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Nexttreatmentdate = func() null.Val[time.Time] {
if f == nil {
f = &defaultFaker
}
val := random_time_Time(f)
return null.From(val)
}
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m fieldseekerStormdrainMods) RandomNexttreatmentdateNotNull(f *faker.Faker) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Nexttreatmentdate = func() null.Val[time.Time] {
if f == nil {
f = &defaultFaker
}
val := random_time_Time(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m fieldseekerStormdrainMods) Lasttreatdate(val null.Val[time.Time]) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Lasttreatdate = func() null.Val[time.Time] { return val }
})
}
// Set the Column from the function
func (m fieldseekerStormdrainMods) LasttreatdateFunc(f func() null.Val[time.Time]) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Lasttreatdate = f
})
}
// Clear any values for the column
func (m fieldseekerStormdrainMods) UnsetLasttreatdate() FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Lasttreatdate = 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 fieldseekerStormdrainMods) RandomLasttreatdate(f *faker.Faker) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Lasttreatdate = func() null.Val[time.Time] {
if f == nil {
f = &defaultFaker
}
val := random_time_Time(f)
return null.From(val)
}
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m fieldseekerStormdrainMods) RandomLasttreatdateNotNull(f *faker.Faker) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Lasttreatdate = func() null.Val[time.Time] {
if f == nil {
f = &defaultFaker
}
val := random_time_Time(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m fieldseekerStormdrainMods) Lastaction(val null.Val[string]) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Lastaction = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m fieldseekerStormdrainMods) LastactionFunc(f func() null.Val[string]) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Lastaction = f
})
}
// Clear any values for the column
func (m fieldseekerStormdrainMods) UnsetLastaction() FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Lastaction = 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 fieldseekerStormdrainMods) RandomLastaction(f *faker.Faker) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Lastaction = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "25")
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 fieldseekerStormdrainMods) RandomLastactionNotNull(f *faker.Faker) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Lastaction = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "25")
return null.From(val)
}
})
}
// Set the model columns to this value
func (m fieldseekerStormdrainMods) Symbology(val null.Val[enums.FieldseekerStormdrainStormdrainsymbologyEnum]) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Symbology = func() null.Val[enums.FieldseekerStormdrainStormdrainsymbologyEnum] { return val }
})
}
// Set the Column from the function
func (m fieldseekerStormdrainMods) SymbologyFunc(f func() null.Val[enums.FieldseekerStormdrainStormdrainsymbologyEnum]) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Symbology = f
})
}
// Clear any values for the column
func (m fieldseekerStormdrainMods) UnsetSymbology() FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Symbology = 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 fieldseekerStormdrainMods) RandomSymbology(f *faker.Faker) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Symbology = func() null.Val[enums.FieldseekerStormdrainStormdrainsymbologyEnum] {
if f == nil {
f = &defaultFaker
}
val := random_enums_FieldseekerStormdrainStormdrainsymbologyEnum(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 fieldseekerStormdrainMods) RandomSymbologyNotNull(f *faker.Faker) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Symbology = func() null.Val[enums.FieldseekerStormdrainStormdrainsymbologyEnum] {
if f == nil {
f = &defaultFaker
}
val := random_enums_FieldseekerStormdrainStormdrainsymbologyEnum(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m fieldseekerStormdrainMods) Globalid(val null.Val[uuid.UUID]) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Globalid = func() null.Val[uuid.UUID] { return val }
})
}
// Set the Column from the function
func (m fieldseekerStormdrainMods) GlobalidFunc(f func() null.Val[uuid.UUID]) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Globalid = f
})
}
// Clear any values for the column
func (m fieldseekerStormdrainMods) UnsetGlobalid() FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
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 fieldseekerStormdrainMods) RandomGlobalid(f *faker.Faker) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Globalid = func() null.Val[uuid.UUID] {
if f == nil {
f = &defaultFaker
}
val := random_uuid_UUID(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 fieldseekerStormdrainMods) RandomGlobalidNotNull(f *faker.Faker) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Globalid = func() null.Val[uuid.UUID] {
if f == nil {
f = &defaultFaker
}
val := random_uuid_UUID(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m fieldseekerStormdrainMods) CreatedUser(val null.Val[string]) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.CreatedUser = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m fieldseekerStormdrainMods) CreatedUserFunc(f func() null.Val[string]) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.CreatedUser = f
})
}
// Clear any values for the column
func (m fieldseekerStormdrainMods) UnsetCreatedUser() FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
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 fieldseekerStormdrainMods) RandomCreatedUser(f *faker.Faker) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.CreatedUser = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "255")
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 fieldseekerStormdrainMods) RandomCreatedUserNotNull(f *faker.Faker) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.CreatedUser = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "255")
return null.From(val)
}
})
}
// Set the model columns to this value
func (m fieldseekerStormdrainMods) CreatedDate(val null.Val[time.Time]) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.CreatedDate = func() null.Val[time.Time] { return val }
})
}
// Set the Column from the function
func (m fieldseekerStormdrainMods) CreatedDateFunc(f func() null.Val[time.Time]) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.CreatedDate = f
})
}
// Clear any values for the column
func (m fieldseekerStormdrainMods) UnsetCreatedDate() FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
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 fieldseekerStormdrainMods) RandomCreatedDate(f *faker.Faker) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.CreatedDate = func() null.Val[time.Time] {
if f == nil {
f = &defaultFaker
}
val := random_time_Time(f)
return null.From(val)
}
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m fieldseekerStormdrainMods) RandomCreatedDateNotNull(f *faker.Faker) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.CreatedDate = func() null.Val[time.Time] {
if f == nil {
f = &defaultFaker
}
val := random_time_Time(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m fieldseekerStormdrainMods) LastEditedUser(val null.Val[string]) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.LastEditedUser = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m fieldseekerStormdrainMods) LastEditedUserFunc(f func() null.Val[string]) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.LastEditedUser = f
})
}
// Clear any values for the column
func (m fieldseekerStormdrainMods) UnsetLastEditedUser() FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
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 fieldseekerStormdrainMods) RandomLastEditedUser(f *faker.Faker) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.LastEditedUser = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "255")
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 fieldseekerStormdrainMods) RandomLastEditedUserNotNull(f *faker.Faker) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.LastEditedUser = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "255")
return null.From(val)
}
})
}
// Set the model columns to this value
func (m fieldseekerStormdrainMods) LastEditedDate(val null.Val[time.Time]) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.LastEditedDate = func() null.Val[time.Time] { return val }
})
}
// Set the Column from the function
func (m fieldseekerStormdrainMods) LastEditedDateFunc(f func() null.Val[time.Time]) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.LastEditedDate = f
})
}
// Clear any values for the column
func (m fieldseekerStormdrainMods) UnsetLastEditedDate() FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
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 fieldseekerStormdrainMods) RandomLastEditedDate(f *faker.Faker) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.LastEditedDate = func() null.Val[time.Time] {
if f == nil {
f = &defaultFaker
}
val := random_time_Time(f)
return null.From(val)
}
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m fieldseekerStormdrainMods) RandomLastEditedDateNotNull(f *faker.Faker) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.LastEditedDate = func() null.Val[time.Time] {
if f == nil {
f = &defaultFaker
}
val := random_time_Time(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m fieldseekerStormdrainMods) Laststatus(val null.Val[string]) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Laststatus = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m fieldseekerStormdrainMods) LaststatusFunc(f func() null.Val[string]) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Laststatus = f
})
}
// Clear any values for the column
func (m fieldseekerStormdrainMods) UnsetLaststatus() FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Laststatus = 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 fieldseekerStormdrainMods) RandomLaststatus(f *faker.Faker) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Laststatus = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "25")
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 fieldseekerStormdrainMods) RandomLaststatusNotNull(f *faker.Faker) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Laststatus = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "25")
return null.From(val)
}
})
}
// Set the model columns to this value
func (m fieldseekerStormdrainMods) Zone(val null.Val[string]) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Zone = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m fieldseekerStormdrainMods) ZoneFunc(f func() null.Val[string]) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Zone = f
})
}
// Clear any values for the column
func (m fieldseekerStormdrainMods) UnsetZone() FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Zone = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is sometimes null
func (m fieldseekerStormdrainMods) RandomZone(f *faker.Faker) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Zone = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "25")
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 fieldseekerStormdrainMods) RandomZoneNotNull(f *faker.Faker) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Zone = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "25")
return null.From(val)
}
})
}
// Set the model columns to this value
func (m fieldseekerStormdrainMods) Zone2(val null.Val[string]) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Zone2 = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m fieldseekerStormdrainMods) Zone2Func(f func() null.Val[string]) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Zone2 = f
})
}
// Clear any values for the column
func (m fieldseekerStormdrainMods) UnsetZone2() FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Zone2 = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is sometimes null
func (m fieldseekerStormdrainMods) RandomZone2(f *faker.Faker) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Zone2 = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "25")
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 fieldseekerStormdrainMods) RandomZone2NotNull(f *faker.Faker) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Zone2 = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "25")
return null.From(val)
}
})
}
// Set the model columns to this value
func (m fieldseekerStormdrainMods) Creationdate(val null.Val[time.Time]) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Creationdate = func() null.Val[time.Time] { return val }
})
}
// Set the Column from the function
func (m fieldseekerStormdrainMods) CreationdateFunc(f func() null.Val[time.Time]) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Creationdate = f
})
}
// Clear any values for the column
func (m fieldseekerStormdrainMods) UnsetCreationdate() FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
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 fieldseekerStormdrainMods) RandomCreationdate(f *faker.Faker) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Creationdate = func() null.Val[time.Time] {
if f == nil {
f = &defaultFaker
}
val := random_time_Time(f)
return null.From(val)
}
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m fieldseekerStormdrainMods) RandomCreationdateNotNull(f *faker.Faker) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Creationdate = func() null.Val[time.Time] {
if f == nil {
f = &defaultFaker
}
val := random_time_Time(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m fieldseekerStormdrainMods) Creator(val null.Val[string]) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Creator = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m fieldseekerStormdrainMods) CreatorFunc(f func() null.Val[string]) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Creator = f
})
}
// Clear any values for the column
func (m fieldseekerStormdrainMods) UnsetCreator() FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
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 fieldseekerStormdrainMods) RandomCreator(f *faker.Faker) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Creator = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "128")
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 fieldseekerStormdrainMods) RandomCreatorNotNull(f *faker.Faker) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Creator = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "128")
return null.From(val)
}
})
}
// Set the model columns to this value
func (m fieldseekerStormdrainMods) Editdate(val null.Val[time.Time]) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Editdate = func() null.Val[time.Time] { return val }
})
}
// Set the Column from the function
func (m fieldseekerStormdrainMods) EditdateFunc(f func() null.Val[time.Time]) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Editdate = f
})
}
// Clear any values for the column
func (m fieldseekerStormdrainMods) UnsetEditdate() FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
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 fieldseekerStormdrainMods) RandomEditdate(f *faker.Faker) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Editdate = func() null.Val[time.Time] {
if f == nil {
f = &defaultFaker
}
val := random_time_Time(f)
return null.From(val)
}
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m fieldseekerStormdrainMods) RandomEditdateNotNull(f *faker.Faker) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Editdate = func() null.Val[time.Time] {
if f == nil {
f = &defaultFaker
}
val := random_time_Time(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m fieldseekerStormdrainMods) Editor(val null.Val[string]) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Editor = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m fieldseekerStormdrainMods) EditorFunc(f func() null.Val[string]) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Editor = f
})
}
// Clear any values for the column
func (m fieldseekerStormdrainMods) UnsetEditor() FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
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 fieldseekerStormdrainMods) RandomEditor(f *faker.Faker) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Editor = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "128")
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 fieldseekerStormdrainMods) RandomEditorNotNull(f *faker.Faker) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Editor = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "128")
return null.From(val)
}
})
}
// Set the model columns to this value
func (m fieldseekerStormdrainMods) Type(val null.Val[string]) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Type = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m fieldseekerStormdrainMods) TypeFunc(f func() null.Val[string]) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Type = f
})
}
// Clear any values for the column
func (m fieldseekerStormdrainMods) UnsetType() FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Type = 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 fieldseekerStormdrainMods) RandomType(f *faker.Faker) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Type = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "25")
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 fieldseekerStormdrainMods) RandomTypeNotNull(f *faker.Faker) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Type = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "25")
return null.From(val)
}
})
}
// Set the model columns to this value
func (m fieldseekerStormdrainMods) Jurisdiction(val null.Val[string]) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Jurisdiction = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m fieldseekerStormdrainMods) JurisdictionFunc(f func() null.Val[string]) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Jurisdiction = f
})
}
// Clear any values for the column
func (m fieldseekerStormdrainMods) UnsetJurisdiction() FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Jurisdiction = 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 fieldseekerStormdrainMods) RandomJurisdiction(f *faker.Faker) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Jurisdiction = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "25")
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 fieldseekerStormdrainMods) RandomJurisdictionNotNull(f *faker.Faker) FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(_ context.Context, o *FieldseekerStormdrainTemplate) {
o.Jurisdiction = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "25")
return null.From(val)
}
})
}
func (m fieldseekerStormdrainMods) WithParentsCascading() FieldseekerStormdrainMod {
return FieldseekerStormdrainModFunc(func(ctx context.Context, o *FieldseekerStormdrainTemplate) {
if isDone, _ := fieldseekerStormdrainWithParentsCascadingCtx.Value(ctx); isDone {
return
}
ctx = fieldseekerStormdrainWithParentsCascadingCtx.WithValue(ctx, true)
})
}