nidus-sync/db/factory/import.district.bob.go
Eli Ribble 684c424131
Move imported districts to its own schema, add ref from organization
This will make it possible to assign reports to an organization
2026-01-16 14:43:26 +00:00

1684 lines
50 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 ImportDistrictMod interface {
Apply(context.Context, *ImportDistrictTemplate)
}
type ImportDistrictModFunc func(context.Context, *ImportDistrictTemplate)
func (f ImportDistrictModFunc) Apply(ctx context.Context, n *ImportDistrictTemplate) {
f(ctx, n)
}
type ImportDistrictModSlice []ImportDistrictMod
func (mods ImportDistrictModSlice) Apply(ctx context.Context, n *ImportDistrictTemplate) {
for _, f := range mods {
f.Apply(ctx, n)
}
}
// ImportDistrictTemplate is an object representing the database table.
// all columns are optional and should be set by mods
type ImportDistrictTemplate 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]
r importDistrictR
f *Factory
alreadyPersisted bool
}
type importDistrictR struct {
ImportDistrictGidOrganization *importDistrictRImportDistrictGidOrganizationR
}
type importDistrictRImportDistrictGidOrganizationR struct {
o *OrganizationTemplate
}
// Apply mods to the ImportDistrictTemplate
func (o *ImportDistrictTemplate) Apply(ctx context.Context, mods ...ImportDistrictMod) {
for _, mod := range mods {
mod.Apply(ctx, o)
}
}
// setModelRels creates and sets the relationships on *models.ImportDistrict
// according to the relationships in the template. Nothing is inserted into the db
func (t ImportDistrictTemplate) setModelRels(o *models.ImportDistrict) {
if t.r.ImportDistrictGidOrganization != nil {
rel := t.r.ImportDistrictGidOrganization.o.Build()
rel.R.ImportDistrictGidDistrict = o
rel.ImportDistrictGid = null.From(o.Gid) // h2
o.R.ImportDistrictGidOrganization = rel
}
}
// BuildSetter returns an *models.ImportDistrictSetter
// this does nothing with the relationship templates
func (o ImportDistrictTemplate) BuildSetter() *models.ImportDistrictSetter {
m := &models.ImportDistrictSetter{}
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.ImportDistrictSetter
// this does nothing with the relationship templates
func (o ImportDistrictTemplate) BuildManySetter(number int) []*models.ImportDistrictSetter {
m := make([]*models.ImportDistrictSetter, number)
for i := range m {
m[i] = o.BuildSetter()
}
return m
}
// Build returns an *models.ImportDistrict
// Related objects are also created and placed in the .R field
// NOTE: Objects are not inserted into the database. Use ImportDistrictTemplate.Create
func (o ImportDistrictTemplate) Build() *models.ImportDistrict {
m := &models.ImportDistrict{}
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.ImportDistrictSlice
// Related objects are also created and placed in the .R field
// NOTE: Objects are not inserted into the database. Use ImportDistrictTemplate.CreateMany
func (o ImportDistrictTemplate) BuildMany(number int) models.ImportDistrictSlice {
m := make(models.ImportDistrictSlice, number)
for i := range m {
m[i] = o.Build()
}
return m
}
func ensureCreatableImportDistrict(m *models.ImportDistrictSetter) {
}
// insertOptRels creates and inserts any optional the relationships on *models.ImportDistrict
// according to the relationships in the template.
// any required relationship should have already exist on the model
func (o *ImportDistrictTemplate) insertOptRels(ctx context.Context, exec bob.Executor, m *models.ImportDistrict) error {
var err error
isImportDistrictGidOrganizationDone, _ := importDistrictRelImportDistrictGidOrganizationCtx.Value(ctx)
if !isImportDistrictGidOrganizationDone && o.r.ImportDistrictGidOrganization != nil {
ctx = importDistrictRelImportDistrictGidOrganizationCtx.WithValue(ctx, true)
if o.r.ImportDistrictGidOrganization.o.alreadyPersisted {
m.R.ImportDistrictGidOrganization = o.r.ImportDistrictGidOrganization.o.Build()
} else {
var rel0 *models.Organization
rel0, err = o.r.ImportDistrictGidOrganization.o.Create(ctx, exec)
if err != nil {
return err
}
err = m.AttachImportDistrictGidOrganization(ctx, exec, rel0)
if err != nil {
return err
}
}
}
return err
}
// Create builds a importDistrict and inserts it into the database
// Relations objects are also inserted and placed in the .R field
func (o *ImportDistrictTemplate) Create(ctx context.Context, exec bob.Executor) (*models.ImportDistrict, error) {
var err error
opt := o.BuildSetter()
ensureCreatableImportDistrict(opt)
m, err := models.ImportDistricts.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 importDistrict and inserts it into the database
// Relations objects are also inserted and placed in the .R field
// panics if an error occurs
func (o *ImportDistrictTemplate) MustCreate(ctx context.Context, exec bob.Executor) *models.ImportDistrict {
m, err := o.Create(ctx, exec)
if err != nil {
panic(err)
}
return m
}
// CreateOrFail builds a importDistrict 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 *ImportDistrictTemplate) CreateOrFail(ctx context.Context, tb testing.TB, exec bob.Executor) *models.ImportDistrict {
tb.Helper()
m, err := o.Create(ctx, exec)
if err != nil {
tb.Fatal(err)
return nil
}
return m
}
// CreateMany builds multiple importDistricts and inserts them into the database
// Relations objects are also inserted and placed in the .R field
func (o ImportDistrictTemplate) CreateMany(ctx context.Context, exec bob.Executor, number int) (models.ImportDistrictSlice, error) {
var err error
m := make(models.ImportDistrictSlice, number)
for i := range m {
m[i], err = o.Create(ctx, exec)
if err != nil {
return nil, err
}
}
return m, nil
}
// MustCreateMany builds multiple importDistricts and inserts them into the database
// Relations objects are also inserted and placed in the .R field
// panics if an error occurs
func (o ImportDistrictTemplate) MustCreateMany(ctx context.Context, exec bob.Executor, number int) models.ImportDistrictSlice {
m, err := o.CreateMany(ctx, exec, number)
if err != nil {
panic(err)
}
return m
}
// CreateManyOrFail builds multiple importDistricts 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 ImportDistrictTemplate) CreateManyOrFail(ctx context.Context, tb testing.TB, exec bob.Executor, number int) models.ImportDistrictSlice {
tb.Helper()
m, err := o.CreateMany(ctx, exec, number)
if err != nil {
tb.Fatal(err)
return nil
}
return m
}
// ImportDistrict has methods that act as mods for the ImportDistrictTemplate
var ImportDistrictMods importDistrictMods
type importDistrictMods struct{}
func (m importDistrictMods) RandomizeAllColumns(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModSlice{
ImportDistrictMods.RandomGid(f),
ImportDistrictMods.RandomID(f),
ImportDistrictMods.RandomWebsite(f),
ImportDistrictMods.RandomContact(f),
ImportDistrictMods.RandomAddress(f),
ImportDistrictMods.RandomRegionid(f),
ImportDistrictMods.RandomPostalCod(f),
ImportDistrictMods.RandomPhone1(f),
ImportDistrictMods.RandomFax1(f),
ImportDistrictMods.RandomAgency(f),
ImportDistrictMods.RandomCode1(f),
ImportDistrictMods.RandomCity1(f),
ImportDistrictMods.RandomShapeLeng(f),
ImportDistrictMods.RandomAddress2(f),
ImportDistrictMods.RandomGeneralMG(f),
ImportDistrictMods.RandomCity2(f),
ImportDistrictMods.RandomPostalC1(f),
ImportDistrictMods.RandomFax2(f),
ImportDistrictMods.RandomPhone2(f),
ImportDistrictMods.RandomShapeLe1(f),
ImportDistrictMods.RandomShapeArea(f),
ImportDistrictMods.RandomGeom(f),
ImportDistrictMods.RandomGeom4326(f),
}
}
// Set the model columns to this value
func (m importDistrictMods) Gid(val int32) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.Gid = func() int32 { return val }
})
}
// Set the Column from the function
func (m importDistrictMods) GidFunc(f func() int32) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.Gid = f
})
}
// Clear any values for the column
func (m importDistrictMods) UnsetGid() ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) RandomGid(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.Gid = func() int32 {
return random_int32(f)
}
})
}
// Set the model columns to this value
func (m importDistrictMods) ID(val null.Val[decimal.Decimal]) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.ID = func() null.Val[decimal.Decimal] { return val }
})
}
// Set the Column from the function
func (m importDistrictMods) IDFunc(f func() null.Val[decimal.Decimal]) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.ID = f
})
}
// Clear any values for the column
func (m importDistrictMods) UnsetID() ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) RandomID(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) RandomIDNotNull(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) Website(val null.Val[string]) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.Website = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m importDistrictMods) WebsiteFunc(f func() null.Val[string]) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.Website = f
})
}
// Clear any values for the column
func (m importDistrictMods) UnsetWebsite() ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) RandomWebsite(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) RandomWebsiteNotNull(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) Contact(val null.Val[string]) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.Contact = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m importDistrictMods) ContactFunc(f func() null.Val[string]) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.Contact = f
})
}
// Clear any values for the column
func (m importDistrictMods) UnsetContact() ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) RandomContact(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) RandomContactNotNull(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) Address(val null.Val[string]) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.Address = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m importDistrictMods) AddressFunc(f func() null.Val[string]) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.Address = f
})
}
// Clear any values for the column
func (m importDistrictMods) UnsetAddress() ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) RandomAddress(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) RandomAddressNotNull(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) Regionid(val null.Val[decimal.Decimal]) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.Regionid = func() null.Val[decimal.Decimal] { return val }
})
}
// Set the Column from the function
func (m importDistrictMods) RegionidFunc(f func() null.Val[decimal.Decimal]) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.Regionid = f
})
}
// Clear any values for the column
func (m importDistrictMods) UnsetRegionid() ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) RandomRegionid(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) RandomRegionidNotNull(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) PostalCod(val null.Val[decimal.Decimal]) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.PostalCod = func() null.Val[decimal.Decimal] { return val }
})
}
// Set the Column from the function
func (m importDistrictMods) PostalCodFunc(f func() null.Val[decimal.Decimal]) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.PostalCod = f
})
}
// Clear any values for the column
func (m importDistrictMods) UnsetPostalCod() ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) RandomPostalCod(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) RandomPostalCodNotNull(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) Phone1(val null.Val[string]) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.Phone1 = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m importDistrictMods) Phone1Func(f func() null.Val[string]) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.Phone1 = f
})
}
// Clear any values for the column
func (m importDistrictMods) UnsetPhone1() ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) RandomPhone1(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) RandomPhone1NotNull(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) Fax1(val null.Val[string]) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.Fax1 = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m importDistrictMods) Fax1Func(f func() null.Val[string]) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.Fax1 = f
})
}
// Clear any values for the column
func (m importDistrictMods) UnsetFax1() ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) RandomFax1(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) RandomFax1NotNull(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) Agency(val null.Val[string]) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.Agency = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m importDistrictMods) AgencyFunc(f func() null.Val[string]) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.Agency = f
})
}
// Clear any values for the column
func (m importDistrictMods) UnsetAgency() ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) RandomAgency(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) RandomAgencyNotNull(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) Code1(val null.Val[string]) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.Code1 = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m importDistrictMods) Code1Func(f func() null.Val[string]) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.Code1 = f
})
}
// Clear any values for the column
func (m importDistrictMods) UnsetCode1() ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) RandomCode1(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) RandomCode1NotNull(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) City1(val null.Val[string]) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.City1 = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m importDistrictMods) City1Func(f func() null.Val[string]) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.City1 = f
})
}
// Clear any values for the column
func (m importDistrictMods) UnsetCity1() ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) RandomCity1(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) RandomCity1NotNull(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) ShapeLeng(val null.Val[decimal.Decimal]) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.ShapeLeng = func() null.Val[decimal.Decimal] { return val }
})
}
// Set the Column from the function
func (m importDistrictMods) ShapeLengFunc(f func() null.Val[decimal.Decimal]) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.ShapeLeng = f
})
}
// Clear any values for the column
func (m importDistrictMods) UnsetShapeLeng() ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) RandomShapeLeng(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) RandomShapeLengNotNull(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) Address2(val null.Val[string]) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.Address2 = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m importDistrictMods) Address2Func(f func() null.Val[string]) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.Address2 = f
})
}
// Clear any values for the column
func (m importDistrictMods) UnsetAddress2() ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) RandomAddress2(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) RandomAddress2NotNull(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) GeneralMG(val null.Val[string]) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.GeneralMG = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m importDistrictMods) GeneralMGFunc(f func() null.Val[string]) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.GeneralMG = f
})
}
// Clear any values for the column
func (m importDistrictMods) UnsetGeneralMG() ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) RandomGeneralMG(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) RandomGeneralMGNotNull(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) City2(val null.Val[string]) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.City2 = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m importDistrictMods) City2Func(f func() null.Val[string]) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.City2 = f
})
}
// Clear any values for the column
func (m importDistrictMods) UnsetCity2() ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) RandomCity2(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) RandomCity2NotNull(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) PostalC1(val null.Val[decimal.Decimal]) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.PostalC1 = func() null.Val[decimal.Decimal] { return val }
})
}
// Set the Column from the function
func (m importDistrictMods) PostalC1Func(f func() null.Val[decimal.Decimal]) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.PostalC1 = f
})
}
// Clear any values for the column
func (m importDistrictMods) UnsetPostalC1() ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) RandomPostalC1(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) RandomPostalC1NotNull(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) Fax2(val null.Val[string]) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.Fax2 = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m importDistrictMods) Fax2Func(f func() null.Val[string]) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.Fax2 = f
})
}
// Clear any values for the column
func (m importDistrictMods) UnsetFax2() ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) RandomFax2(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) RandomFax2NotNull(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) Phone2(val null.Val[string]) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.Phone2 = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m importDistrictMods) Phone2Func(f func() null.Val[string]) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.Phone2 = f
})
}
// Clear any values for the column
func (m importDistrictMods) UnsetPhone2() ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) RandomPhone2(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) RandomPhone2NotNull(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) ShapeLe1(val null.Val[decimal.Decimal]) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.ShapeLe1 = func() null.Val[decimal.Decimal] { return val }
})
}
// Set the Column from the function
func (m importDistrictMods) ShapeLe1Func(f func() null.Val[decimal.Decimal]) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.ShapeLe1 = f
})
}
// Clear any values for the column
func (m importDistrictMods) UnsetShapeLe1() ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) RandomShapeLe1(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) RandomShapeLe1NotNull(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) ShapeArea(val null.Val[decimal.Decimal]) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.ShapeArea = func() null.Val[decimal.Decimal] { return val }
})
}
// Set the Column from the function
func (m importDistrictMods) ShapeAreaFunc(f func() null.Val[decimal.Decimal]) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.ShapeArea = f
})
}
// Clear any values for the column
func (m importDistrictMods) UnsetShapeArea() ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) RandomShapeArea(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) RandomShapeAreaNotNull(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) Geom(val null.Val[string]) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.Geom = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m importDistrictMods) GeomFunc(f func() null.Val[string]) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.Geom = f
})
}
// Clear any values for the column
func (m importDistrictMods) UnsetGeom() ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) RandomGeom(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) RandomGeomNotNull(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) Geom4326(val null.Val[string]) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.Geom4326 = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m importDistrictMods) Geom4326Func(f func() null.Val[string]) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.Geom4326 = f
})
}
// Clear any values for the column
func (m importDistrictMods) UnsetGeom4326() ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) RandomGeom4326(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
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 importDistrictMods) RandomGeom4326NotNull(f *faker.Faker) ImportDistrictMod {
return ImportDistrictModFunc(func(_ context.Context, o *ImportDistrictTemplate) {
o.Geom4326 = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
}
})
}
func (m importDistrictMods) WithParentsCascading() ImportDistrictMod {
return ImportDistrictModFunc(func(ctx context.Context, o *ImportDistrictTemplate) {
if isDone, _ := importDistrictWithParentsCascadingCtx.Value(ctx); isDone {
return
}
ctx = importDistrictWithParentsCascadingCtx.WithValue(ctx, true)
{
related := o.f.NewOrganizationWithContext(ctx, OrganizationMods.WithParentsCascading())
m.WithImportDistrictGidOrganization(related).Apply(ctx, o)
}
})
}
func (m importDistrictMods) WithImportDistrictGidOrganization(rel *OrganizationTemplate) ImportDistrictMod {
return ImportDistrictModFunc(func(ctx context.Context, o *ImportDistrictTemplate) {
o.r.ImportDistrictGidOrganization = &importDistrictRImportDistrictGidOrganizationR{
o: rel,
}
})
}
func (m importDistrictMods) WithNewImportDistrictGidOrganization(mods ...OrganizationMod) ImportDistrictMod {
return ImportDistrictModFunc(func(ctx context.Context, o *ImportDistrictTemplate) {
related := o.f.NewOrganizationWithContext(ctx, mods...)
m.WithImportDistrictGidOrganization(related).Apply(ctx, o)
})
}
func (m importDistrictMods) WithExistingImportDistrictGidOrganization(em *models.Organization) ImportDistrictMod {
return ImportDistrictModFunc(func(ctx context.Context, o *ImportDistrictTemplate) {
o.r.ImportDistrictGidOrganization = &importDistrictRImportDistrictGidOrganizationR{
o: o.f.FromExistingOrganization(em),
}
})
}
func (m importDistrictMods) WithoutImportDistrictGidOrganization() ImportDistrictMod {
return ImportDistrictModFunc(func(ctx context.Context, o *ImportDistrictTemplate) {
o.r.ImportDistrictGidOrganization = nil
})
}