This is an intermediate step between shifting from the old fs_* prefixed table names to an entire fieldseeker schema. At this point we have both, and we aren't doing much with the new schema but compiling.
1081 lines
32 KiB
Go
1081 lines
32 KiB
Go
// Code generated by BobGen psql v0.42.0. DO NOT EDIT.
|
|
// This file is meant to be re-generated in place and/or deleted at any time.
|
|
|
|
package factory
|
|
|
|
import (
|
|
"context"
|
|
|
|
models "github.com/Gleipnir-Technology/nidus-sync/db/models"
|
|
"github.com/aarondl/opt/null"
|
|
"github.com/jaswdr/faker/v2"
|
|
"github.com/lib/pq"
|
|
)
|
|
|
|
type RasterColumnMod interface {
|
|
Apply(context.Context, *RasterColumnTemplate)
|
|
}
|
|
|
|
type RasterColumnModFunc func(context.Context, *RasterColumnTemplate)
|
|
|
|
func (f RasterColumnModFunc) Apply(ctx context.Context, n *RasterColumnTemplate) {
|
|
f(ctx, n)
|
|
}
|
|
|
|
type RasterColumnModSlice []RasterColumnMod
|
|
|
|
func (mods RasterColumnModSlice) Apply(ctx context.Context, n *RasterColumnTemplate) {
|
|
for _, f := range mods {
|
|
f.Apply(ctx, n)
|
|
}
|
|
}
|
|
|
|
// RasterColumnTemplate is an object representing the database table.
|
|
// all columns are optional and should be set by mods
|
|
type RasterColumnTemplate struct {
|
|
RTableCatalog func() null.Val[string]
|
|
RTableSchema func() null.Val[string]
|
|
RTableName func() null.Val[string]
|
|
RRasterColumn func() null.Val[string]
|
|
Srid func() null.Val[int32]
|
|
ScaleX func() null.Val[float64]
|
|
ScaleY func() null.Val[float64]
|
|
BlocksizeX func() null.Val[int32]
|
|
BlocksizeY func() null.Val[int32]
|
|
SameAlignment func() null.Val[bool]
|
|
RegularBlocking func() null.Val[bool]
|
|
NumBands func() null.Val[int32]
|
|
PixelTypes func() null.Val[pq.StringArray]
|
|
NodataValues func() null.Val[pq.Float64Array]
|
|
OutDB func() null.Val[pq.BoolArray]
|
|
Extent func() null.Val[string]
|
|
SpatialIndex func() null.Val[bool]
|
|
|
|
f *Factory
|
|
|
|
alreadyPersisted bool
|
|
}
|
|
|
|
// Apply mods to the RasterColumnTemplate
|
|
func (o *RasterColumnTemplate) Apply(ctx context.Context, mods ...RasterColumnMod) {
|
|
for _, mod := range mods {
|
|
mod.Apply(ctx, o)
|
|
}
|
|
}
|
|
|
|
// setModelRels creates and sets the relationships on *models.RasterColumn
|
|
// according to the relationships in the template. Nothing is inserted into the db
|
|
func (t RasterColumnTemplate) setModelRels(o *models.RasterColumn) {}
|
|
|
|
// Build returns an *models.RasterColumn
|
|
// Related objects are also created and placed in the .R field
|
|
// NOTE: Objects are not inserted into the database. Use RasterColumnTemplate.Create
|
|
func (o RasterColumnTemplate) Build() *models.RasterColumn {
|
|
m := &models.RasterColumn{}
|
|
|
|
if o.RTableCatalog != nil {
|
|
m.RTableCatalog = o.RTableCatalog()
|
|
}
|
|
if o.RTableSchema != nil {
|
|
m.RTableSchema = o.RTableSchema()
|
|
}
|
|
if o.RTableName != nil {
|
|
m.RTableName = o.RTableName()
|
|
}
|
|
if o.RRasterColumn != nil {
|
|
m.RRasterColumn = o.RRasterColumn()
|
|
}
|
|
if o.Srid != nil {
|
|
m.Srid = o.Srid()
|
|
}
|
|
if o.ScaleX != nil {
|
|
m.ScaleX = o.ScaleX()
|
|
}
|
|
if o.ScaleY != nil {
|
|
m.ScaleY = o.ScaleY()
|
|
}
|
|
if o.BlocksizeX != nil {
|
|
m.BlocksizeX = o.BlocksizeX()
|
|
}
|
|
if o.BlocksizeY != nil {
|
|
m.BlocksizeY = o.BlocksizeY()
|
|
}
|
|
if o.SameAlignment != nil {
|
|
m.SameAlignment = o.SameAlignment()
|
|
}
|
|
if o.RegularBlocking != nil {
|
|
m.RegularBlocking = o.RegularBlocking()
|
|
}
|
|
if o.NumBands != nil {
|
|
m.NumBands = o.NumBands()
|
|
}
|
|
if o.PixelTypes != nil {
|
|
m.PixelTypes = o.PixelTypes()
|
|
}
|
|
if o.NodataValues != nil {
|
|
m.NodataValues = o.NodataValues()
|
|
}
|
|
if o.OutDB != nil {
|
|
m.OutDB = o.OutDB()
|
|
}
|
|
if o.Extent != nil {
|
|
m.Extent = o.Extent()
|
|
}
|
|
if o.SpatialIndex != nil {
|
|
m.SpatialIndex = o.SpatialIndex()
|
|
}
|
|
|
|
o.setModelRels(m)
|
|
|
|
return m
|
|
}
|
|
|
|
// BuildMany returns an models.RasterColumnSlice
|
|
// Related objects are also created and placed in the .R field
|
|
// NOTE: Objects are not inserted into the database. Use RasterColumnTemplate.CreateMany
|
|
func (o RasterColumnTemplate) BuildMany(number int) models.RasterColumnSlice {
|
|
m := make(models.RasterColumnSlice, number)
|
|
|
|
for i := range m {
|
|
m[i] = o.Build()
|
|
}
|
|
|
|
return m
|
|
}
|
|
|
|
// RasterColumn has methods that act as mods for the RasterColumnTemplate
|
|
var RasterColumnMods rasterColumnMods
|
|
|
|
type rasterColumnMods struct{}
|
|
|
|
func (m rasterColumnMods) RandomizeAllColumns(f *faker.Faker) RasterColumnMod {
|
|
return RasterColumnModSlice{
|
|
RasterColumnMods.RandomRTableCatalog(f),
|
|
RasterColumnMods.RandomRTableSchema(f),
|
|
RasterColumnMods.RandomRTableName(f),
|
|
RasterColumnMods.RandomRRasterColumn(f),
|
|
RasterColumnMods.RandomSrid(f),
|
|
RasterColumnMods.RandomScaleX(f),
|
|
RasterColumnMods.RandomScaleY(f),
|
|
RasterColumnMods.RandomBlocksizeX(f),
|
|
RasterColumnMods.RandomBlocksizeY(f),
|
|
RasterColumnMods.RandomSameAlignment(f),
|
|
RasterColumnMods.RandomRegularBlocking(f),
|
|
RasterColumnMods.RandomNumBands(f),
|
|
RasterColumnMods.RandomPixelTypes(f),
|
|
RasterColumnMods.RandomNodataValues(f),
|
|
RasterColumnMods.RandomOutDB(f),
|
|
RasterColumnMods.RandomExtent(f),
|
|
RasterColumnMods.RandomSpatialIndex(f),
|
|
}
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m rasterColumnMods) RTableCatalog(val null.Val[string]) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.RTableCatalog = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m rasterColumnMods) RTableCatalogFunc(f func() null.Val[string]) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.RTableCatalog = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m rasterColumnMods) UnsetRTableCatalog() RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.RTableCatalog = 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 rasterColumnMods) RandomRTableCatalog(f *faker.Faker) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.RTableCatalog = 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 rasterColumnMods) RandomRTableCatalogNotNull(f *faker.Faker) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.RTableCatalog = 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 rasterColumnMods) RTableSchema(val null.Val[string]) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.RTableSchema = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m rasterColumnMods) RTableSchemaFunc(f func() null.Val[string]) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.RTableSchema = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m rasterColumnMods) UnsetRTableSchema() RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.RTableSchema = 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 rasterColumnMods) RandomRTableSchema(f *faker.Faker) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.RTableSchema = 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 rasterColumnMods) RandomRTableSchemaNotNull(f *faker.Faker) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.RTableSchema = 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 rasterColumnMods) RTableName(val null.Val[string]) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.RTableName = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m rasterColumnMods) RTableNameFunc(f func() null.Val[string]) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.RTableName = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m rasterColumnMods) UnsetRTableName() RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.RTableName = 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 rasterColumnMods) RandomRTableName(f *faker.Faker) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.RTableName = 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 rasterColumnMods) RandomRTableNameNotNull(f *faker.Faker) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.RTableName = 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 rasterColumnMods) RRasterColumn(val null.Val[string]) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.RRasterColumn = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m rasterColumnMods) RRasterColumnFunc(f func() null.Val[string]) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.RRasterColumn = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m rasterColumnMods) UnsetRRasterColumn() RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.RRasterColumn = 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 rasterColumnMods) RandomRRasterColumn(f *faker.Faker) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.RRasterColumn = 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 rasterColumnMods) RandomRRasterColumnNotNull(f *faker.Faker) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.RRasterColumn = 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 rasterColumnMods) Srid(val null.Val[int32]) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.Srid = func() null.Val[int32] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m rasterColumnMods) SridFunc(f func() null.Val[int32]) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.Srid = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m rasterColumnMods) UnsetSrid() RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.Srid = 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 rasterColumnMods) RandomSrid(f *faker.Faker) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.Srid = 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 rasterColumnMods) RandomSridNotNull(f *faker.Faker) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.Srid = 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 rasterColumnMods) ScaleX(val null.Val[float64]) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.ScaleX = func() null.Val[float64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m rasterColumnMods) ScaleXFunc(f func() null.Val[float64]) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.ScaleX = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m rasterColumnMods) UnsetScaleX() RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.ScaleX = 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 rasterColumnMods) RandomScaleX(f *faker.Faker) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.ScaleX = 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 rasterColumnMods) RandomScaleXNotNull(f *faker.Faker) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.ScaleX = 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 rasterColumnMods) ScaleY(val null.Val[float64]) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.ScaleY = func() null.Val[float64] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m rasterColumnMods) ScaleYFunc(f func() null.Val[float64]) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.ScaleY = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m rasterColumnMods) UnsetScaleY() RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.ScaleY = 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 rasterColumnMods) RandomScaleY(f *faker.Faker) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.ScaleY = 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 rasterColumnMods) RandomScaleYNotNull(f *faker.Faker) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.ScaleY = 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 rasterColumnMods) BlocksizeX(val null.Val[int32]) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.BlocksizeX = func() null.Val[int32] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m rasterColumnMods) BlocksizeXFunc(f func() null.Val[int32]) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.BlocksizeX = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m rasterColumnMods) UnsetBlocksizeX() RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.BlocksizeX = 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 rasterColumnMods) RandomBlocksizeX(f *faker.Faker) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.BlocksizeX = 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 rasterColumnMods) RandomBlocksizeXNotNull(f *faker.Faker) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.BlocksizeX = 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 rasterColumnMods) BlocksizeY(val null.Val[int32]) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.BlocksizeY = func() null.Val[int32] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m rasterColumnMods) BlocksizeYFunc(f func() null.Val[int32]) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.BlocksizeY = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m rasterColumnMods) UnsetBlocksizeY() RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.BlocksizeY = 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 rasterColumnMods) RandomBlocksizeY(f *faker.Faker) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.BlocksizeY = 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 rasterColumnMods) RandomBlocksizeYNotNull(f *faker.Faker) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.BlocksizeY = 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 rasterColumnMods) SameAlignment(val null.Val[bool]) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.SameAlignment = func() null.Val[bool] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m rasterColumnMods) SameAlignmentFunc(f func() null.Val[bool]) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.SameAlignment = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m rasterColumnMods) UnsetSameAlignment() RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.SameAlignment = 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 rasterColumnMods) RandomSameAlignment(f *faker.Faker) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.SameAlignment = func() null.Val[bool] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_bool(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 rasterColumnMods) RandomSameAlignmentNotNull(f *faker.Faker) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.SameAlignment = func() null.Val[bool] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_bool(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m rasterColumnMods) RegularBlocking(val null.Val[bool]) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.RegularBlocking = func() null.Val[bool] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m rasterColumnMods) RegularBlockingFunc(f func() null.Val[bool]) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.RegularBlocking = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m rasterColumnMods) UnsetRegularBlocking() RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.RegularBlocking = 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 rasterColumnMods) RandomRegularBlocking(f *faker.Faker) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.RegularBlocking = func() null.Val[bool] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_bool(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 rasterColumnMods) RandomRegularBlockingNotNull(f *faker.Faker) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.RegularBlocking = func() null.Val[bool] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_bool(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m rasterColumnMods) NumBands(val null.Val[int32]) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.NumBands = func() null.Val[int32] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m rasterColumnMods) NumBandsFunc(f func() null.Val[int32]) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.NumBands = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m rasterColumnMods) UnsetNumBands() RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.NumBands = 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 rasterColumnMods) RandomNumBands(f *faker.Faker) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.NumBands = 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 rasterColumnMods) RandomNumBandsNotNull(f *faker.Faker) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.NumBands = 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 rasterColumnMods) PixelTypes(val null.Val[pq.StringArray]) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.PixelTypes = func() null.Val[pq.StringArray] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m rasterColumnMods) PixelTypesFunc(f func() null.Val[pq.StringArray]) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.PixelTypes = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m rasterColumnMods) UnsetPixelTypes() RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.PixelTypes = 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 rasterColumnMods) RandomPixelTypes(f *faker.Faker) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.PixelTypes = func() null.Val[pq.StringArray] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_pq_StringArray(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 rasterColumnMods) RandomPixelTypesNotNull(f *faker.Faker) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.PixelTypes = func() null.Val[pq.StringArray] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_pq_StringArray(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m rasterColumnMods) NodataValues(val null.Val[pq.Float64Array]) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.NodataValues = func() null.Val[pq.Float64Array] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m rasterColumnMods) NodataValuesFunc(f func() null.Val[pq.Float64Array]) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.NodataValues = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m rasterColumnMods) UnsetNodataValues() RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.NodataValues = 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 rasterColumnMods) RandomNodataValues(f *faker.Faker) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.NodataValues = func() null.Val[pq.Float64Array] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_pq_Float64Array(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 rasterColumnMods) RandomNodataValuesNotNull(f *faker.Faker) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.NodataValues = func() null.Val[pq.Float64Array] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_pq_Float64Array(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m rasterColumnMods) OutDB(val null.Val[pq.BoolArray]) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.OutDB = func() null.Val[pq.BoolArray] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m rasterColumnMods) OutDBFunc(f func() null.Val[pq.BoolArray]) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.OutDB = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m rasterColumnMods) UnsetOutDB() RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.OutDB = 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 rasterColumnMods) RandomOutDB(f *faker.Faker) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.OutDB = func() null.Val[pq.BoolArray] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_pq_BoolArray(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 rasterColumnMods) RandomOutDBNotNull(f *faker.Faker) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.OutDB = func() null.Val[pq.BoolArray] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_pq_BoolArray(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
// Set the model columns to this value
|
|
func (m rasterColumnMods) Extent(val null.Val[string]) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.Extent = func() null.Val[string] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m rasterColumnMods) ExtentFunc(f func() null.Val[string]) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.Extent = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m rasterColumnMods) UnsetExtent() RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.Extent = 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 rasterColumnMods) RandomExtent(f *faker.Faker) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.Extent = 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 rasterColumnMods) RandomExtentNotNull(f *faker.Faker) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.Extent = 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 rasterColumnMods) SpatialIndex(val null.Val[bool]) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.SpatialIndex = func() null.Val[bool] { return val }
|
|
})
|
|
}
|
|
|
|
// Set the Column from the function
|
|
func (m rasterColumnMods) SpatialIndexFunc(f func() null.Val[bool]) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.SpatialIndex = f
|
|
})
|
|
}
|
|
|
|
// Clear any values for the column
|
|
func (m rasterColumnMods) UnsetSpatialIndex() RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.SpatialIndex = 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 rasterColumnMods) RandomSpatialIndex(f *faker.Faker) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.SpatialIndex = func() null.Val[bool] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_bool(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 rasterColumnMods) RandomSpatialIndexNotNull(f *faker.Faker) RasterColumnMod {
|
|
return RasterColumnModFunc(func(_ context.Context, o *RasterColumnTemplate) {
|
|
o.SpatialIndex = func() null.Val[bool] {
|
|
if f == nil {
|
|
f = &defaultFaker
|
|
}
|
|
|
|
val := random_bool(f)
|
|
return null.From(val)
|
|
}
|
|
})
|
|
}
|
|
|
|
func (m rasterColumnMods) WithParentsCascading() RasterColumnMod {
|
|
return RasterColumnModFunc(func(ctx context.Context, o *RasterColumnTemplate) {
|
|
if isDone, _ := rasterColumnWithParentsCascadingCtx.Value(ctx); isDone {
|
|
return
|
|
}
|
|
ctx = rasterColumnWithParentsCascadingCtx.WithValue(ctx, true)
|
|
})
|
|
}
|