nidus-sync/db/factory/district.bob.go
Eli Ribble 06140a9062
Remove bob submodule, add arcgis.user
I had to remove the submodule because of the go bug at
https://github.com/golang/go/issues/77196
I found the bug because of a bug in bob itself
https://github.com/stephenafamo/bob/issues/610
This was because I'm trying to save data about the Arcgis user for use
in determining if I can set up hooks to avoid the polling for data
changes.
2026-01-15 19:20:39 +00:00

1614 lines
44 KiB
Go

// Code generated by BobGen psql v0.42.1. DO NOT EDIT.
// This file is meant to be re-generated in place and/or deleted at any time.
package factory
import (
"context"
"testing"
models "github.com/Gleipnir-Technology/nidus-sync/db/models"
"github.com/aarondl/opt/null"
"github.com/aarondl/opt/omit"
"github.com/aarondl/opt/omitnull"
"github.com/jaswdr/faker/v2"
"github.com/shopspring/decimal"
"github.com/stephenafamo/bob"
)
type DistrictMod interface {
Apply(context.Context, *DistrictTemplate)
}
type DistrictModFunc func(context.Context, *DistrictTemplate)
func (f DistrictModFunc) Apply(ctx context.Context, n *DistrictTemplate) {
f(ctx, n)
}
type DistrictModSlice []DistrictMod
func (mods DistrictModSlice) Apply(ctx context.Context, n *DistrictTemplate) {
for _, f := range mods {
f.Apply(ctx, n)
}
}
// DistrictTemplate is an object representing the database table.
// all columns are optional and should be set by mods
type DistrictTemplate struct {
Gid func() int32
ID func() null.Val[decimal.Decimal]
Website func() null.Val[string]
Contact func() null.Val[string]
Address func() null.Val[string]
Regionid func() null.Val[decimal.Decimal]
PostalCod func() null.Val[decimal.Decimal]
Phone1 func() null.Val[string]
Fax1 func() null.Val[string]
Agency func() null.Val[string]
Code1 func() null.Val[string]
City1 func() null.Val[string]
ShapeLeng func() null.Val[decimal.Decimal]
Address2 func() null.Val[string]
GeneralMG func() null.Val[string]
City2 func() null.Val[string]
PostalC1 func() null.Val[decimal.Decimal]
Fax2 func() null.Val[string]
Phone2 func() null.Val[string]
ShapeLe1 func() null.Val[decimal.Decimal]
ShapeArea func() null.Val[decimal.Decimal]
Geom func() null.Val[string]
Geom4326 func() null.Val[string]
f *Factory
alreadyPersisted bool
}
// Apply mods to the DistrictTemplate
func (o *DistrictTemplate) Apply(ctx context.Context, mods ...DistrictMod) {
for _, mod := range mods {
mod.Apply(ctx, o)
}
}
// setModelRels creates and sets the relationships on *models.District
// according to the relationships in the template. Nothing is inserted into the db
func (t DistrictTemplate) setModelRels(o *models.District) {}
// BuildSetter returns an *models.DistrictSetter
// this does nothing with the relationship templates
func (o DistrictTemplate) BuildSetter() *models.DistrictSetter {
m := &models.DistrictSetter{}
if o.Gid != nil {
val := o.Gid()
m.Gid = omit.From(val)
}
if o.ID != nil {
val := o.ID()
m.ID = omitnull.FromNull(val)
}
if o.Website != nil {
val := o.Website()
m.Website = omitnull.FromNull(val)
}
if o.Contact != nil {
val := o.Contact()
m.Contact = omitnull.FromNull(val)
}
if o.Address != nil {
val := o.Address()
m.Address = omitnull.FromNull(val)
}
if o.Regionid != nil {
val := o.Regionid()
m.Regionid = omitnull.FromNull(val)
}
if o.PostalCod != nil {
val := o.PostalCod()
m.PostalCod = omitnull.FromNull(val)
}
if o.Phone1 != nil {
val := o.Phone1()
m.Phone1 = omitnull.FromNull(val)
}
if o.Fax1 != nil {
val := o.Fax1()
m.Fax1 = omitnull.FromNull(val)
}
if o.Agency != nil {
val := o.Agency()
m.Agency = omitnull.FromNull(val)
}
if o.Code1 != nil {
val := o.Code1()
m.Code1 = omitnull.FromNull(val)
}
if o.City1 != nil {
val := o.City1()
m.City1 = omitnull.FromNull(val)
}
if o.ShapeLeng != nil {
val := o.ShapeLeng()
m.ShapeLeng = omitnull.FromNull(val)
}
if o.Address2 != nil {
val := o.Address2()
m.Address2 = omitnull.FromNull(val)
}
if o.GeneralMG != nil {
val := o.GeneralMG()
m.GeneralMG = omitnull.FromNull(val)
}
if o.City2 != nil {
val := o.City2()
m.City2 = omitnull.FromNull(val)
}
if o.PostalC1 != nil {
val := o.PostalC1()
m.PostalC1 = omitnull.FromNull(val)
}
if o.Fax2 != nil {
val := o.Fax2()
m.Fax2 = omitnull.FromNull(val)
}
if o.Phone2 != nil {
val := o.Phone2()
m.Phone2 = omitnull.FromNull(val)
}
if o.ShapeLe1 != nil {
val := o.ShapeLe1()
m.ShapeLe1 = omitnull.FromNull(val)
}
if o.ShapeArea != nil {
val := o.ShapeArea()
m.ShapeArea = omitnull.FromNull(val)
}
if o.Geom != nil {
val := o.Geom()
m.Geom = omitnull.FromNull(val)
}
return m
}
// BuildManySetter returns an []*models.DistrictSetter
// this does nothing with the relationship templates
func (o DistrictTemplate) BuildManySetter(number int) []*models.DistrictSetter {
m := make([]*models.DistrictSetter, number)
for i := range m {
m[i] = o.BuildSetter()
}
return m
}
// Build returns an *models.District
// Related objects are also created and placed in the .R field
// NOTE: Objects are not inserted into the database. Use DistrictTemplate.Create
func (o DistrictTemplate) Build() *models.District {
m := &models.District{}
if o.Gid != nil {
m.Gid = o.Gid()
}
if o.ID != nil {
m.ID = o.ID()
}
if o.Website != nil {
m.Website = o.Website()
}
if o.Contact != nil {
m.Contact = o.Contact()
}
if o.Address != nil {
m.Address = o.Address()
}
if o.Regionid != nil {
m.Regionid = o.Regionid()
}
if o.PostalCod != nil {
m.PostalCod = o.PostalCod()
}
if o.Phone1 != nil {
m.Phone1 = o.Phone1()
}
if o.Fax1 != nil {
m.Fax1 = o.Fax1()
}
if o.Agency != nil {
m.Agency = o.Agency()
}
if o.Code1 != nil {
m.Code1 = o.Code1()
}
if o.City1 != nil {
m.City1 = o.City1()
}
if o.ShapeLeng != nil {
m.ShapeLeng = o.ShapeLeng()
}
if o.Address2 != nil {
m.Address2 = o.Address2()
}
if o.GeneralMG != nil {
m.GeneralMG = o.GeneralMG()
}
if o.City2 != nil {
m.City2 = o.City2()
}
if o.PostalC1 != nil {
m.PostalC1 = o.PostalC1()
}
if o.Fax2 != nil {
m.Fax2 = o.Fax2()
}
if o.Phone2 != nil {
m.Phone2 = o.Phone2()
}
if o.ShapeLe1 != nil {
m.ShapeLe1 = o.ShapeLe1()
}
if o.ShapeArea != nil {
m.ShapeArea = o.ShapeArea()
}
if o.Geom != nil {
m.Geom = o.Geom()
}
if o.Geom4326 != nil {
m.Geom4326 = o.Geom4326()
}
o.setModelRels(m)
return m
}
// BuildMany returns an models.DistrictSlice
// Related objects are also created and placed in the .R field
// NOTE: Objects are not inserted into the database. Use DistrictTemplate.CreateMany
func (o DistrictTemplate) BuildMany(number int) models.DistrictSlice {
m := make(models.DistrictSlice, number)
for i := range m {
m[i] = o.Build()
}
return m
}
func ensureCreatableDistrict(m *models.DistrictSetter) {
}
// insertOptRels creates and inserts any optional the relationships on *models.District
// according to the relationships in the template.
// any required relationship should have already exist on the model
func (o *DistrictTemplate) insertOptRels(ctx context.Context, exec bob.Executor, m *models.District) error {
var err error
return err
}
// Create builds a district and inserts it into the database
// Relations objects are also inserted and placed in the .R field
func (o *DistrictTemplate) Create(ctx context.Context, exec bob.Executor) (*models.District, error) {
var err error
opt := o.BuildSetter()
ensureCreatableDistrict(opt)
m, err := models.Districts.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 district and inserts it into the database
// Relations objects are also inserted and placed in the .R field
// panics if an error occurs
func (o *DistrictTemplate) MustCreate(ctx context.Context, exec bob.Executor) *models.District {
m, err := o.Create(ctx, exec)
if err != nil {
panic(err)
}
return m
}
// CreateOrFail builds a district 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 *DistrictTemplate) CreateOrFail(ctx context.Context, tb testing.TB, exec bob.Executor) *models.District {
tb.Helper()
m, err := o.Create(ctx, exec)
if err != nil {
tb.Fatal(err)
return nil
}
return m
}
// CreateMany builds multiple districts and inserts them into the database
// Relations objects are also inserted and placed in the .R field
func (o DistrictTemplate) CreateMany(ctx context.Context, exec bob.Executor, number int) (models.DistrictSlice, error) {
var err error
m := make(models.DistrictSlice, number)
for i := range m {
m[i], err = o.Create(ctx, exec)
if err != nil {
return nil, err
}
}
return m, nil
}
// MustCreateMany builds multiple districts and inserts them into the database
// Relations objects are also inserted and placed in the .R field
// panics if an error occurs
func (o DistrictTemplate) MustCreateMany(ctx context.Context, exec bob.Executor, number int) models.DistrictSlice {
m, err := o.CreateMany(ctx, exec, number)
if err != nil {
panic(err)
}
return m
}
// CreateManyOrFail builds multiple districts 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 DistrictTemplate) CreateManyOrFail(ctx context.Context, tb testing.TB, exec bob.Executor, number int) models.DistrictSlice {
tb.Helper()
m, err := o.CreateMany(ctx, exec, number)
if err != nil {
tb.Fatal(err)
return nil
}
return m
}
// District has methods that act as mods for the DistrictTemplate
var DistrictMods districtMods
type districtMods struct{}
func (m districtMods) RandomizeAllColumns(f *faker.Faker) DistrictMod {
return DistrictModSlice{
DistrictMods.RandomGid(f),
DistrictMods.RandomID(f),
DistrictMods.RandomWebsite(f),
DistrictMods.RandomContact(f),
DistrictMods.RandomAddress(f),
DistrictMods.RandomRegionid(f),
DistrictMods.RandomPostalCod(f),
DistrictMods.RandomPhone1(f),
DistrictMods.RandomFax1(f),
DistrictMods.RandomAgency(f),
DistrictMods.RandomCode1(f),
DistrictMods.RandomCity1(f),
DistrictMods.RandomShapeLeng(f),
DistrictMods.RandomAddress2(f),
DistrictMods.RandomGeneralMG(f),
DistrictMods.RandomCity2(f),
DistrictMods.RandomPostalC1(f),
DistrictMods.RandomFax2(f),
DistrictMods.RandomPhone2(f),
DistrictMods.RandomShapeLe1(f),
DistrictMods.RandomShapeArea(f),
DistrictMods.RandomGeom(f),
DistrictMods.RandomGeom4326(f),
}
}
// Set the model columns to this value
func (m districtMods) Gid(val int32) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Gid = func() int32 { return val }
})
}
// Set the Column from the function
func (m districtMods) GidFunc(f func() int32) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Gid = f
})
}
// Clear any values for the column
func (m districtMods) UnsetGid() DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Gid = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m districtMods) RandomGid(f *faker.Faker) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Gid = func() int32 {
return random_int32(f)
}
})
}
// Set the model columns to this value
func (m districtMods) ID(val null.Val[decimal.Decimal]) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.ID = func() null.Val[decimal.Decimal] { return val }
})
}
// Set the Column from the function
func (m districtMods) IDFunc(f func() null.Val[decimal.Decimal]) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.ID = f
})
}
// Clear any values for the column
func (m districtMods) UnsetID() DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.ID = 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 districtMods) RandomID(f *faker.Faker) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.ID = func() null.Val[decimal.Decimal] {
if f == nil {
f = &defaultFaker
}
val := random_decimal_Decimal(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 districtMods) RandomIDNotNull(f *faker.Faker) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.ID = func() null.Val[decimal.Decimal] {
if f == nil {
f = &defaultFaker
}
val := random_decimal_Decimal(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m districtMods) Website(val null.Val[string]) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Website = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m districtMods) WebsiteFunc(f func() null.Val[string]) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Website = f
})
}
// Clear any values for the column
func (m districtMods) UnsetWebsite() DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Website = 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 districtMods) RandomWebsite(f *faker.Faker) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Website = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "254")
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 districtMods) RandomWebsiteNotNull(f *faker.Faker) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Website = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "254")
return null.From(val)
}
})
}
// Set the model columns to this value
func (m districtMods) Contact(val null.Val[string]) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Contact = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m districtMods) ContactFunc(f func() null.Val[string]) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Contact = f
})
}
// Clear any values for the column
func (m districtMods) UnsetContact() DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Contact = 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 districtMods) RandomContact(f *faker.Faker) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Contact = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "254")
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 districtMods) RandomContactNotNull(f *faker.Faker) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Contact = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "254")
return null.From(val)
}
})
}
// Set the model columns to this value
func (m districtMods) Address(val null.Val[string]) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Address = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m districtMods) AddressFunc(f func() null.Val[string]) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Address = f
})
}
// Clear any values for the column
func (m districtMods) UnsetAddress() DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Address = 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 districtMods) RandomAddress(f *faker.Faker) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Address = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "254")
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 districtMods) RandomAddressNotNull(f *faker.Faker) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Address = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "254")
return null.From(val)
}
})
}
// Set the model columns to this value
func (m districtMods) Regionid(val null.Val[decimal.Decimal]) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Regionid = func() null.Val[decimal.Decimal] { return val }
})
}
// Set the Column from the function
func (m districtMods) RegionidFunc(f func() null.Val[decimal.Decimal]) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Regionid = f
})
}
// Clear any values for the column
func (m districtMods) UnsetRegionid() DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Regionid = 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 districtMods) RandomRegionid(f *faker.Faker) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Regionid = func() null.Val[decimal.Decimal] {
if f == nil {
f = &defaultFaker
}
val := random_decimal_Decimal(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 districtMods) RandomRegionidNotNull(f *faker.Faker) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Regionid = func() null.Val[decimal.Decimal] {
if f == nil {
f = &defaultFaker
}
val := random_decimal_Decimal(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m districtMods) PostalCod(val null.Val[decimal.Decimal]) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.PostalCod = func() null.Val[decimal.Decimal] { return val }
})
}
// Set the Column from the function
func (m districtMods) PostalCodFunc(f func() null.Val[decimal.Decimal]) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.PostalCod = f
})
}
// Clear any values for the column
func (m districtMods) UnsetPostalCod() DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.PostalCod = 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 districtMods) RandomPostalCod(f *faker.Faker) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.PostalCod = func() null.Val[decimal.Decimal] {
if f == nil {
f = &defaultFaker
}
val := random_decimal_Decimal(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 districtMods) RandomPostalCodNotNull(f *faker.Faker) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.PostalCod = func() null.Val[decimal.Decimal] {
if f == nil {
f = &defaultFaker
}
val := random_decimal_Decimal(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m districtMods) Phone1(val null.Val[string]) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Phone1 = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m districtMods) Phone1Func(f func() null.Val[string]) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Phone1 = f
})
}
// Clear any values for the column
func (m districtMods) UnsetPhone1() DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Phone1 = 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 districtMods) RandomPhone1(f *faker.Faker) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Phone1 = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "254")
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 districtMods) RandomPhone1NotNull(f *faker.Faker) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Phone1 = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "254")
return null.From(val)
}
})
}
// Set the model columns to this value
func (m districtMods) Fax1(val null.Val[string]) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Fax1 = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m districtMods) Fax1Func(f func() null.Val[string]) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Fax1 = f
})
}
// Clear any values for the column
func (m districtMods) UnsetFax1() DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Fax1 = 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 districtMods) RandomFax1(f *faker.Faker) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Fax1 = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "254")
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 districtMods) RandomFax1NotNull(f *faker.Faker) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Fax1 = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "254")
return null.From(val)
}
})
}
// Set the model columns to this value
func (m districtMods) Agency(val null.Val[string]) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Agency = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m districtMods) AgencyFunc(f func() null.Val[string]) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Agency = f
})
}
// Clear any values for the column
func (m districtMods) UnsetAgency() DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Agency = 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 districtMods) RandomAgency(f *faker.Faker) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Agency = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "254")
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 districtMods) RandomAgencyNotNull(f *faker.Faker) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Agency = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "254")
return null.From(val)
}
})
}
// Set the model columns to this value
func (m districtMods) Code1(val null.Val[string]) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Code1 = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m districtMods) Code1Func(f func() null.Val[string]) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Code1 = f
})
}
// Clear any values for the column
func (m districtMods) UnsetCode1() DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Code1 = 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 districtMods) RandomCode1(f *faker.Faker) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Code1 = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "254")
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 districtMods) RandomCode1NotNull(f *faker.Faker) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Code1 = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "254")
return null.From(val)
}
})
}
// Set the model columns to this value
func (m districtMods) City1(val null.Val[string]) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.City1 = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m districtMods) City1Func(f func() null.Val[string]) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.City1 = f
})
}
// Clear any values for the column
func (m districtMods) UnsetCity1() DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.City1 = 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 districtMods) RandomCity1(f *faker.Faker) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.City1 = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "254")
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 districtMods) RandomCity1NotNull(f *faker.Faker) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.City1 = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "254")
return null.From(val)
}
})
}
// Set the model columns to this value
func (m districtMods) ShapeLeng(val null.Val[decimal.Decimal]) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.ShapeLeng = func() null.Val[decimal.Decimal] { return val }
})
}
// Set the Column from the function
func (m districtMods) ShapeLengFunc(f func() null.Val[decimal.Decimal]) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.ShapeLeng = f
})
}
// Clear any values for the column
func (m districtMods) UnsetShapeLeng() DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.ShapeLeng = 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 districtMods) RandomShapeLeng(f *faker.Faker) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.ShapeLeng = func() null.Val[decimal.Decimal] {
if f == nil {
f = &defaultFaker
}
val := random_decimal_Decimal(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 districtMods) RandomShapeLengNotNull(f *faker.Faker) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.ShapeLeng = func() null.Val[decimal.Decimal] {
if f == nil {
f = &defaultFaker
}
val := random_decimal_Decimal(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m districtMods) Address2(val null.Val[string]) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Address2 = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m districtMods) Address2Func(f func() null.Val[string]) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Address2 = f
})
}
// Clear any values for the column
func (m districtMods) UnsetAddress2() DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Address2 = 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 districtMods) RandomAddress2(f *faker.Faker) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Address2 = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "254")
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 districtMods) RandomAddress2NotNull(f *faker.Faker) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Address2 = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "254")
return null.From(val)
}
})
}
// Set the model columns to this value
func (m districtMods) GeneralMG(val null.Val[string]) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.GeneralMG = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m districtMods) GeneralMGFunc(f func() null.Val[string]) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.GeneralMG = f
})
}
// Clear any values for the column
func (m districtMods) UnsetGeneralMG() DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.GeneralMG = 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 districtMods) RandomGeneralMG(f *faker.Faker) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.GeneralMG = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "254")
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 districtMods) RandomGeneralMGNotNull(f *faker.Faker) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.GeneralMG = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "254")
return null.From(val)
}
})
}
// Set the model columns to this value
func (m districtMods) City2(val null.Val[string]) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.City2 = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m districtMods) City2Func(f func() null.Val[string]) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.City2 = f
})
}
// Clear any values for the column
func (m districtMods) UnsetCity2() DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.City2 = 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 districtMods) RandomCity2(f *faker.Faker) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.City2 = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "254")
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 districtMods) RandomCity2NotNull(f *faker.Faker) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.City2 = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "254")
return null.From(val)
}
})
}
// Set the model columns to this value
func (m districtMods) PostalC1(val null.Val[decimal.Decimal]) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.PostalC1 = func() null.Val[decimal.Decimal] { return val }
})
}
// Set the Column from the function
func (m districtMods) PostalC1Func(f func() null.Val[decimal.Decimal]) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.PostalC1 = f
})
}
// Clear any values for the column
func (m districtMods) UnsetPostalC1() DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.PostalC1 = 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 districtMods) RandomPostalC1(f *faker.Faker) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.PostalC1 = func() null.Val[decimal.Decimal] {
if f == nil {
f = &defaultFaker
}
val := random_decimal_Decimal(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 districtMods) RandomPostalC1NotNull(f *faker.Faker) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.PostalC1 = func() null.Val[decimal.Decimal] {
if f == nil {
f = &defaultFaker
}
val := random_decimal_Decimal(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m districtMods) Fax2(val null.Val[string]) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Fax2 = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m districtMods) Fax2Func(f func() null.Val[string]) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Fax2 = f
})
}
// Clear any values for the column
func (m districtMods) UnsetFax2() DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Fax2 = 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 districtMods) RandomFax2(f *faker.Faker) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Fax2 = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "254")
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 districtMods) RandomFax2NotNull(f *faker.Faker) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Fax2 = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "254")
return null.From(val)
}
})
}
// Set the model columns to this value
func (m districtMods) Phone2(val null.Val[string]) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Phone2 = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m districtMods) Phone2Func(f func() null.Val[string]) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Phone2 = f
})
}
// Clear any values for the column
func (m districtMods) UnsetPhone2() DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Phone2 = 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 districtMods) RandomPhone2(f *faker.Faker) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Phone2 = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "254")
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 districtMods) RandomPhone2NotNull(f *faker.Faker) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Phone2 = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "254")
return null.From(val)
}
})
}
// Set the model columns to this value
func (m districtMods) ShapeLe1(val null.Val[decimal.Decimal]) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.ShapeLe1 = func() null.Val[decimal.Decimal] { return val }
})
}
// Set the Column from the function
func (m districtMods) ShapeLe1Func(f func() null.Val[decimal.Decimal]) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.ShapeLe1 = f
})
}
// Clear any values for the column
func (m districtMods) UnsetShapeLe1() DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.ShapeLe1 = 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 districtMods) RandomShapeLe1(f *faker.Faker) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.ShapeLe1 = func() null.Val[decimal.Decimal] {
if f == nil {
f = &defaultFaker
}
val := random_decimal_Decimal(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 districtMods) RandomShapeLe1NotNull(f *faker.Faker) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.ShapeLe1 = func() null.Val[decimal.Decimal] {
if f == nil {
f = &defaultFaker
}
val := random_decimal_Decimal(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m districtMods) ShapeArea(val null.Val[decimal.Decimal]) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.ShapeArea = func() null.Val[decimal.Decimal] { return val }
})
}
// Set the Column from the function
func (m districtMods) ShapeAreaFunc(f func() null.Val[decimal.Decimal]) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.ShapeArea = f
})
}
// Clear any values for the column
func (m districtMods) UnsetShapeArea() DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.ShapeArea = 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 districtMods) RandomShapeArea(f *faker.Faker) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.ShapeArea = func() null.Val[decimal.Decimal] {
if f == nil {
f = &defaultFaker
}
val := random_decimal_Decimal(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 districtMods) RandomShapeAreaNotNull(f *faker.Faker) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.ShapeArea = func() null.Val[decimal.Decimal] {
if f == nil {
f = &defaultFaker
}
val := random_decimal_Decimal(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m districtMods) Geom(val null.Val[string]) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Geom = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m districtMods) GeomFunc(f func() null.Val[string]) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Geom = f
})
}
// Clear any values for the column
func (m districtMods) UnsetGeom() DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Geom = 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 districtMods) RandomGeom(f *faker.Faker) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Geom = 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 districtMods) RandomGeomNotNull(f *faker.Faker) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Geom = 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 districtMods) Geom4326(val null.Val[string]) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Geom4326 = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m districtMods) Geom4326Func(f func() null.Val[string]) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Geom4326 = f
})
}
// Clear any values for the column
func (m districtMods) UnsetGeom4326() DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Geom4326 = 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 districtMods) RandomGeom4326(f *faker.Faker) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Geom4326 = 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 districtMods) RandomGeom4326NotNull(f *faker.Faker) DistrictMod {
return DistrictModFunc(func(_ context.Context, o *DistrictTemplate) {
o.Geom4326 = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
}
})
}
func (m districtMods) WithParentsCascading() DistrictMod {
return DistrictModFunc(func(ctx context.Context, o *DistrictTemplate) {
if isDone, _ := districtWithParentsCascadingCtx.Value(ctx); isDone {
return
}
ctx = districtWithParentsCascadingCtx.WithValue(ctx, true)
})
}