nidus-sync/db/factory/fieldseeker.locationtracking.bob.go
Eli Ribble 1aefca2f5d Make GlobalID required for all Fieldseeker tables
I'm pretty sure it has to be there, and it allows me to clean up my
code.
2026-01-05 02:28:28 +00:00

1181 lines
40 KiB
Go

// Code generated by BobGen psql v0.0.4-0.20260105020634-53e08d840e47+dirty. DO NOT EDIT.
// This file is meant to be re-generated in place and/or deleted at any time.
package factory
import (
"context"
"encoding/json"
"testing"
"time"
models "github.com/Gleipnir-Technology/nidus-sync/db/models"
"github.com/aarondl/opt/null"
"github.com/aarondl/opt/omit"
"github.com/aarondl/opt/omitnull"
"github.com/google/uuid"
"github.com/jaswdr/faker/v2"
"github.com/stephenafamo/bob"
"github.com/stephenafamo/bob/types"
)
type FieldseekerLocationtrackingMod interface {
Apply(context.Context, *FieldseekerLocationtrackingTemplate)
}
type FieldseekerLocationtrackingModFunc func(context.Context, *FieldseekerLocationtrackingTemplate)
func (f FieldseekerLocationtrackingModFunc) Apply(ctx context.Context, n *FieldseekerLocationtrackingTemplate) {
f(ctx, n)
}
type FieldseekerLocationtrackingModSlice []FieldseekerLocationtrackingMod
func (mods FieldseekerLocationtrackingModSlice) Apply(ctx context.Context, n *FieldseekerLocationtrackingTemplate) {
for _, f := range mods {
f.Apply(ctx, n)
}
}
// FieldseekerLocationtrackingTemplate is an object representing the database table.
// all columns are optional and should be set by mods
type FieldseekerLocationtrackingTemplate struct {
Objectid func() int64
Accuracy func() null.Val[float64]
CreatedUser func() null.Val[string]
CreatedDate func() null.Val[time.Time]
LastEditedUser func() null.Val[string]
LastEditedDate func() null.Val[time.Time]
Globalid func() uuid.UUID
Fieldtech func() null.Val[string]
Creationdate func() null.Val[time.Time]
Creator func() null.Val[string]
Editdate func() null.Val[time.Time]
Editor func() null.Val[string]
Geometry func() types.JSON[json.RawMessage]
Geospatial func() null.Val[string]
Version func() int32
OrganizationID func() int32
r fieldseekerLocationtrackingR
f *Factory
alreadyPersisted bool
}
type fieldseekerLocationtrackingR struct {
Organization *fieldseekerLocationtrackingROrganizationR
}
type fieldseekerLocationtrackingROrganizationR struct {
o *OrganizationTemplate
}
// Apply mods to the FieldseekerLocationtrackingTemplate
func (o *FieldseekerLocationtrackingTemplate) Apply(ctx context.Context, mods ...FieldseekerLocationtrackingMod) {
for _, mod := range mods {
mod.Apply(ctx, o)
}
}
// setModelRels creates and sets the relationships on *models.FieldseekerLocationtracking
// according to the relationships in the template. Nothing is inserted into the db
func (t FieldseekerLocationtrackingTemplate) setModelRels(o *models.FieldseekerLocationtracking) {
if t.r.Organization != nil {
rel := t.r.Organization.o.Build()
rel.R.Locationtrackings = append(rel.R.Locationtrackings, o)
o.OrganizationID = rel.ID // h2
o.R.Organization = rel
}
}
// BuildSetter returns an *models.FieldseekerLocationtrackingSetter
// this does nothing with the relationship templates
func (o FieldseekerLocationtrackingTemplate) BuildSetter() *models.FieldseekerLocationtrackingSetter {
m := &models.FieldseekerLocationtrackingSetter{}
if o.Objectid != nil {
val := o.Objectid()
m.Objectid = omit.From(val)
}
if o.Accuracy != nil {
val := o.Accuracy()
m.Accuracy = omitnull.FromNull(val)
}
if o.CreatedUser != nil {
val := o.CreatedUser()
m.CreatedUser = omitnull.FromNull(val)
}
if o.CreatedDate != nil {
val := o.CreatedDate()
m.CreatedDate = omitnull.FromNull(val)
}
if o.LastEditedUser != nil {
val := o.LastEditedUser()
m.LastEditedUser = omitnull.FromNull(val)
}
if o.LastEditedDate != nil {
val := o.LastEditedDate()
m.LastEditedDate = omitnull.FromNull(val)
}
if o.Globalid != nil {
val := o.Globalid()
m.Globalid = omit.From(val)
}
if o.Fieldtech != nil {
val := o.Fieldtech()
m.Fieldtech = 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.Geometry != nil {
val := o.Geometry()
m.Geometry = omit.From(val)
}
if o.Geospatial != nil {
val := o.Geospatial()
m.Geospatial = omitnull.FromNull(val)
}
if o.Version != nil {
val := o.Version()
m.Version = omit.From(val)
}
if o.OrganizationID != nil {
val := o.OrganizationID()
m.OrganizationID = omit.From(val)
}
return m
}
// BuildManySetter returns an []*models.FieldseekerLocationtrackingSetter
// this does nothing with the relationship templates
func (o FieldseekerLocationtrackingTemplate) BuildManySetter(number int) []*models.FieldseekerLocationtrackingSetter {
m := make([]*models.FieldseekerLocationtrackingSetter, number)
for i := range m {
m[i] = o.BuildSetter()
}
return m
}
// Build returns an *models.FieldseekerLocationtracking
// Related objects are also created and placed in the .R field
// NOTE: Objects are not inserted into the database. Use FieldseekerLocationtrackingTemplate.Create
func (o FieldseekerLocationtrackingTemplate) Build() *models.FieldseekerLocationtracking {
m := &models.FieldseekerLocationtracking{}
if o.Objectid != nil {
m.Objectid = o.Objectid()
}
if o.Accuracy != nil {
m.Accuracy = o.Accuracy()
}
if o.CreatedUser != nil {
m.CreatedUser = o.CreatedUser()
}
if o.CreatedDate != nil {
m.CreatedDate = o.CreatedDate()
}
if o.LastEditedUser != nil {
m.LastEditedUser = o.LastEditedUser()
}
if o.LastEditedDate != nil {
m.LastEditedDate = o.LastEditedDate()
}
if o.Globalid != nil {
m.Globalid = o.Globalid()
}
if o.Fieldtech != nil {
m.Fieldtech = o.Fieldtech()
}
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.Geometry != nil {
m.Geometry = o.Geometry()
}
if o.Geospatial != nil {
m.Geospatial = o.Geospatial()
}
if o.Version != nil {
m.Version = o.Version()
}
if o.OrganizationID != nil {
m.OrganizationID = o.OrganizationID()
}
o.setModelRels(m)
return m
}
// BuildMany returns an models.FieldseekerLocationtrackingSlice
// Related objects are also created and placed in the .R field
// NOTE: Objects are not inserted into the database. Use FieldseekerLocationtrackingTemplate.CreateMany
func (o FieldseekerLocationtrackingTemplate) BuildMany(number int) models.FieldseekerLocationtrackingSlice {
m := make(models.FieldseekerLocationtrackingSlice, number)
for i := range m {
m[i] = o.Build()
}
return m
}
func ensureCreatableFieldseekerLocationtracking(m *models.FieldseekerLocationtrackingSetter) {
if !(m.Globalid.IsValue()) {
val := random_uuid_UUID(nil)
m.Globalid = omit.From(val)
}
if !(m.Geometry.IsValue()) {
val := random_types_JSON_json_RawMessage_(nil)
m.Geometry = omit.From(val)
}
if !(m.OrganizationID.IsValue()) {
val := random_int32(nil)
m.OrganizationID = omit.From(val)
}
}
// insertOptRels creates and inserts any optional the relationships on *models.FieldseekerLocationtracking
// according to the relationships in the template.
// any required relationship should have already exist on the model
func (o *FieldseekerLocationtrackingTemplate) insertOptRels(ctx context.Context, exec bob.Executor, m *models.FieldseekerLocationtracking) error {
var err error
return err
}
// Create builds a fieldseekerLocationtracking and inserts it into the database
// Relations objects are also inserted and placed in the .R field
func (o *FieldseekerLocationtrackingTemplate) Create(ctx context.Context, exec bob.Executor) (*models.FieldseekerLocationtracking, error) {
var err error
opt := o.BuildSetter()
ensureCreatableFieldseekerLocationtracking(opt)
if o.r.Organization == nil {
FieldseekerLocationtrackingMods.WithNewOrganization().Apply(ctx, o)
}
var rel0 *models.Organization
if o.r.Organization.o.alreadyPersisted {
rel0 = o.r.Organization.o.Build()
} else {
rel0, err = o.r.Organization.o.Create(ctx, exec)
if err != nil {
return nil, err
}
}
opt.OrganizationID = omit.From(rel0.ID)
m, err := models.FieldseekerLocationtrackings.Insert(opt).One(ctx, exec)
if err != nil {
return nil, err
}
m.R.Organization = rel0
if err := o.insertOptRels(ctx, exec, m); err != nil {
return nil, err
}
return m, err
}
// MustCreate builds a fieldseekerLocationtracking and inserts it into the database
// Relations objects are also inserted and placed in the .R field
// panics if an error occurs
func (o *FieldseekerLocationtrackingTemplate) MustCreate(ctx context.Context, exec bob.Executor) *models.FieldseekerLocationtracking {
m, err := o.Create(ctx, exec)
if err != nil {
panic(err)
}
return m
}
// CreateOrFail builds a fieldseekerLocationtracking 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 *FieldseekerLocationtrackingTemplate) CreateOrFail(ctx context.Context, tb testing.TB, exec bob.Executor) *models.FieldseekerLocationtracking {
tb.Helper()
m, err := o.Create(ctx, exec)
if err != nil {
tb.Fatal(err)
return nil
}
return m
}
// CreateMany builds multiple fieldseekerLocationtrackings and inserts them into the database
// Relations objects are also inserted and placed in the .R field
func (o FieldseekerLocationtrackingTemplate) CreateMany(ctx context.Context, exec bob.Executor, number int) (models.FieldseekerLocationtrackingSlice, error) {
var err error
m := make(models.FieldseekerLocationtrackingSlice, number)
for i := range m {
m[i], err = o.Create(ctx, exec)
if err != nil {
return nil, err
}
}
return m, nil
}
// MustCreateMany builds multiple fieldseekerLocationtrackings and inserts them into the database
// Relations objects are also inserted and placed in the .R field
// panics if an error occurs
func (o FieldseekerLocationtrackingTemplate) MustCreateMany(ctx context.Context, exec bob.Executor, number int) models.FieldseekerLocationtrackingSlice {
m, err := o.CreateMany(ctx, exec, number)
if err != nil {
panic(err)
}
return m
}
// CreateManyOrFail builds multiple fieldseekerLocationtrackings 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 FieldseekerLocationtrackingTemplate) CreateManyOrFail(ctx context.Context, tb testing.TB, exec bob.Executor, number int) models.FieldseekerLocationtrackingSlice {
tb.Helper()
m, err := o.CreateMany(ctx, exec, number)
if err != nil {
tb.Fatal(err)
return nil
}
return m
}
// FieldseekerLocationtracking has methods that act as mods for the FieldseekerLocationtrackingTemplate
var FieldseekerLocationtrackingMods fieldseekerLocationtrackingMods
type fieldseekerLocationtrackingMods struct{}
func (m fieldseekerLocationtrackingMods) RandomizeAllColumns(f *faker.Faker) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModSlice{
FieldseekerLocationtrackingMods.RandomObjectid(f),
FieldseekerLocationtrackingMods.RandomAccuracy(f),
FieldseekerLocationtrackingMods.RandomCreatedUser(f),
FieldseekerLocationtrackingMods.RandomCreatedDate(f),
FieldseekerLocationtrackingMods.RandomLastEditedUser(f),
FieldseekerLocationtrackingMods.RandomLastEditedDate(f),
FieldseekerLocationtrackingMods.RandomGlobalid(f),
FieldseekerLocationtrackingMods.RandomFieldtech(f),
FieldseekerLocationtrackingMods.RandomCreationdate(f),
FieldseekerLocationtrackingMods.RandomCreator(f),
FieldseekerLocationtrackingMods.RandomEditdate(f),
FieldseekerLocationtrackingMods.RandomEditor(f),
FieldseekerLocationtrackingMods.RandomGeometry(f),
FieldseekerLocationtrackingMods.RandomGeospatial(f),
FieldseekerLocationtrackingMods.RandomVersion(f),
FieldseekerLocationtrackingMods.RandomOrganizationID(f),
}
}
// Set the model columns to this value
func (m fieldseekerLocationtrackingMods) Objectid(val int64) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Objectid = func() int64 { return val }
})
}
// Set the Column from the function
func (m fieldseekerLocationtrackingMods) ObjectidFunc(f func() int64) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Objectid = f
})
}
// Clear any values for the column
func (m fieldseekerLocationtrackingMods) UnsetObjectid() FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
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 fieldseekerLocationtrackingMods) RandomObjectid(f *faker.Faker) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Objectid = func() int64 {
return random_int64(f)
}
})
}
// Set the model columns to this value
func (m fieldseekerLocationtrackingMods) Accuracy(val null.Val[float64]) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Accuracy = func() null.Val[float64] { return val }
})
}
// Set the Column from the function
func (m fieldseekerLocationtrackingMods) AccuracyFunc(f func() null.Val[float64]) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Accuracy = f
})
}
// Clear any values for the column
func (m fieldseekerLocationtrackingMods) UnsetAccuracy() FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Accuracy = 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 fieldseekerLocationtrackingMods) RandomAccuracy(f *faker.Faker) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Accuracy = 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 fieldseekerLocationtrackingMods) RandomAccuracyNotNull(f *faker.Faker) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Accuracy = 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 fieldseekerLocationtrackingMods) CreatedUser(val null.Val[string]) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.CreatedUser = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m fieldseekerLocationtrackingMods) CreatedUserFunc(f func() null.Val[string]) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.CreatedUser = f
})
}
// Clear any values for the column
func (m fieldseekerLocationtrackingMods) UnsetCreatedUser() FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
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 fieldseekerLocationtrackingMods) RandomCreatedUser(f *faker.Faker) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.CreatedUser = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "255")
return null.From(val)
}
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m fieldseekerLocationtrackingMods) RandomCreatedUserNotNull(f *faker.Faker) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.CreatedUser = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "255")
return null.From(val)
}
})
}
// Set the model columns to this value
func (m fieldseekerLocationtrackingMods) CreatedDate(val null.Val[time.Time]) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.CreatedDate = func() null.Val[time.Time] { return val }
})
}
// Set the Column from the function
func (m fieldseekerLocationtrackingMods) CreatedDateFunc(f func() null.Val[time.Time]) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.CreatedDate = f
})
}
// Clear any values for the column
func (m fieldseekerLocationtrackingMods) UnsetCreatedDate() FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
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 fieldseekerLocationtrackingMods) RandomCreatedDate(f *faker.Faker) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.CreatedDate = func() null.Val[time.Time] {
if f == nil {
f = &defaultFaker
}
val := random_time_Time(f)
return null.From(val)
}
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m fieldseekerLocationtrackingMods) RandomCreatedDateNotNull(f *faker.Faker) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.CreatedDate = func() null.Val[time.Time] {
if f == nil {
f = &defaultFaker
}
val := random_time_Time(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m fieldseekerLocationtrackingMods) LastEditedUser(val null.Val[string]) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.LastEditedUser = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m fieldseekerLocationtrackingMods) LastEditedUserFunc(f func() null.Val[string]) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.LastEditedUser = f
})
}
// Clear any values for the column
func (m fieldseekerLocationtrackingMods) UnsetLastEditedUser() FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
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 fieldseekerLocationtrackingMods) RandomLastEditedUser(f *faker.Faker) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.LastEditedUser = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "255")
return null.From(val)
}
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m fieldseekerLocationtrackingMods) RandomLastEditedUserNotNull(f *faker.Faker) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.LastEditedUser = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "255")
return null.From(val)
}
})
}
// Set the model columns to this value
func (m fieldseekerLocationtrackingMods) LastEditedDate(val null.Val[time.Time]) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.LastEditedDate = func() null.Val[time.Time] { return val }
})
}
// Set the Column from the function
func (m fieldseekerLocationtrackingMods) LastEditedDateFunc(f func() null.Val[time.Time]) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.LastEditedDate = f
})
}
// Clear any values for the column
func (m fieldseekerLocationtrackingMods) UnsetLastEditedDate() FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
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 fieldseekerLocationtrackingMods) RandomLastEditedDate(f *faker.Faker) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.LastEditedDate = func() null.Val[time.Time] {
if f == nil {
f = &defaultFaker
}
val := random_time_Time(f)
return null.From(val)
}
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m fieldseekerLocationtrackingMods) RandomLastEditedDateNotNull(f *faker.Faker) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.LastEditedDate = func() null.Val[time.Time] {
if f == nil {
f = &defaultFaker
}
val := random_time_Time(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m fieldseekerLocationtrackingMods) Globalid(val uuid.UUID) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Globalid = func() uuid.UUID { return val }
})
}
// Set the Column from the function
func (m fieldseekerLocationtrackingMods) GlobalidFunc(f func() uuid.UUID) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Globalid = f
})
}
// Clear any values for the column
func (m fieldseekerLocationtrackingMods) UnsetGlobalid() FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Globalid = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m fieldseekerLocationtrackingMods) RandomGlobalid(f *faker.Faker) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Globalid = func() uuid.UUID {
return random_uuid_UUID(f)
}
})
}
// Set the model columns to this value
func (m fieldseekerLocationtrackingMods) Fieldtech(val null.Val[string]) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Fieldtech = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m fieldseekerLocationtrackingMods) FieldtechFunc(f func() null.Val[string]) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Fieldtech = f
})
}
// Clear any values for the column
func (m fieldseekerLocationtrackingMods) UnsetFieldtech() FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Fieldtech = 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 fieldseekerLocationtrackingMods) RandomFieldtech(f *faker.Faker) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Fieldtech = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "25")
return null.From(val)
}
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m fieldseekerLocationtrackingMods) RandomFieldtechNotNull(f *faker.Faker) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Fieldtech = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "25")
return null.From(val)
}
})
}
// Set the model columns to this value
func (m fieldseekerLocationtrackingMods) Creationdate(val null.Val[time.Time]) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Creationdate = func() null.Val[time.Time] { return val }
})
}
// Set the Column from the function
func (m fieldseekerLocationtrackingMods) CreationdateFunc(f func() null.Val[time.Time]) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Creationdate = f
})
}
// Clear any values for the column
func (m fieldseekerLocationtrackingMods) UnsetCreationdate() FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
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 fieldseekerLocationtrackingMods) RandomCreationdate(f *faker.Faker) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Creationdate = func() null.Val[time.Time] {
if f == nil {
f = &defaultFaker
}
val := random_time_Time(f)
return null.From(val)
}
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m fieldseekerLocationtrackingMods) RandomCreationdateNotNull(f *faker.Faker) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Creationdate = func() null.Val[time.Time] {
if f == nil {
f = &defaultFaker
}
val := random_time_Time(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m fieldseekerLocationtrackingMods) Creator(val null.Val[string]) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Creator = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m fieldseekerLocationtrackingMods) CreatorFunc(f func() null.Val[string]) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Creator = f
})
}
// Clear any values for the column
func (m fieldseekerLocationtrackingMods) UnsetCreator() FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
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 fieldseekerLocationtrackingMods) RandomCreator(f *faker.Faker) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Creator = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "128")
return null.From(val)
}
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m fieldseekerLocationtrackingMods) RandomCreatorNotNull(f *faker.Faker) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Creator = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "128")
return null.From(val)
}
})
}
// Set the model columns to this value
func (m fieldseekerLocationtrackingMods) Editdate(val null.Val[time.Time]) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Editdate = func() null.Val[time.Time] { return val }
})
}
// Set the Column from the function
func (m fieldseekerLocationtrackingMods) EditdateFunc(f func() null.Val[time.Time]) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Editdate = f
})
}
// Clear any values for the column
func (m fieldseekerLocationtrackingMods) UnsetEditdate() FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
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 fieldseekerLocationtrackingMods) RandomEditdate(f *faker.Faker) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Editdate = func() null.Val[time.Time] {
if f == nil {
f = &defaultFaker
}
val := random_time_Time(f)
return null.From(val)
}
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m fieldseekerLocationtrackingMods) RandomEditdateNotNull(f *faker.Faker) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Editdate = func() null.Val[time.Time] {
if f == nil {
f = &defaultFaker
}
val := random_time_Time(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m fieldseekerLocationtrackingMods) Editor(val null.Val[string]) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Editor = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m fieldseekerLocationtrackingMods) EditorFunc(f func() null.Val[string]) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Editor = f
})
}
// Clear any values for the column
func (m fieldseekerLocationtrackingMods) UnsetEditor() FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
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 fieldseekerLocationtrackingMods) RandomEditor(f *faker.Faker) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Editor = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "128")
return null.From(val)
}
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m fieldseekerLocationtrackingMods) RandomEditorNotNull(f *faker.Faker) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Editor = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "128")
return null.From(val)
}
})
}
// Set the model columns to this value
func (m fieldseekerLocationtrackingMods) Geometry(val types.JSON[json.RawMessage]) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Geometry = func() types.JSON[json.RawMessage] { return val }
})
}
// Set the Column from the function
func (m fieldseekerLocationtrackingMods) GeometryFunc(f func() types.JSON[json.RawMessage]) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Geometry = f
})
}
// Clear any values for the column
func (m fieldseekerLocationtrackingMods) UnsetGeometry() FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Geometry = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m fieldseekerLocationtrackingMods) RandomGeometry(f *faker.Faker) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Geometry = func() types.JSON[json.RawMessage] {
return random_types_JSON_json_RawMessage_(f)
}
})
}
// Set the model columns to this value
func (m fieldseekerLocationtrackingMods) Geospatial(val null.Val[string]) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Geospatial = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m fieldseekerLocationtrackingMods) GeospatialFunc(f func() null.Val[string]) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Geospatial = f
})
}
// Clear any values for the column
func (m fieldseekerLocationtrackingMods) UnsetGeospatial() FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Geospatial = 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 fieldseekerLocationtrackingMods) RandomGeospatial(f *faker.Faker) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Geospatial = 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 fieldseekerLocationtrackingMods) RandomGeospatialNotNull(f *faker.Faker) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Geospatial = 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 fieldseekerLocationtrackingMods) Version(val int32) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Version = func() int32 { return val }
})
}
// Set the Column from the function
func (m fieldseekerLocationtrackingMods) VersionFunc(f func() int32) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Version = f
})
}
// Clear any values for the column
func (m fieldseekerLocationtrackingMods) UnsetVersion() FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Version = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m fieldseekerLocationtrackingMods) RandomVersion(f *faker.Faker) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.Version = func() int32 {
return random_int32(f)
}
})
}
// Set the model columns to this value
func (m fieldseekerLocationtrackingMods) OrganizationID(val int32) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.OrganizationID = func() int32 { return val }
})
}
// Set the Column from the function
func (m fieldseekerLocationtrackingMods) OrganizationIDFunc(f func() int32) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.OrganizationID = f
})
}
// Clear any values for the column
func (m fieldseekerLocationtrackingMods) UnsetOrganizationID() FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.OrganizationID = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m fieldseekerLocationtrackingMods) RandomOrganizationID(f *faker.Faker) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(_ context.Context, o *FieldseekerLocationtrackingTemplate) {
o.OrganizationID = func() int32 {
return random_int32(f)
}
})
}
func (m fieldseekerLocationtrackingMods) WithParentsCascading() FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(ctx context.Context, o *FieldseekerLocationtrackingTemplate) {
if isDone, _ := fieldseekerLocationtrackingWithParentsCascadingCtx.Value(ctx); isDone {
return
}
ctx = fieldseekerLocationtrackingWithParentsCascadingCtx.WithValue(ctx, true)
{
related := o.f.NewOrganizationWithContext(ctx, OrganizationMods.WithParentsCascading())
m.WithOrganization(related).Apply(ctx, o)
}
})
}
func (m fieldseekerLocationtrackingMods) WithOrganization(rel *OrganizationTemplate) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(ctx context.Context, o *FieldseekerLocationtrackingTemplate) {
o.r.Organization = &fieldseekerLocationtrackingROrganizationR{
o: rel,
}
})
}
func (m fieldseekerLocationtrackingMods) WithNewOrganization(mods ...OrganizationMod) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(ctx context.Context, o *FieldseekerLocationtrackingTemplate) {
related := o.f.NewOrganizationWithContext(ctx, mods...)
m.WithOrganization(related).Apply(ctx, o)
})
}
func (m fieldseekerLocationtrackingMods) WithExistingOrganization(em *models.Organization) FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(ctx context.Context, o *FieldseekerLocationtrackingTemplate) {
o.r.Organization = &fieldseekerLocationtrackingROrganizationR{
o: o.f.FromExistingOrganization(em),
}
})
}
func (m fieldseekerLocationtrackingMods) WithoutOrganization() FieldseekerLocationtrackingMod {
return FieldseekerLocationtrackingModFunc(func(ctx context.Context, o *FieldseekerLocationtrackingTemplate) {
o.r.Organization = nil
})
}