1237 lines
37 KiB
Go
1237 lines
37 KiB
Go
|
|
// Code generated by BobGen psql v0.41.1. DO NOT EDIT.
|
||
|
|
// This file is meant to be re-generated in place and/or deleted at any time.
|
||
|
|
|
||
|
|
package factory
|
||
|
|
|
||
|
|
import (
|
||
|
|
"context"
|
||
|
|
"testing"
|
||
|
|
"time"
|
||
|
|
|
||
|
|
models "github.com/Gleipnir-Technology/nidus-sync/models"
|
||
|
|
"github.com/aarondl/opt/null"
|
||
|
|
"github.com/aarondl/opt/omit"
|
||
|
|
"github.com/aarondl/opt/omitnull"
|
||
|
|
"github.com/jaswdr/faker/v2"
|
||
|
|
"github.com/stephenafamo/bob"
|
||
|
|
)
|
||
|
|
|
||
|
|
type FSHabitatrelateMod interface {
|
||
|
|
Apply(context.Context, *FSHabitatrelateTemplate)
|
||
|
|
}
|
||
|
|
|
||
|
|
type FSHabitatrelateModFunc func(context.Context, *FSHabitatrelateTemplate)
|
||
|
|
|
||
|
|
func (f FSHabitatrelateModFunc) Apply(ctx context.Context, n *FSHabitatrelateTemplate) {
|
||
|
|
f(ctx, n)
|
||
|
|
}
|
||
|
|
|
||
|
|
type FSHabitatrelateModSlice []FSHabitatrelateMod
|
||
|
|
|
||
|
|
func (mods FSHabitatrelateModSlice) Apply(ctx context.Context, n *FSHabitatrelateTemplate) {
|
||
|
|
for _, f := range mods {
|
||
|
|
f.Apply(ctx, n)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
// FSHabitatrelateTemplate is an object representing the database table.
|
||
|
|
// all columns are optional and should be set by mods
|
||
|
|
type FSHabitatrelateTemplate struct {
|
||
|
|
OrganizationID func() null.Val[int32]
|
||
|
|
Creationdate func() null.Val[int64]
|
||
|
|
Creator func() null.Val[string]
|
||
|
|
Editdate func() null.Val[int64]
|
||
|
|
Editor func() null.Val[string]
|
||
|
|
ForeignID func() null.Val[string]
|
||
|
|
Globalid func() null.Val[string]
|
||
|
|
Habitattype func() null.Val[string]
|
||
|
|
Objectid func() int32
|
||
|
|
CreatedDate func() null.Val[int64]
|
||
|
|
CreatedUser func() null.Val[string]
|
||
|
|
GeometryX func() null.Val[float64]
|
||
|
|
GeometryY func() null.Val[float64]
|
||
|
|
LastEditedDate func() null.Val[int64]
|
||
|
|
LastEditedUser func() null.Val[string]
|
||
|
|
Updated func() time.Time
|
||
|
|
|
||
|
|
r fsHabitatrelateR
|
||
|
|
f *Factory
|
||
|
|
|
||
|
|
alreadyPersisted bool
|
||
|
|
}
|
||
|
|
|
||
|
|
type fsHabitatrelateR struct {
|
||
|
|
Organization *fsHabitatrelateROrganizationR
|
||
|
|
}
|
||
|
|
|
||
|
|
type fsHabitatrelateROrganizationR struct {
|
||
|
|
o *OrganizationTemplate
|
||
|
|
}
|
||
|
|
|
||
|
|
// Apply mods to the FSHabitatrelateTemplate
|
||
|
|
func (o *FSHabitatrelateTemplate) Apply(ctx context.Context, mods ...FSHabitatrelateMod) {
|
||
|
|
for _, mod := range mods {
|
||
|
|
mod.Apply(ctx, o)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
// setModelRels creates and sets the relationships on *models.FSHabitatrelate
|
||
|
|
// according to the relationships in the template. Nothing is inserted into the db
|
||
|
|
func (t FSHabitatrelateTemplate) setModelRels(o *models.FSHabitatrelate) {
|
||
|
|
if t.r.Organization != nil {
|
||
|
|
rel := t.r.Organization.o.Build()
|
||
|
|
rel.R.FSHabitatrelates = append(rel.R.FSHabitatrelates, o)
|
||
|
|
o.OrganizationID = null.From(rel.ID) // h2
|
||
|
|
o.R.Organization = rel
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
// BuildSetter returns an *models.FSHabitatrelateSetter
|
||
|
|
// this does nothing with the relationship templates
|
||
|
|
func (o FSHabitatrelateTemplate) BuildSetter() *models.FSHabitatrelateSetter {
|
||
|
|
m := &models.FSHabitatrelateSetter{}
|
||
|
|
|
||
|
|
if o.OrganizationID != nil {
|
||
|
|
val := o.OrganizationID()
|
||
|
|
m.OrganizationID = omitnull.FromNull(val)
|
||
|
|
}
|
||
|
|
if o.Creationdate != nil {
|
||
|
|
val := o.Creationdate()
|
||
|
|
m.Creationdate = omitnull.FromNull(val)
|
||
|
|
}
|
||
|
|
if o.Creator != nil {
|
||
|
|
val := o.Creator()
|
||
|
|
m.Creator = omitnull.FromNull(val)
|
||
|
|
}
|
||
|
|
if o.Editdate != nil {
|
||
|
|
val := o.Editdate()
|
||
|
|
m.Editdate = omitnull.FromNull(val)
|
||
|
|
}
|
||
|
|
if o.Editor != nil {
|
||
|
|
val := o.Editor()
|
||
|
|
m.Editor = omitnull.FromNull(val)
|
||
|
|
}
|
||
|
|
if o.ForeignID != nil {
|
||
|
|
val := o.ForeignID()
|
||
|
|
m.ForeignID = omitnull.FromNull(val)
|
||
|
|
}
|
||
|
|
if o.Globalid != nil {
|
||
|
|
val := o.Globalid()
|
||
|
|
m.Globalid = omitnull.FromNull(val)
|
||
|
|
}
|
||
|
|
if o.Habitattype != nil {
|
||
|
|
val := o.Habitattype()
|
||
|
|
m.Habitattype = omitnull.FromNull(val)
|
||
|
|
}
|
||
|
|
if o.Objectid != nil {
|
||
|
|
val := o.Objectid()
|
||
|
|
m.Objectid = omit.From(val)
|
||
|
|
}
|
||
|
|
if o.CreatedDate != nil {
|
||
|
|
val := o.CreatedDate()
|
||
|
|
m.CreatedDate = omitnull.FromNull(val)
|
||
|
|
}
|
||
|
|
if o.CreatedUser != nil {
|
||
|
|
val := o.CreatedUser()
|
||
|
|
m.CreatedUser = omitnull.FromNull(val)
|
||
|
|
}
|
||
|
|
if o.GeometryX != nil {
|
||
|
|
val := o.GeometryX()
|
||
|
|
m.GeometryX = omitnull.FromNull(val)
|
||
|
|
}
|
||
|
|
if o.GeometryY != nil {
|
||
|
|
val := o.GeometryY()
|
||
|
|
m.GeometryY = omitnull.FromNull(val)
|
||
|
|
}
|
||
|
|
if o.LastEditedDate != nil {
|
||
|
|
val := o.LastEditedDate()
|
||
|
|
m.LastEditedDate = omitnull.FromNull(val)
|
||
|
|
}
|
||
|
|
if o.LastEditedUser != nil {
|
||
|
|
val := o.LastEditedUser()
|
||
|
|
m.LastEditedUser = omitnull.FromNull(val)
|
||
|
|
}
|
||
|
|
if o.Updated != nil {
|
||
|
|
val := o.Updated()
|
||
|
|
m.Updated = omit.From(val)
|
||
|
|
}
|
||
|
|
|
||
|
|
return m
|
||
|
|
}
|
||
|
|
|
||
|
|
// BuildManySetter returns an []*models.FSHabitatrelateSetter
|
||
|
|
// this does nothing with the relationship templates
|
||
|
|
func (o FSHabitatrelateTemplate) BuildManySetter(number int) []*models.FSHabitatrelateSetter {
|
||
|
|
m := make([]*models.FSHabitatrelateSetter, number)
|
||
|
|
|
||
|
|
for i := range m {
|
||
|
|
m[i] = o.BuildSetter()
|
||
|
|
}
|
||
|
|
|
||
|
|
return m
|
||
|
|
}
|
||
|
|
|
||
|
|
// Build returns an *models.FSHabitatrelate
|
||
|
|
// Related objects are also created and placed in the .R field
|
||
|
|
// NOTE: Objects are not inserted into the database. Use FSHabitatrelateTemplate.Create
|
||
|
|
func (o FSHabitatrelateTemplate) Build() *models.FSHabitatrelate {
|
||
|
|
m := &models.FSHabitatrelate{}
|
||
|
|
|
||
|
|
if o.OrganizationID != nil {
|
||
|
|
m.OrganizationID = o.OrganizationID()
|
||
|
|
}
|
||
|
|
if o.Creationdate != nil {
|
||
|
|
m.Creationdate = o.Creationdate()
|
||
|
|
}
|
||
|
|
if o.Creator != nil {
|
||
|
|
m.Creator = o.Creator()
|
||
|
|
}
|
||
|
|
if o.Editdate != nil {
|
||
|
|
m.Editdate = o.Editdate()
|
||
|
|
}
|
||
|
|
if o.Editor != nil {
|
||
|
|
m.Editor = o.Editor()
|
||
|
|
}
|
||
|
|
if o.ForeignID != nil {
|
||
|
|
m.ForeignID = o.ForeignID()
|
||
|
|
}
|
||
|
|
if o.Globalid != nil {
|
||
|
|
m.Globalid = o.Globalid()
|
||
|
|
}
|
||
|
|
if o.Habitattype != nil {
|
||
|
|
m.Habitattype = o.Habitattype()
|
||
|
|
}
|
||
|
|
if o.Objectid != nil {
|
||
|
|
m.Objectid = o.Objectid()
|
||
|
|
}
|
||
|
|
if o.CreatedDate != nil {
|
||
|
|
m.CreatedDate = o.CreatedDate()
|
||
|
|
}
|
||
|
|
if o.CreatedUser != nil {
|
||
|
|
m.CreatedUser = o.CreatedUser()
|
||
|
|
}
|
||
|
|
if o.GeometryX != nil {
|
||
|
|
m.GeometryX = o.GeometryX()
|
||
|
|
}
|
||
|
|
if o.GeometryY != nil {
|
||
|
|
m.GeometryY = o.GeometryY()
|
||
|
|
}
|
||
|
|
if o.LastEditedDate != nil {
|
||
|
|
m.LastEditedDate = o.LastEditedDate()
|
||
|
|
}
|
||
|
|
if o.LastEditedUser != nil {
|
||
|
|
m.LastEditedUser = o.LastEditedUser()
|
||
|
|
}
|
||
|
|
if o.Updated != nil {
|
||
|
|
m.Updated = o.Updated()
|
||
|
|
}
|
||
|
|
|
||
|
|
o.setModelRels(m)
|
||
|
|
|
||
|
|
return m
|
||
|
|
}
|
||
|
|
|
||
|
|
// BuildMany returns an models.FSHabitatrelateSlice
|
||
|
|
// Related objects are also created and placed in the .R field
|
||
|
|
// NOTE: Objects are not inserted into the database. Use FSHabitatrelateTemplate.CreateMany
|
||
|
|
func (o FSHabitatrelateTemplate) BuildMany(number int) models.FSHabitatrelateSlice {
|
||
|
|
m := make(models.FSHabitatrelateSlice, number)
|
||
|
|
|
||
|
|
for i := range m {
|
||
|
|
m[i] = o.Build()
|
||
|
|
}
|
||
|
|
|
||
|
|
return m
|
||
|
|
}
|
||
|
|
|
||
|
|
func ensureCreatableFSHabitatrelate(m *models.FSHabitatrelateSetter) {
|
||
|
|
if !(m.Objectid.IsValue()) {
|
||
|
|
val := random_int32(nil)
|
||
|
|
m.Objectid = omit.From(val)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
// insertOptRels creates and inserts any optional the relationships on *models.FSHabitatrelate
|
||
|
|
// according to the relationships in the template.
|
||
|
|
// any required relationship should have already exist on the model
|
||
|
|
func (o *FSHabitatrelateTemplate) insertOptRels(ctx context.Context, exec bob.Executor, m *models.FSHabitatrelate) error {
|
||
|
|
var err error
|
||
|
|
|
||
|
|
isOrganizationDone, _ := fsHabitatrelateRelOrganizationCtx.Value(ctx)
|
||
|
|
if !isOrganizationDone && o.r.Organization != nil {
|
||
|
|
ctx = fsHabitatrelateRelOrganizationCtx.WithValue(ctx, true)
|
||
|
|
if o.r.Organization.o.alreadyPersisted {
|
||
|
|
m.R.Organization = o.r.Organization.o.Build()
|
||
|
|
} else {
|
||
|
|
var rel0 *models.Organization
|
||
|
|
rel0, err = o.r.Organization.o.Create(ctx, exec)
|
||
|
|
if err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
err = m.AttachOrganization(ctx, exec, rel0)
|
||
|
|
if err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
|
||
|
|
// Create builds a fsHabitatrelate and inserts it into the database
|
||
|
|
// Relations objects are also inserted and placed in the .R field
|
||
|
|
func (o *FSHabitatrelateTemplate) Create(ctx context.Context, exec bob.Executor) (*models.FSHabitatrelate, error) {
|
||
|
|
var err error
|
||
|
|
opt := o.BuildSetter()
|
||
|
|
ensureCreatableFSHabitatrelate(opt)
|
||
|
|
|
||
|
|
m, err := models.FSHabitatrelates.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 fsHabitatrelate and inserts it into the database
|
||
|
|
// Relations objects are also inserted and placed in the .R field
|
||
|
|
// panics if an error occurs
|
||
|
|
func (o *FSHabitatrelateTemplate) MustCreate(ctx context.Context, exec bob.Executor) *models.FSHabitatrelate {
|
||
|
|
m, err := o.Create(ctx, exec)
|
||
|
|
if err != nil {
|
||
|
|
panic(err)
|
||
|
|
}
|
||
|
|
return m
|
||
|
|
}
|
||
|
|
|
||
|
|
// CreateOrFail builds a fsHabitatrelate 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 *FSHabitatrelateTemplate) CreateOrFail(ctx context.Context, tb testing.TB, exec bob.Executor) *models.FSHabitatrelate {
|
||
|
|
tb.Helper()
|
||
|
|
m, err := o.Create(ctx, exec)
|
||
|
|
if err != nil {
|
||
|
|
tb.Fatal(err)
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
return m
|
||
|
|
}
|
||
|
|
|
||
|
|
// CreateMany builds multiple fsHabitatrelates and inserts them into the database
|
||
|
|
// Relations objects are also inserted and placed in the .R field
|
||
|
|
func (o FSHabitatrelateTemplate) CreateMany(ctx context.Context, exec bob.Executor, number int) (models.FSHabitatrelateSlice, error) {
|
||
|
|
var err error
|
||
|
|
m := make(models.FSHabitatrelateSlice, number)
|
||
|
|
|
||
|
|
for i := range m {
|
||
|
|
m[i], err = o.Create(ctx, exec)
|
||
|
|
if err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
return m, nil
|
||
|
|
}
|
||
|
|
|
||
|
|
// MustCreateMany builds multiple fsHabitatrelates and inserts them into the database
|
||
|
|
// Relations objects are also inserted and placed in the .R field
|
||
|
|
// panics if an error occurs
|
||
|
|
func (o FSHabitatrelateTemplate) MustCreateMany(ctx context.Context, exec bob.Executor, number int) models.FSHabitatrelateSlice {
|
||
|
|
m, err := o.CreateMany(ctx, exec, number)
|
||
|
|
if err != nil {
|
||
|
|
panic(err)
|
||
|
|
}
|
||
|
|
return m
|
||
|
|
}
|
||
|
|
|
||
|
|
// CreateManyOrFail builds multiple fsHabitatrelates 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 FSHabitatrelateTemplate) CreateManyOrFail(ctx context.Context, tb testing.TB, exec bob.Executor, number int) models.FSHabitatrelateSlice {
|
||
|
|
tb.Helper()
|
||
|
|
m, err := o.CreateMany(ctx, exec, number)
|
||
|
|
if err != nil {
|
||
|
|
tb.Fatal(err)
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
return m
|
||
|
|
}
|
||
|
|
|
||
|
|
// FSHabitatrelate has methods that act as mods for the FSHabitatrelateTemplate
|
||
|
|
var FSHabitatrelateMods fsHabitatrelateMods
|
||
|
|
|
||
|
|
type fsHabitatrelateMods struct{}
|
||
|
|
|
||
|
|
func (m fsHabitatrelateMods) RandomizeAllColumns(f *faker.Faker) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModSlice{
|
||
|
|
FSHabitatrelateMods.RandomOrganizationID(f),
|
||
|
|
FSHabitatrelateMods.RandomCreationdate(f),
|
||
|
|
FSHabitatrelateMods.RandomCreator(f),
|
||
|
|
FSHabitatrelateMods.RandomEditdate(f),
|
||
|
|
FSHabitatrelateMods.RandomEditor(f),
|
||
|
|
FSHabitatrelateMods.RandomForeignID(f),
|
||
|
|
FSHabitatrelateMods.RandomGlobalid(f),
|
||
|
|
FSHabitatrelateMods.RandomHabitattype(f),
|
||
|
|
FSHabitatrelateMods.RandomObjectid(f),
|
||
|
|
FSHabitatrelateMods.RandomCreatedDate(f),
|
||
|
|
FSHabitatrelateMods.RandomCreatedUser(f),
|
||
|
|
FSHabitatrelateMods.RandomGeometryX(f),
|
||
|
|
FSHabitatrelateMods.RandomGeometryY(f),
|
||
|
|
FSHabitatrelateMods.RandomLastEditedDate(f),
|
||
|
|
FSHabitatrelateMods.RandomLastEditedUser(f),
|
||
|
|
FSHabitatrelateMods.RandomUpdated(f),
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
// Set the model columns to this value
|
||
|
|
func (m fsHabitatrelateMods) OrganizationID(val null.Val[int32]) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.OrganizationID = func() null.Val[int32] { return val }
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Set the Column from the function
|
||
|
|
func (m fsHabitatrelateMods) OrganizationIDFunc(f func() null.Val[int32]) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.OrganizationID = f
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Clear any values for the column
|
||
|
|
func (m fsHabitatrelateMods) UnsetOrganizationID() FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.OrganizationID = nil
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Generates a random value for the column using the given faker
|
||
|
|
// if faker is nil, a default faker is used
|
||
|
|
// The generated value is sometimes null
|
||
|
|
func (m fsHabitatrelateMods) RandomOrganizationID(f *faker.Faker) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.OrganizationID = func() null.Val[int32] {
|
||
|
|
if f == nil {
|
||
|
|
f = &defaultFaker
|
||
|
|
}
|
||
|
|
|
||
|
|
val := random_int32(f)
|
||
|
|
return null.From(val)
|
||
|
|
}
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Generates a random value for the column using the given faker
|
||
|
|
// if faker is nil, a default faker is used
|
||
|
|
// The generated value is never null
|
||
|
|
func (m fsHabitatrelateMods) RandomOrganizationIDNotNull(f *faker.Faker) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.OrganizationID = func() null.Val[int32] {
|
||
|
|
if f == nil {
|
||
|
|
f = &defaultFaker
|
||
|
|
}
|
||
|
|
|
||
|
|
val := random_int32(f)
|
||
|
|
return null.From(val)
|
||
|
|
}
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Set the model columns to this value
|
||
|
|
func (m fsHabitatrelateMods) Creationdate(val null.Val[int64]) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.Creationdate = func() null.Val[int64] { return val }
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Set the Column from the function
|
||
|
|
func (m fsHabitatrelateMods) CreationdateFunc(f func() null.Val[int64]) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.Creationdate = f
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Clear any values for the column
|
||
|
|
func (m fsHabitatrelateMods) UnsetCreationdate() FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.Creationdate = nil
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Generates a random value for the column using the given faker
|
||
|
|
// if faker is nil, a default faker is used
|
||
|
|
// The generated value is sometimes null
|
||
|
|
func (m fsHabitatrelateMods) RandomCreationdate(f *faker.Faker) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.Creationdate = func() null.Val[int64] {
|
||
|
|
if f == nil {
|
||
|
|
f = &defaultFaker
|
||
|
|
}
|
||
|
|
|
||
|
|
val := random_int64(f)
|
||
|
|
return null.From(val)
|
||
|
|
}
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Generates a random value for the column using the given faker
|
||
|
|
// if faker is nil, a default faker is used
|
||
|
|
// The generated value is never null
|
||
|
|
func (m fsHabitatrelateMods) RandomCreationdateNotNull(f *faker.Faker) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.Creationdate = func() null.Val[int64] {
|
||
|
|
if f == nil {
|
||
|
|
f = &defaultFaker
|
||
|
|
}
|
||
|
|
|
||
|
|
val := random_int64(f)
|
||
|
|
return null.From(val)
|
||
|
|
}
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Set the model columns to this value
|
||
|
|
func (m fsHabitatrelateMods) Creator(val null.Val[string]) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.Creator = func() null.Val[string] { return val }
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Set the Column from the function
|
||
|
|
func (m fsHabitatrelateMods) CreatorFunc(f func() null.Val[string]) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.Creator = f
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Clear any values for the column
|
||
|
|
func (m fsHabitatrelateMods) UnsetCreator() FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.Creator = nil
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Generates a random value for the column using the given faker
|
||
|
|
// if faker is nil, a default faker is used
|
||
|
|
// The generated value is sometimes null
|
||
|
|
func (m fsHabitatrelateMods) RandomCreator(f *faker.Faker) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.Creator = func() null.Val[string] {
|
||
|
|
if f == nil {
|
||
|
|
f = &defaultFaker
|
||
|
|
}
|
||
|
|
|
||
|
|
val := random_string(f)
|
||
|
|
return null.From(val)
|
||
|
|
}
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Generates a random value for the column using the given faker
|
||
|
|
// if faker is nil, a default faker is used
|
||
|
|
// The generated value is never null
|
||
|
|
func (m fsHabitatrelateMods) RandomCreatorNotNull(f *faker.Faker) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.Creator = func() null.Val[string] {
|
||
|
|
if f == nil {
|
||
|
|
f = &defaultFaker
|
||
|
|
}
|
||
|
|
|
||
|
|
val := random_string(f)
|
||
|
|
return null.From(val)
|
||
|
|
}
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Set the model columns to this value
|
||
|
|
func (m fsHabitatrelateMods) Editdate(val null.Val[int64]) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.Editdate = func() null.Val[int64] { return val }
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Set the Column from the function
|
||
|
|
func (m fsHabitatrelateMods) EditdateFunc(f func() null.Val[int64]) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.Editdate = f
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Clear any values for the column
|
||
|
|
func (m fsHabitatrelateMods) UnsetEditdate() FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.Editdate = nil
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Generates a random value for the column using the given faker
|
||
|
|
// if faker is nil, a default faker is used
|
||
|
|
// The generated value is sometimes null
|
||
|
|
func (m fsHabitatrelateMods) RandomEditdate(f *faker.Faker) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.Editdate = func() null.Val[int64] {
|
||
|
|
if f == nil {
|
||
|
|
f = &defaultFaker
|
||
|
|
}
|
||
|
|
|
||
|
|
val := random_int64(f)
|
||
|
|
return null.From(val)
|
||
|
|
}
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Generates a random value for the column using the given faker
|
||
|
|
// if faker is nil, a default faker is used
|
||
|
|
// The generated value is never null
|
||
|
|
func (m fsHabitatrelateMods) RandomEditdateNotNull(f *faker.Faker) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.Editdate = func() null.Val[int64] {
|
||
|
|
if f == nil {
|
||
|
|
f = &defaultFaker
|
||
|
|
}
|
||
|
|
|
||
|
|
val := random_int64(f)
|
||
|
|
return null.From(val)
|
||
|
|
}
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Set the model columns to this value
|
||
|
|
func (m fsHabitatrelateMods) Editor(val null.Val[string]) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.Editor = func() null.Val[string] { return val }
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Set the Column from the function
|
||
|
|
func (m fsHabitatrelateMods) EditorFunc(f func() null.Val[string]) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.Editor = f
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Clear any values for the column
|
||
|
|
func (m fsHabitatrelateMods) UnsetEditor() FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.Editor = nil
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Generates a random value for the column using the given faker
|
||
|
|
// if faker is nil, a default faker is used
|
||
|
|
// The generated value is sometimes null
|
||
|
|
func (m fsHabitatrelateMods) RandomEditor(f *faker.Faker) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.Editor = func() null.Val[string] {
|
||
|
|
if f == nil {
|
||
|
|
f = &defaultFaker
|
||
|
|
}
|
||
|
|
|
||
|
|
val := random_string(f)
|
||
|
|
return null.From(val)
|
||
|
|
}
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Generates a random value for the column using the given faker
|
||
|
|
// if faker is nil, a default faker is used
|
||
|
|
// The generated value is never null
|
||
|
|
func (m fsHabitatrelateMods) RandomEditorNotNull(f *faker.Faker) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.Editor = func() null.Val[string] {
|
||
|
|
if f == nil {
|
||
|
|
f = &defaultFaker
|
||
|
|
}
|
||
|
|
|
||
|
|
val := random_string(f)
|
||
|
|
return null.From(val)
|
||
|
|
}
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Set the model columns to this value
|
||
|
|
func (m fsHabitatrelateMods) ForeignID(val null.Val[string]) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.ForeignID = func() null.Val[string] { return val }
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Set the Column from the function
|
||
|
|
func (m fsHabitatrelateMods) ForeignIDFunc(f func() null.Val[string]) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.ForeignID = f
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Clear any values for the column
|
||
|
|
func (m fsHabitatrelateMods) UnsetForeignID() FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.ForeignID = 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 fsHabitatrelateMods) RandomForeignID(f *faker.Faker) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.ForeignID = 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 fsHabitatrelateMods) RandomForeignIDNotNull(f *faker.Faker) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.ForeignID = 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 fsHabitatrelateMods) Globalid(val null.Val[string]) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.Globalid = func() null.Val[string] { return val }
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Set the Column from the function
|
||
|
|
func (m fsHabitatrelateMods) GlobalidFunc(f func() null.Val[string]) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.Globalid = f
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Clear any values for the column
|
||
|
|
func (m fsHabitatrelateMods) UnsetGlobalid() FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.Globalid = nil
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Generates a random value for the column using the given faker
|
||
|
|
// if faker is nil, a default faker is used
|
||
|
|
// The generated value is sometimes null
|
||
|
|
func (m fsHabitatrelateMods) RandomGlobalid(f *faker.Faker) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.Globalid = func() null.Val[string] {
|
||
|
|
if f == nil {
|
||
|
|
f = &defaultFaker
|
||
|
|
}
|
||
|
|
|
||
|
|
val := random_string(f)
|
||
|
|
return null.From(val)
|
||
|
|
}
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Generates a random value for the column using the given faker
|
||
|
|
// if faker is nil, a default faker is used
|
||
|
|
// The generated value is never null
|
||
|
|
func (m fsHabitatrelateMods) RandomGlobalidNotNull(f *faker.Faker) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.Globalid = func() null.Val[string] {
|
||
|
|
if f == nil {
|
||
|
|
f = &defaultFaker
|
||
|
|
}
|
||
|
|
|
||
|
|
val := random_string(f)
|
||
|
|
return null.From(val)
|
||
|
|
}
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Set the model columns to this value
|
||
|
|
func (m fsHabitatrelateMods) Habitattype(val null.Val[string]) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.Habitattype = func() null.Val[string] { return val }
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Set the Column from the function
|
||
|
|
func (m fsHabitatrelateMods) HabitattypeFunc(f func() null.Val[string]) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.Habitattype = f
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Clear any values for the column
|
||
|
|
func (m fsHabitatrelateMods) UnsetHabitattype() FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.Habitattype = 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 fsHabitatrelateMods) RandomHabitattype(f *faker.Faker) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.Habitattype = 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 fsHabitatrelateMods) RandomHabitattypeNotNull(f *faker.Faker) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.Habitattype = 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 fsHabitatrelateMods) Objectid(val int32) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.Objectid = func() int32 { return val }
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Set the Column from the function
|
||
|
|
func (m fsHabitatrelateMods) ObjectidFunc(f func() int32) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.Objectid = f
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Clear any values for the column
|
||
|
|
func (m fsHabitatrelateMods) UnsetObjectid() FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.Objectid = nil
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Generates a random value for the column using the given faker
|
||
|
|
// if faker is nil, a default faker is used
|
||
|
|
func (m fsHabitatrelateMods) RandomObjectid(f *faker.Faker) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.Objectid = func() int32 {
|
||
|
|
return random_int32(f)
|
||
|
|
}
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Set the model columns to this value
|
||
|
|
func (m fsHabitatrelateMods) CreatedDate(val null.Val[int64]) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.CreatedDate = func() null.Val[int64] { return val }
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Set the Column from the function
|
||
|
|
func (m fsHabitatrelateMods) CreatedDateFunc(f func() null.Val[int64]) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.CreatedDate = f
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Clear any values for the column
|
||
|
|
func (m fsHabitatrelateMods) UnsetCreatedDate() FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.CreatedDate = nil
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Generates a random value for the column using the given faker
|
||
|
|
// if faker is nil, a default faker is used
|
||
|
|
// The generated value is sometimes null
|
||
|
|
func (m fsHabitatrelateMods) RandomCreatedDate(f *faker.Faker) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.CreatedDate = func() null.Val[int64] {
|
||
|
|
if f == nil {
|
||
|
|
f = &defaultFaker
|
||
|
|
}
|
||
|
|
|
||
|
|
val := random_int64(f)
|
||
|
|
return null.From(val)
|
||
|
|
}
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Generates a random value for the column using the given faker
|
||
|
|
// if faker is nil, a default faker is used
|
||
|
|
// The generated value is never null
|
||
|
|
func (m fsHabitatrelateMods) RandomCreatedDateNotNull(f *faker.Faker) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.CreatedDate = func() null.Val[int64] {
|
||
|
|
if f == nil {
|
||
|
|
f = &defaultFaker
|
||
|
|
}
|
||
|
|
|
||
|
|
val := random_int64(f)
|
||
|
|
return null.From(val)
|
||
|
|
}
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Set the model columns to this value
|
||
|
|
func (m fsHabitatrelateMods) CreatedUser(val null.Val[string]) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.CreatedUser = func() null.Val[string] { return val }
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Set the Column from the function
|
||
|
|
func (m fsHabitatrelateMods) CreatedUserFunc(f func() null.Val[string]) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.CreatedUser = f
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Clear any values for the column
|
||
|
|
func (m fsHabitatrelateMods) UnsetCreatedUser() FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.CreatedUser = nil
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Generates a random value for the column using the given faker
|
||
|
|
// if faker is nil, a default faker is used
|
||
|
|
// The generated value is sometimes null
|
||
|
|
func (m fsHabitatrelateMods) RandomCreatedUser(f *faker.Faker) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.CreatedUser = func() null.Val[string] {
|
||
|
|
if f == nil {
|
||
|
|
f = &defaultFaker
|
||
|
|
}
|
||
|
|
|
||
|
|
val := random_string(f)
|
||
|
|
return null.From(val)
|
||
|
|
}
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Generates a random value for the column using the given faker
|
||
|
|
// if faker is nil, a default faker is used
|
||
|
|
// The generated value is never null
|
||
|
|
func (m fsHabitatrelateMods) RandomCreatedUserNotNull(f *faker.Faker) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.CreatedUser = func() null.Val[string] {
|
||
|
|
if f == nil {
|
||
|
|
f = &defaultFaker
|
||
|
|
}
|
||
|
|
|
||
|
|
val := random_string(f)
|
||
|
|
return null.From(val)
|
||
|
|
}
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Set the model columns to this value
|
||
|
|
func (m fsHabitatrelateMods) GeometryX(val null.Val[float64]) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.GeometryX = func() null.Val[float64] { return val }
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Set the Column from the function
|
||
|
|
func (m fsHabitatrelateMods) GeometryXFunc(f func() null.Val[float64]) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.GeometryX = f
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Clear any values for the column
|
||
|
|
func (m fsHabitatrelateMods) UnsetGeometryX() FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.GeometryX = nil
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Generates a random value for the column using the given faker
|
||
|
|
// if faker is nil, a default faker is used
|
||
|
|
// The generated value is sometimes null
|
||
|
|
func (m fsHabitatrelateMods) RandomGeometryX(f *faker.Faker) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.GeometryX = func() null.Val[float64] {
|
||
|
|
if f == nil {
|
||
|
|
f = &defaultFaker
|
||
|
|
}
|
||
|
|
|
||
|
|
val := random_float64(f)
|
||
|
|
return null.From(val)
|
||
|
|
}
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Generates a random value for the column using the given faker
|
||
|
|
// if faker is nil, a default faker is used
|
||
|
|
// The generated value is never null
|
||
|
|
func (m fsHabitatrelateMods) RandomGeometryXNotNull(f *faker.Faker) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.GeometryX = func() null.Val[float64] {
|
||
|
|
if f == nil {
|
||
|
|
f = &defaultFaker
|
||
|
|
}
|
||
|
|
|
||
|
|
val := random_float64(f)
|
||
|
|
return null.From(val)
|
||
|
|
}
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Set the model columns to this value
|
||
|
|
func (m fsHabitatrelateMods) GeometryY(val null.Val[float64]) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.GeometryY = func() null.Val[float64] { return val }
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Set the Column from the function
|
||
|
|
func (m fsHabitatrelateMods) GeometryYFunc(f func() null.Val[float64]) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.GeometryY = f
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Clear any values for the column
|
||
|
|
func (m fsHabitatrelateMods) UnsetGeometryY() FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.GeometryY = nil
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Generates a random value for the column using the given faker
|
||
|
|
// if faker is nil, a default faker is used
|
||
|
|
// The generated value is sometimes null
|
||
|
|
func (m fsHabitatrelateMods) RandomGeometryY(f *faker.Faker) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.GeometryY = func() null.Val[float64] {
|
||
|
|
if f == nil {
|
||
|
|
f = &defaultFaker
|
||
|
|
}
|
||
|
|
|
||
|
|
val := random_float64(f)
|
||
|
|
return null.From(val)
|
||
|
|
}
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Generates a random value for the column using the given faker
|
||
|
|
// if faker is nil, a default faker is used
|
||
|
|
// The generated value is never null
|
||
|
|
func (m fsHabitatrelateMods) RandomGeometryYNotNull(f *faker.Faker) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.GeometryY = func() null.Val[float64] {
|
||
|
|
if f == nil {
|
||
|
|
f = &defaultFaker
|
||
|
|
}
|
||
|
|
|
||
|
|
val := random_float64(f)
|
||
|
|
return null.From(val)
|
||
|
|
}
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Set the model columns to this value
|
||
|
|
func (m fsHabitatrelateMods) LastEditedDate(val null.Val[int64]) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.LastEditedDate = func() null.Val[int64] { return val }
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Set the Column from the function
|
||
|
|
func (m fsHabitatrelateMods) LastEditedDateFunc(f func() null.Val[int64]) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.LastEditedDate = f
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Clear any values for the column
|
||
|
|
func (m fsHabitatrelateMods) UnsetLastEditedDate() FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.LastEditedDate = nil
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Generates a random value for the column using the given faker
|
||
|
|
// if faker is nil, a default faker is used
|
||
|
|
// The generated value is sometimes null
|
||
|
|
func (m fsHabitatrelateMods) RandomLastEditedDate(f *faker.Faker) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.LastEditedDate = func() null.Val[int64] {
|
||
|
|
if f == nil {
|
||
|
|
f = &defaultFaker
|
||
|
|
}
|
||
|
|
|
||
|
|
val := random_int64(f)
|
||
|
|
return null.From(val)
|
||
|
|
}
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Generates a random value for the column using the given faker
|
||
|
|
// if faker is nil, a default faker is used
|
||
|
|
// The generated value is never null
|
||
|
|
func (m fsHabitatrelateMods) RandomLastEditedDateNotNull(f *faker.Faker) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.LastEditedDate = func() null.Val[int64] {
|
||
|
|
if f == nil {
|
||
|
|
f = &defaultFaker
|
||
|
|
}
|
||
|
|
|
||
|
|
val := random_int64(f)
|
||
|
|
return null.From(val)
|
||
|
|
}
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Set the model columns to this value
|
||
|
|
func (m fsHabitatrelateMods) LastEditedUser(val null.Val[string]) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.LastEditedUser = func() null.Val[string] { return val }
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Set the Column from the function
|
||
|
|
func (m fsHabitatrelateMods) LastEditedUserFunc(f func() null.Val[string]) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.LastEditedUser = f
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Clear any values for the column
|
||
|
|
func (m fsHabitatrelateMods) UnsetLastEditedUser() FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.LastEditedUser = nil
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Generates a random value for the column using the given faker
|
||
|
|
// if faker is nil, a default faker is used
|
||
|
|
// The generated value is sometimes null
|
||
|
|
func (m fsHabitatrelateMods) RandomLastEditedUser(f *faker.Faker) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.LastEditedUser = func() null.Val[string] {
|
||
|
|
if f == nil {
|
||
|
|
f = &defaultFaker
|
||
|
|
}
|
||
|
|
|
||
|
|
val := random_string(f)
|
||
|
|
return null.From(val)
|
||
|
|
}
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Generates a random value for the column using the given faker
|
||
|
|
// if faker is nil, a default faker is used
|
||
|
|
// The generated value is never null
|
||
|
|
func (m fsHabitatrelateMods) RandomLastEditedUserNotNull(f *faker.Faker) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.LastEditedUser = func() null.Val[string] {
|
||
|
|
if f == nil {
|
||
|
|
f = &defaultFaker
|
||
|
|
}
|
||
|
|
|
||
|
|
val := random_string(f)
|
||
|
|
return null.From(val)
|
||
|
|
}
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Set the model columns to this value
|
||
|
|
func (m fsHabitatrelateMods) Updated(val time.Time) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.Updated = func() time.Time { return val }
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Set the Column from the function
|
||
|
|
func (m fsHabitatrelateMods) UpdatedFunc(f func() time.Time) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.Updated = f
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Clear any values for the column
|
||
|
|
func (m fsHabitatrelateMods) UnsetUpdated() FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.Updated = nil
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// Generates a random value for the column using the given faker
|
||
|
|
// if faker is nil, a default faker is used
|
||
|
|
func (m fsHabitatrelateMods) RandomUpdated(f *faker.Faker) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.Updated = func() time.Time {
|
||
|
|
return random_time_Time(f)
|
||
|
|
}
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m fsHabitatrelateMods) WithParentsCascading() FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(ctx context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
if isDone, _ := fsHabitatrelateWithParentsCascadingCtx.Value(ctx); isDone {
|
||
|
|
return
|
||
|
|
}
|
||
|
|
ctx = fsHabitatrelateWithParentsCascadingCtx.WithValue(ctx, true)
|
||
|
|
{
|
||
|
|
|
||
|
|
related := o.f.NewOrganizationWithContext(ctx, OrganizationMods.WithParentsCascading())
|
||
|
|
m.WithOrganization(related).Apply(ctx, o)
|
||
|
|
}
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m fsHabitatrelateMods) WithOrganization(rel *OrganizationTemplate) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(ctx context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.r.Organization = &fsHabitatrelateROrganizationR{
|
||
|
|
o: rel,
|
||
|
|
}
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m fsHabitatrelateMods) WithNewOrganization(mods ...OrganizationMod) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(ctx context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
related := o.f.NewOrganizationWithContext(ctx, mods...)
|
||
|
|
|
||
|
|
m.WithOrganization(related).Apply(ctx, o)
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m fsHabitatrelateMods) WithExistingOrganization(em *models.Organization) FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(ctx context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.r.Organization = &fsHabitatrelateROrganizationR{
|
||
|
|
o: o.f.FromExistingOrganization(em),
|
||
|
|
}
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
func (m fsHabitatrelateMods) WithoutOrganization() FSHabitatrelateMod {
|
||
|
|
return FSHabitatrelateModFunc(func(ctx context.Context, o *FSHabitatrelateTemplate) {
|
||
|
|
o.r.Organization = nil
|
||
|
|
})
|
||
|
|
}
|