Go to h3 v4, Add initial h3 aggregation work

This calculates the summary information of data in h3 nodes and puts it
in the database for fast lookup.
This commit is contained in:
Eli Ribble 2025-11-13 23:48:41 +00:00
parent 7919f0da66
commit e48abb09c0
No known key found for this signature in database
120 changed files with 8516 additions and 1539 deletions

View file

@ -1,6 +1,7 @@
package main
import (
"bytes"
"context"
"database/sql"
"embed"
@ -11,12 +12,18 @@ import (
//"github.com/georgysavva/scany/v2/pgxscan"
//"github.com/jackc/pgx/v5"
"github.com/Gleipnir-Technology/nidus-sync/enums"
"github.com/Gleipnir-Technology/nidus-sync/models"
"github.com/jackc/pgx/v5/pgxpool"
"github.com/jackc/pgx/v5/stdlib"
_ "github.com/jackc/pgx/v5/stdlib"
"github.com/pressly/goose/v3"
"github.com/rs/zerolog/log"
"github.com/stephenafamo/bob"
"github.com/stephenafamo/bob/dialect/psql"
"github.com/stephenafamo/bob/dialect/psql/dialect"
"github.com/stephenafamo/bob/dialect/psql/im"
"github.com/uber/h3-go/v4"
)
//go:embed migrations/*.sql
@ -143,3 +150,54 @@ func needsMigrations(connection_string string) (*bool, error) {
}
return &hasPending, nil
}
func updateSummaryTables(ctx context.Context, org *models.Organization) {
/*org, err := models.FindOrganization(ctx, PGInstance.BobDB, org_id)
if err != nil {
log.Error().Err(err).Msg("Failed to get organization")
}*/
log.Info().Int("org_id", int(org.ID)).Msg("Getting point locations")
point_locations, err := org.FSPointlocations().All(ctx, PGInstance.BobDB)
if err != nil {
log.Error().Err(err).Msg("Failed to get organization")
return
}
log.Info().Int("count", len(point_locations)).Msg("Summarizing point locations")
for i := range 16 {
log.Info().Int("resolution", i).Msg("Working summary layer")
cellToCount := make(map[h3.Cell]int, 0)
for _, p := range point_locations {
cell, err := getCell(p.GeometryX, p.GeometryY, i)
if err != nil {
log.Error().Err(err).Msg("Failed to get cell")
continue
}
//log.Info().Float64("X", p.GeometryX).Float64("Y", p.GeometryY).Str("cell", cell.String()).Msg("Converted lat/lng")
cellToCount[cell] = cellToCount[cell] + 1
}
var to_insert []bob.Mod[*dialect.InsertQuery] = make([]bob.Mod[*dialect.InsertQuery], 0)
to_insert = append(to_insert, im.Into("h3_aggregation", "cell", "resolution", "count_", "type_", "organization_id"))
for cell, count := range cellToCount {
to_insert = append(to_insert, im.Values(psql.Arg(cell.String(), i, count, enums.H3aggregationtypeServicerequest, org.ID)))
}
//to_insert = append(to_insert, im.OnConflict("h3_aggregation_cell_organization_id_type__key").DoUpdate(
to_insert = append(to_insert, im.OnConflict("cell, organization_id, type_").DoUpdate(
im.SetCol("count_").To(psql.Raw("EXCLUDED.count_")),
))
//log.Info().Str("sql", insertQueryToString(psql.Insert(to_insert...))).Msg("Updating...")
_, err := psql.Insert(to_insert...).Exec(ctx, PGInstance.BobDB)
if err != nil {
log.Error().Err(err).Msg("Faild to add h3 aggregation")
}
}
}
func insertQueryToString(query bob.BaseQuery[*dialect.InsertQuery]) string {
buf := new(bytes.Buffer)
_, err := query.WriteQuery(context.TODO(), buf, 0)
if err != nil {
return fmt.Sprintf("Failed to write query: %v", err)
}
return buf.String()
}

View file

@ -0,0 +1,26 @@
// 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 dberrors
var H3AggregationErrors = &h3AggregationErrors{
ErrUniqueH3AggregationPkey: &UniqueConstraintError{
schema: "",
table: "h3_aggregation",
columns: []string{"id"},
s: "h3_aggregation_pkey",
},
ErrUniqueH3AggregationCellOrganizationIdType_Key: &UniqueConstraintError{
schema: "",
table: "h3_aggregation",
columns: []string{"cell", "organization_id", "type_"},
s: "h3_aggregation_cell_organization_id_type__key",
},
}
type h3AggregationErrors struct {
ErrUniqueH3AggregationPkey *UniqueConstraintError
ErrUniqueH3AggregationCellOrganizationIdType_Key *UniqueConstraintError
}

View file

@ -0,0 +1,110 @@
// 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 dberrors
import (
"context"
"errors"
"testing"
factory "github.com/Gleipnir-Technology/nidus-sync/factory"
models "github.com/Gleipnir-Technology/nidus-sync/models"
"github.com/stephenafamo/bob"
)
func TestH3AggregationUniqueConstraintErrors(t *testing.T) {
if testDB == nil {
t.Skip("No database connection provided")
}
f := factory.New()
tests := []struct {
name string
expectedErr *UniqueConstraintError
conflictMods func(context.Context, *testing.T, bob.Executor, *models.H3Aggregation) factory.H3AggregationModSlice
}{
{
name: "ErrUniqueH3AggregationPkey",
expectedErr: H3AggregationErrors.ErrUniqueH3AggregationPkey,
conflictMods: func(ctx context.Context, t *testing.T, exec bob.Executor, obj *models.H3Aggregation) factory.H3AggregationModSlice {
shouldUpdate := false
updateMods := make(factory.H3AggregationModSlice, 0, 1)
if shouldUpdate {
if err := obj.Update(ctx, exec, f.NewH3AggregationWithContext(ctx, updateMods...).BuildSetter()); err != nil {
t.Fatalf("Error updating object: %v", err)
}
}
return factory.H3AggregationModSlice{
factory.H3AggregationMods.ID(obj.ID),
}
},
},
{
name: "ErrUniqueH3AggregationCellOrganizationIdType_Key",
expectedErr: H3AggregationErrors.ErrUniqueH3AggregationCellOrganizationIdType_Key,
conflictMods: func(ctx context.Context, t *testing.T, exec bob.Executor, obj *models.H3Aggregation) factory.H3AggregationModSlice {
shouldUpdate := false
updateMods := make(factory.H3AggregationModSlice, 0, 3)
if shouldUpdate {
if err := obj.Update(ctx, exec, f.NewH3AggregationWithContext(ctx, updateMods...).BuildSetter()); err != nil {
t.Fatalf("Error updating object: %v", err)
}
}
return factory.H3AggregationModSlice{
factory.H3AggregationMods.Cell(obj.Cell),
factory.H3AggregationMods.OrganizationID(obj.OrganizationID),
factory.H3AggregationMods.Type(obj.Type),
}
},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
ctx, cancel := context.WithCancel(t.Context())
t.Cleanup(cancel)
tx, err := testDB.Begin(ctx)
if err != nil {
t.Fatalf("Couldn't start database transaction: %v", err)
}
defer func() {
if err := tx.Rollback(ctx); err != nil {
t.Fatalf("Error rolling back transaction: %v", err)
}
}()
var exec bob.Executor = tx
obj, err := f.NewH3AggregationWithContext(ctx, factory.H3AggregationMods.WithParentsCascading()).Create(ctx, exec)
if err != nil {
t.Fatal(err)
}
obj2, err := f.NewH3AggregationWithContext(ctx).Create(ctx, exec)
if err != nil {
t.Fatal(err)
}
err = obj2.Update(ctx, exec, f.NewH3AggregationWithContext(ctx, tt.conflictMods(ctx, t, exec, obj)...).BuildSetter())
if !errors.Is(ErrUniqueConstraint, err) {
t.Fatalf("Expected: %s, Got: %v", tt.name, err)
}
if !errors.Is(tt.expectedErr, err) {
t.Fatalf("Expected: %s, Got: %v", tt.expectedErr.Error(), err)
}
if !ErrUniqueConstraint.Is(err) {
t.Fatalf("Expected: %s, Got: %v", tt.name, err)
}
if !tt.expectedErr.Is(err) {
t.Fatalf("Expected: %s, Got: %v", tt.expectedErr.Error(), err)
}
})
}
}

View file

@ -0,0 +1,17 @@
// 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 dberrors
var SpatialRefSyErrors = &spatialRefSyErrors{
ErrUniqueSpatialRefSysPkey: &UniqueConstraintError{
schema: "",
table: "spatial_ref_sys",
columns: []string{"srid"},
s: "spatial_ref_sys_pkey",
},
}
type spatialRefSyErrors struct {
ErrUniqueSpatialRefSysPkey *UniqueConstraintError
}

View file

@ -72,9 +72,9 @@ var FSContainerrelates = Table[
Globalid: column{
Name: "globalid",
DBType: "text",
Default: "NULL",
Default: "",
Comment: "",
Nullable: true,
Nullable: false,
Generated: false,
AutoIncr: false,
},

View file

@ -63,9 +63,9 @@ var FSFieldscoutinglogs = Table[
Globalid: column{
Name: "globalid",
DBType: "text",
Default: "NULL",
Default: "",
Comment: "",
Nullable: true,
Nullable: false,
Generated: false,
AutoIncr: false,
},

View file

@ -72,9 +72,9 @@ var FSHabitatrelates = Table[
Globalid: column{
Name: "globalid",
DBType: "text",
Default: "NULL",
Default: "",
Comment: "",
Nullable: true,
Nullable: false,
Generated: false,
AutoIncr: false,
},

View file

@ -63,9 +63,9 @@ var FSInspectionsamples = Table[
Globalid: column{
Name: "globalid",
DBType: "text",
Default: "NULL",
Default: "",
Comment: "",
Nullable: true,
Nullable: false,
Generated: false,
AutoIncr: false,
},

View file

@ -135,9 +135,9 @@ var FSInspectionsampledetails = Table[
Globalid: column{
Name: "globalid",
DBType: "text",
Default: "NULL",
Default: "",
Comment: "",
Nullable: true,
Nullable: false,
Generated: false,
AutoIncr: false,
},

View file

@ -117,9 +117,9 @@ var FSLinelocations = Table[
Globalid: column{
Name: "globalid",
DBType: "text",
Default: "NULL",
Default: "",
Comment: "",
Nullable: true,
Nullable: false,
Generated: false,
AutoIncr: false,
},

View file

@ -81,9 +81,9 @@ var FSLocationtrackings = Table[
Globalid: column{
Name: "globalid",
DBType: "text",
Default: "NULL",
Default: "",
Comment: "",
Nullable: true,
Nullable: false,
Generated: false,
AutoIncr: false,
},

View file

@ -198,9 +198,9 @@ var FSMosquitoinspections = Table[
Globalid: column{
Name: "globalid",
DBType: "text",
Default: "NULL",
Default: "",
Comment: "",
Nullable: true,
Nullable: false,
Generated: false,
AutoIncr: false,
},

View file

@ -108,9 +108,9 @@ var FSPointlocations = Table[
Globalid: column{
Name: "globalid",
DBType: "text",
Default: "NULL",
Default: "",
Comment: "",
Nullable: true,
Nullable: false,
Generated: false,
AutoIncr: false,
},
@ -387,18 +387,18 @@ var FSPointlocations = Table[
GeometryX: column{
Name: "geometry_x",
DBType: "double precision",
Default: "NULL",
Default: "",
Comment: "",
Nullable: true,
Nullable: false,
Generated: false,
AutoIncr: false,
},
GeometryY: column{
Name: "geometry_y",
DBType: "double precision",
Default: "NULL",
Default: "",
Comment: "",
Nullable: true,
Nullable: false,
Generated: false,
AutoIncr: false,
},

View file

@ -126,9 +126,9 @@ var FSPolygonlocations = Table[
Globalid: column{
Name: "globalid",
DBType: "text",
Default: "NULL",
Default: "",
Comment: "",
Nullable: true,
Nullable: false,
Generated: false,
AutoIncr: false,
},

View file

@ -117,9 +117,9 @@ var FSPools = Table[
Globalid: column{
Name: "globalid",
DBType: "text",
Default: "NULL",
Default: "",
Comment: "",
Nullable: true,
Nullable: false,
Generated: false,
AutoIncr: false,
},

View file

@ -72,9 +72,9 @@ var FSPooldetails = Table[
Globalid: column{
Name: "globalid",
DBType: "text",
Default: "NULL",
Default: "",
Comment: "",
Nullable: true,
Nullable: false,
Generated: false,
AutoIncr: false,
},

View file

@ -126,9 +126,9 @@ var FSProposedtreatmentareas = Table[
Globalid: column{
Name: "globalid",
DBType: "text",
Default: "NULL",
Default: "",
Comment: "",
Nullable: true,
Nullable: false,
Generated: false,
AutoIncr: false,
},

View file

@ -153,9 +153,9 @@ var FSQamosquitoinspections = Table[
Globalid: column{
Name: "globalid",
DBType: "text",
Default: "NULL",
Default: "",
Comment: "",
Nullable: true,
Nullable: false,
Generated: false,
AutoIncr: false,
},

View file

@ -108,9 +108,9 @@ var FSRodentlocations = Table[
Globalid: column{
Name: "globalid",
DBType: "text",
Default: "NULL",
Default: "",
Comment: "",
Nullable: true,
Nullable: false,
Generated: false,
AutoIncr: false,
},

View file

@ -171,9 +171,9 @@ var FSSamplecollections = Table[
Globalid: column{
Name: "globalid",
DBType: "text",
Default: "NULL",
Default: "",
Comment: "",
Nullable: true,
Nullable: false,
Generated: false,
AutoIncr: false,
},

View file

@ -117,9 +117,9 @@ var FSSamplelocations = Table[
Globalid: column{
Name: "globalid",
DBType: "text",
Default: "NULL",
Default: "",
Comment: "",
Nullable: true,
Nullable: false,
Generated: false,
AutoIncr: false,
},

View file

@ -297,9 +297,9 @@ var FSServicerequests = Table[
Globalid: column{
Name: "globalid",
DBType: "text",
Default: "NULL",
Default: "",
Comment: "",
Nullable: true,
Nullable: false,
Generated: false,
AutoIncr: false,
},
@ -747,18 +747,18 @@ var FSServicerequests = Table[
GeometryX: column{
Name: "geometry_x",
DBType: "double precision",
Default: "NULL",
Default: "",
Comment: "",
Nullable: true,
Nullable: false,
Generated: false,
AutoIncr: false,
},
GeometryY: column{
Name: "geometry_y",
DBType: "double precision",
Default: "NULL",
Default: "",
Comment: "",
Nullable: true,
Nullable: false,
Generated: false,
AutoIncr: false,
},

View file

@ -99,9 +99,9 @@ var FSSpeciesabundances = Table[
Globalid: column{
Name: "globalid",
DBType: "text",
Default: "NULL",
Default: "",
Comment: "",
Nullable: true,
Nullable: false,
Generated: false,
AutoIncr: false,
},

View file

@ -63,9 +63,9 @@ var FSStormdrains = Table[
Globalid: column{
Name: "globalid",
DBType: "text",
Default: "NULL",
Default: "",
Comment: "",
Nullable: true,
Nullable: false,
Generated: false,
AutoIncr: false,
},

View file

@ -117,9 +117,9 @@ var FSTimecards = Table[
Globalid: column{
Name: "globalid",
DBType: "text",
Default: "NULL",
Default: "",
Comment: "",
Nullable: true,
Nullable: false,
Generated: false,
AutoIncr: false,
},

View file

@ -117,9 +117,9 @@ var FSTrapdata = Table[
Globalid: column{
Name: "globalid",
DBType: "text",
Default: "NULL",
Default: "",
Comment: "",
Nullable: true,
Nullable: false,
Generated: false,
AutoIncr: false,
},

View file

@ -117,9 +117,9 @@ var FSTraplocations = Table[
Globalid: column{
Name: "globalid",
DBType: "text",
Default: "NULL",
Default: "",
Comment: "",
Nullable: true,
Nullable: false,
Generated: false,
AutoIncr: false,
},

View file

@ -162,9 +162,9 @@ var FSTreatments = Table[
Globalid: column{
Name: "globalid",
DBType: "text",
Default: "NULL",
Default: "",
Comment: "",
Nullable: true,
Nullable: false,
Generated: false,
AutoIncr: false,
},

View file

@ -72,9 +72,9 @@ var FSTreatmentareas = Table[
Globalid: column{
Name: "globalid",
DBType: "text",
Default: "NULL",
Default: "",
Comment: "",
Nullable: true,
Nullable: false,
Generated: false,
AutoIncr: false,
},

View file

@ -72,9 +72,9 @@ var FSZones = Table[
Globalid: column{
Name: "globalid",
DBType: "text",
Default: "NULL",
Default: "",
Comment: "",
Nullable: true,
Nullable: false,
Generated: false,
AutoIncr: false,
},

View file

@ -63,9 +63,9 @@ var FSZones2s = Table[
Globalid: column{
Name: "globalid",
DBType: "text",
Default: "NULL",
Default: "",
Comment: "",
Nullable: true,
Nullable: false,
Generated: false,
AutoIncr: false,
},

View file

@ -0,0 +1,122 @@
// 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 dbinfo
var GeographyColumns = Table[
geographyColumnColumns,
geographyColumnIndexes,
geographyColumnForeignKeys,
geographyColumnUniques,
geographyColumnChecks,
]{
Schema: "",
Name: "geography_columns",
Columns: geographyColumnColumns{
FTableCatalog: column{
Name: "f_table_catalog",
DBType: "name",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
AutoIncr: false,
},
FTableSchema: column{
Name: "f_table_schema",
DBType: "name",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
AutoIncr: false,
},
FTableName: column{
Name: "f_table_name",
DBType: "name",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
AutoIncr: false,
},
FGeographyColumn: column{
Name: "f_geography_column",
DBType: "name",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
AutoIncr: false,
},
CoordDimension: column{
Name: "coord_dimension",
DBType: "integer",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
AutoIncr: false,
},
Srid: column{
Name: "srid",
DBType: "integer",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
AutoIncr: false,
},
Type: column{
Name: "type",
DBType: "text",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
AutoIncr: false,
},
},
Comment: "",
}
type geographyColumnColumns struct {
FTableCatalog column
FTableSchema column
FTableName column
FGeographyColumn column
CoordDimension column
Srid column
Type column
}
func (c geographyColumnColumns) AsSlice() []column {
return []column{
c.FTableCatalog, c.FTableSchema, c.FTableName, c.FGeographyColumn, c.CoordDimension, c.Srid, c.Type,
}
}
type geographyColumnIndexes struct{}
func (i geographyColumnIndexes) AsSlice() []index {
return []index{}
}
type geographyColumnForeignKeys struct{}
func (f geographyColumnForeignKeys) AsSlice() []foreignKey {
return []foreignKey{}
}
type geographyColumnUniques struct{}
func (u geographyColumnUniques) AsSlice() []constraint {
return []constraint{}
}
type geographyColumnChecks struct{}
func (c geographyColumnChecks) AsSlice() []check {
return []check{}
}

View file

@ -0,0 +1,122 @@
// 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 dbinfo
var GeometryColumns = Table[
geometryColumnColumns,
geometryColumnIndexes,
geometryColumnForeignKeys,
geometryColumnUniques,
geometryColumnChecks,
]{
Schema: "",
Name: "geometry_columns",
Columns: geometryColumnColumns{
FTableCatalog: column{
Name: "f_table_catalog",
DBType: "character varying",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
AutoIncr: false,
},
FTableSchema: column{
Name: "f_table_schema",
DBType: "name",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
AutoIncr: false,
},
FTableName: column{
Name: "f_table_name",
DBType: "name",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
AutoIncr: false,
},
FGeometryColumn: column{
Name: "f_geometry_column",
DBType: "name",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
AutoIncr: false,
},
CoordDimension: column{
Name: "coord_dimension",
DBType: "integer",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
AutoIncr: false,
},
Srid: column{
Name: "srid",
DBType: "integer",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
AutoIncr: false,
},
Type: column{
Name: "type",
DBType: "character varying",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
AutoIncr: false,
},
},
Comment: "",
}
type geometryColumnColumns struct {
FTableCatalog column
FTableSchema column
FTableName column
FGeometryColumn column
CoordDimension column
Srid column
Type column
}
func (c geometryColumnColumns) AsSlice() []column {
return []column{
c.FTableCatalog, c.FTableSchema, c.FTableName, c.FGeometryColumn, c.CoordDimension, c.Srid, c.Type,
}
}
type geometryColumnIndexes struct{}
func (i geometryColumnIndexes) AsSlice() []index {
return []index{}
}
type geometryColumnForeignKeys struct{}
func (f geometryColumnForeignKeys) AsSlice() []foreignKey {
return []foreignKey{}
}
type geometryColumnUniques struct{}
func (u geometryColumnUniques) AsSlice() []constraint {
return []constraint{}
}
type geometryColumnChecks struct{}
func (c geometryColumnChecks) AsSlice() []check {
return []check{}
}

View file

@ -0,0 +1,196 @@
// 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 dbinfo
import "github.com/aarondl/opt/null"
var H3Aggregations = Table[
h3AggregationColumns,
h3AggregationIndexes,
h3AggregationForeignKeys,
h3AggregationUniques,
h3AggregationChecks,
]{
Schema: "",
Name: "h3_aggregation",
Columns: h3AggregationColumns{
ID: column{
Name: "id",
DBType: "integer",
Default: "nextval('h3_aggregation_id_seq'::regclass)",
Comment: "",
Nullable: false,
Generated: false,
AutoIncr: false,
},
Cell: column{
Name: "cell",
DBType: "h3index",
Default: "",
Comment: "",
Nullable: false,
Generated: false,
AutoIncr: false,
},
Resolution: column{
Name: "resolution",
DBType: "integer",
Default: "",
Comment: "",
Nullable: false,
Generated: false,
AutoIncr: false,
},
Count: column{
Name: "count_",
DBType: "integer",
Default: "",
Comment: "",
Nullable: false,
Generated: false,
AutoIncr: false,
},
Type: column{
Name: "type_",
DBType: "public.h3aggregationtype",
Default: "",
Comment: "",
Nullable: false,
Generated: false,
AutoIncr: false,
},
OrganizationID: column{
Name: "organization_id",
DBType: "integer",
Default: "",
Comment: "",
Nullable: false,
Generated: false,
AutoIncr: false,
},
},
Indexes: h3AggregationIndexes{
H3AggregationPkey: index{
Type: "btree",
Name: "h3_aggregation_pkey",
Columns: []indexColumn{
{
Name: "id",
Desc: null.FromCond(false, true),
IsExpression: false,
},
},
Unique: true,
Comment: "",
NullsFirst: []bool{false},
NullsDistinct: false,
Where: "",
Include: []string{},
},
H3AggregationCellOrganizationIDTypeKey: index{
Type: "btree",
Name: "h3_aggregation_cell_organization_id_type__key",
Columns: []indexColumn{
{
Name: "cell",
Desc: null.FromCond(false, true),
IsExpression: false,
},
{
Name: "organization_id",
Desc: null.FromCond(false, true),
IsExpression: false,
},
{
Name: "type_",
Desc: null.FromCond(false, true),
IsExpression: false,
},
},
Unique: true,
Comment: "",
NullsFirst: []bool{false, false, false},
NullsDistinct: false,
Where: "",
Include: []string{},
},
},
PrimaryKey: &constraint{
Name: "h3_aggregation_pkey",
Columns: []string{"id"},
Comment: "",
},
ForeignKeys: h3AggregationForeignKeys{
H3AggregationH3AggregationOrganizationIDFkey: foreignKey{
constraint: constraint{
Name: "h3_aggregation.h3_aggregation_organization_id_fkey",
Columns: []string{"organization_id"},
Comment: "",
},
ForeignTable: "organization",
ForeignColumns: []string{"id"},
},
},
Uniques: h3AggregationUniques{
H3AggregationCellOrganizationIDTypeKey: constraint{
Name: "h3_aggregation_cell_organization_id_type__key",
Columns: []string{"cell", "organization_id", "type_"},
Comment: "",
},
},
Comment: "",
}
type h3AggregationColumns struct {
ID column
Cell column
Resolution column
Count column
Type column
OrganizationID column
}
func (c h3AggregationColumns) AsSlice() []column {
return []column{
c.ID, c.Cell, c.Resolution, c.Count, c.Type, c.OrganizationID,
}
}
type h3AggregationIndexes struct {
H3AggregationPkey index
H3AggregationCellOrganizationIDTypeKey index
}
func (i h3AggregationIndexes) AsSlice() []index {
return []index{
i.H3AggregationPkey, i.H3AggregationCellOrganizationIDTypeKey,
}
}
type h3AggregationForeignKeys struct {
H3AggregationH3AggregationOrganizationIDFkey foreignKey
}
func (f h3AggregationForeignKeys) AsSlice() []foreignKey {
return []foreignKey{
f.H3AggregationH3AggregationOrganizationIDFkey,
}
}
type h3AggregationUniques struct {
H3AggregationCellOrganizationIDTypeKey constraint
}
func (u h3AggregationUniques) AsSlice() []constraint {
return []constraint{
u.H3AggregationCellOrganizationIDTypeKey,
}
}
type h3AggregationChecks struct{}
func (c h3AggregationChecks) AsSlice() []check {
return []check{}
}

View file

@ -0,0 +1,222 @@
// 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 dbinfo
var RasterColumns = Table[
rasterColumnColumns,
rasterColumnIndexes,
rasterColumnForeignKeys,
rasterColumnUniques,
rasterColumnChecks,
]{
Schema: "",
Name: "raster_columns",
Columns: rasterColumnColumns{
RTableCatalog: column{
Name: "r_table_catalog",
DBType: "name",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
AutoIncr: false,
},
RTableSchema: column{
Name: "r_table_schema",
DBType: "name",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
AutoIncr: false,
},
RTableName: column{
Name: "r_table_name",
DBType: "name",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
AutoIncr: false,
},
RRasterColumn: column{
Name: "r_raster_column",
DBType: "name",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
AutoIncr: false,
},
Srid: column{
Name: "srid",
DBType: "integer",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
AutoIncr: false,
},
ScaleX: column{
Name: "scale_x",
DBType: "double precision",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
AutoIncr: false,
},
ScaleY: column{
Name: "scale_y",
DBType: "double precision",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
AutoIncr: false,
},
BlocksizeX: column{
Name: "blocksize_x",
DBType: "integer",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
AutoIncr: false,
},
BlocksizeY: column{
Name: "blocksize_y",
DBType: "integer",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
AutoIncr: false,
},
SameAlignment: column{
Name: "same_alignment",
DBType: "boolean",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
AutoIncr: false,
},
RegularBlocking: column{
Name: "regular_blocking",
DBType: "boolean",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
AutoIncr: false,
},
NumBands: column{
Name: "num_bands",
DBType: "integer",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
AutoIncr: false,
},
PixelTypes: column{
Name: "pixel_types",
DBType: "text[]",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
AutoIncr: false,
},
NodataValues: column{
Name: "nodata_values",
DBType: "double precision[]",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
AutoIncr: false,
},
OutDB: column{
Name: "out_db",
DBType: "boolean[]",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
AutoIncr: false,
},
Extent: column{
Name: "extent",
DBType: "geometry",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
AutoIncr: false,
},
SpatialIndex: column{
Name: "spatial_index",
DBType: "boolean",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
AutoIncr: false,
},
},
Comment: "",
}
type rasterColumnColumns struct {
RTableCatalog column
RTableSchema column
RTableName column
RRasterColumn column
Srid column
ScaleX column
ScaleY column
BlocksizeX column
BlocksizeY column
SameAlignment column
RegularBlocking column
NumBands column
PixelTypes column
NodataValues column
OutDB column
Extent column
SpatialIndex column
}
func (c rasterColumnColumns) AsSlice() []column {
return []column{
c.RTableCatalog, c.RTableSchema, c.RTableName, c.RRasterColumn, c.Srid, c.ScaleX, c.ScaleY, c.BlocksizeX, c.BlocksizeY, c.SameAlignment, c.RegularBlocking, c.NumBands, c.PixelTypes, c.NodataValues, c.OutDB, c.Extent, c.SpatialIndex,
}
}
type rasterColumnIndexes struct{}
func (i rasterColumnIndexes) AsSlice() []index {
return []index{}
}
type rasterColumnForeignKeys struct{}
func (f rasterColumnForeignKeys) AsSlice() []foreignKey {
return []foreignKey{}
}
type rasterColumnUniques struct{}
func (u rasterColumnUniques) AsSlice() []constraint {
return []constraint{}
}
type rasterColumnChecks struct{}
func (c rasterColumnChecks) AsSlice() []check {
return []check{}
}

View file

@ -0,0 +1,142 @@
// 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 dbinfo
var RasterOverviews = Table[
rasterOverviewColumns,
rasterOverviewIndexes,
rasterOverviewForeignKeys,
rasterOverviewUniques,
rasterOverviewChecks,
]{
Schema: "",
Name: "raster_overviews",
Columns: rasterOverviewColumns{
OTableCatalog: column{
Name: "o_table_catalog",
DBType: "name",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
AutoIncr: false,
},
OTableSchema: column{
Name: "o_table_schema",
DBType: "name",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
AutoIncr: false,
},
OTableName: column{
Name: "o_table_name",
DBType: "name",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
AutoIncr: false,
},
ORasterColumn: column{
Name: "o_raster_column",
DBType: "name",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
AutoIncr: false,
},
RTableCatalog: column{
Name: "r_table_catalog",
DBType: "name",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
AutoIncr: false,
},
RTableSchema: column{
Name: "r_table_schema",
DBType: "name",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
AutoIncr: false,
},
RTableName: column{
Name: "r_table_name",
DBType: "name",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
AutoIncr: false,
},
RRasterColumn: column{
Name: "r_raster_column",
DBType: "name",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
AutoIncr: false,
},
OverviewFactor: column{
Name: "overview_factor",
DBType: "integer",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
AutoIncr: false,
},
},
Comment: "",
}
type rasterOverviewColumns struct {
OTableCatalog column
OTableSchema column
OTableName column
ORasterColumn column
RTableCatalog column
RTableSchema column
RTableName column
RRasterColumn column
OverviewFactor column
}
func (c rasterOverviewColumns) AsSlice() []column {
return []column{
c.OTableCatalog, c.OTableSchema, c.OTableName, c.ORasterColumn, c.RTableCatalog, c.RTableSchema, c.RTableName, c.RRasterColumn, c.OverviewFactor,
}
}
type rasterOverviewIndexes struct{}
func (i rasterOverviewIndexes) AsSlice() []index {
return []index{}
}
type rasterOverviewForeignKeys struct{}
func (f rasterOverviewForeignKeys) AsSlice() []foreignKey {
return []foreignKey{}
}
type rasterOverviewUniques struct{}
func (u rasterOverviewUniques) AsSlice() []constraint {
return []constraint{}
}
type rasterOverviewChecks struct{}
func (c rasterOverviewChecks) AsSlice() []check {
return []check{}
}

View file

@ -0,0 +1,146 @@
// 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 dbinfo
import "github.com/aarondl/opt/null"
var SpatialRefSys = Table[
spatialRefSyColumns,
spatialRefSyIndexes,
spatialRefSyForeignKeys,
spatialRefSyUniques,
spatialRefSyChecks,
]{
Schema: "",
Name: "spatial_ref_sys",
Columns: spatialRefSyColumns{
Srid: column{
Name: "srid",
DBType: "integer",
Default: "",
Comment: "",
Nullable: false,
Generated: false,
AutoIncr: false,
},
AuthName: column{
Name: "auth_name",
DBType: "character varying",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
AutoIncr: false,
},
AuthSrid: column{
Name: "auth_srid",
DBType: "integer",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
AutoIncr: false,
},
Srtext: column{
Name: "srtext",
DBType: "character varying",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
AutoIncr: false,
},
Proj4text: column{
Name: "proj4text",
DBType: "character varying",
Default: "NULL",
Comment: "",
Nullable: true,
Generated: false,
AutoIncr: false,
},
},
Indexes: spatialRefSyIndexes{
SpatialRefSysPkey: index{
Type: "btree",
Name: "spatial_ref_sys_pkey",
Columns: []indexColumn{
{
Name: "srid",
Desc: null.FromCond(false, true),
IsExpression: false,
},
},
Unique: true,
Comment: "",
NullsFirst: []bool{false},
NullsDistinct: false,
Where: "",
Include: []string{},
},
},
PrimaryKey: &constraint{
Name: "spatial_ref_sys_pkey",
Columns: []string{"srid"},
Comment: "",
},
Checks: spatialRefSyChecks{
SpatialRefSysSridCheck: check{
constraint: constraint{
Name: "spatial_ref_sys_srid_check",
Columns: []string{"srid"},
Comment: "",
},
Expression: "((srid > 0) AND (srid <= 998999))",
},
},
Comment: "",
}
type spatialRefSyColumns struct {
Srid column
AuthName column
AuthSrid column
Srtext column
Proj4text column
}
func (c spatialRefSyColumns) AsSlice() []column {
return []column{
c.Srid, c.AuthName, c.AuthSrid, c.Srtext, c.Proj4text,
}
}
type spatialRefSyIndexes struct {
SpatialRefSysPkey index
}
func (i spatialRefSyIndexes) AsSlice() []index {
return []index{
i.SpatialRefSysPkey,
}
}
type spatialRefSyForeignKeys struct{}
func (f spatialRefSyForeignKeys) AsSlice() []foreignKey {
return []foreignKey{}
}
type spatialRefSyUniques struct{}
func (u spatialRefSyUniques) AsSlice() []constraint {
return []constraint{}
}
type spatialRefSyChecks struct {
SpatialRefSysSridCheck check
}
func (c spatialRefSyChecks) AsSlice() []check {
return []check{
c.SpatialRefSysSridCheck,
}
}

View file

@ -117,6 +117,79 @@ func (e *Arcgislicensetype) Scan(value any) error {
return nil
}
// Enum values for H3aggregationtype
const (
H3aggregationtypeMosquitosource H3aggregationtype = "MosquitoSource"
H3aggregationtypeServicerequest H3aggregationtype = "ServiceRequest"
)
func AllH3aggregationtype() []H3aggregationtype {
return []H3aggregationtype{
H3aggregationtypeMosquitosource,
H3aggregationtypeServicerequest,
}
}
type H3aggregationtype string
func (e H3aggregationtype) String() string {
return string(e)
}
func (e H3aggregationtype) Valid() bool {
switch e {
case H3aggregationtypeMosquitosource,
H3aggregationtypeServicerequest:
return true
default:
return false
}
}
// useful when testing in other packages
func (e H3aggregationtype) All() []H3aggregationtype {
return AllH3aggregationtype()
}
func (e H3aggregationtype) MarshalText() ([]byte, error) {
return []byte(e), nil
}
func (e *H3aggregationtype) UnmarshalText(text []byte) error {
return e.Scan(text)
}
func (e H3aggregationtype) MarshalBinary() ([]byte, error) {
return []byte(e), nil
}
func (e *H3aggregationtype) UnmarshalBinary(data []byte) error {
return e.Scan(data)
}
func (e H3aggregationtype) Value() (driver.Value, error) {
return string(e), nil
}
func (e *H3aggregationtype) Scan(value any) error {
switch x := value.(type) {
case string:
*e = H3aggregationtype(x)
case []byte:
*e = H3aggregationtype(x)
case nil:
return fmt.Errorf("cannot nil into H3aggregationtype")
default:
return fmt.Errorf("cannot scan type %T: %v", value, value)
}
if !e.Valid() {
return fmt.Errorf("invalid H3aggregationtype value: %s", *e)
}
return nil
}
// Enum values for Hashtype
const (
HashtypeBcrypt14 Hashtype = "bcrypt-14"

View file

@ -120,9 +120,19 @@ var (
fsZones2WithParentsCascadingCtx = newContextual[bool]("fsZones2WithParentsCascading")
fsZones2RelOrganizationCtx = newContextual[bool]("fs_zones2.organization.fs_zones2.fs_zones2_organization_id_fkey")
// Relationship Contexts for geography_columns
geographyColumnWithParentsCascadingCtx = newContextual[bool]("geographyColumnWithParentsCascading")
// Relationship Contexts for geometry_columns
geometryColumnWithParentsCascadingCtx = newContextual[bool]("geometryColumnWithParentsCascading")
// Relationship Contexts for goose_db_version
gooseDBVersionWithParentsCascadingCtx = newContextual[bool]("gooseDBVersionWithParentsCascading")
// Relationship Contexts for h3_aggregation
h3AggregationWithParentsCascadingCtx = newContextual[bool]("h3AggregationWithParentsCascading")
h3AggregationRelOrganizationCtx = newContextual[bool]("h3_aggregation.organization.h3_aggregation.h3_aggregation_organization_id_fkey")
// Relationship Contexts for history_containerrelate
historyContainerrelateWithParentsCascadingCtx = newContextual[bool]("historyContainerrelateWithParentsCascading")
historyContainerrelateRelOrganizationCtx = newContextual[bool]("history_containerrelate.organization.history_containerrelate.history_containerrelate_organization_id_fkey")
@ -269,6 +279,7 @@ var (
organizationRelFSTreatmentareasCtx = newContextual[bool]("fs_treatmentarea.organization.fs_treatmentarea.fs_treatmentarea_organization_id_fkey")
organizationRelFSZonesCtx = newContextual[bool]("fs_zones.organization.fs_zones.fs_zones_organization_id_fkey")
organizationRelFSZones2sCtx = newContextual[bool]("fs_zones2.organization.fs_zones2.fs_zones2_organization_id_fkey")
organizationRelH3AggregationsCtx = newContextual[bool]("h3_aggregation.organization.h3_aggregation.h3_aggregation_organization_id_fkey")
organizationRelHistoryContainerrelatesCtx = newContextual[bool]("history_containerrelate.organization.history_containerrelate.history_containerrelate_organization_id_fkey")
organizationRelHistoryFieldscoutinglogsCtx = newContextual[bool]("history_fieldscoutinglog.organization.history_fieldscoutinglog.history_fieldscoutinglog_organization_id_fkey")
organizationRelHistoryHabitatrelatesCtx = newContextual[bool]("history_habitatrelate.organization.history_habitatrelate.history_habitatrelate_organization_id_fkey")
@ -298,9 +309,18 @@ var (
organizationRelHistoryZones2sCtx = newContextual[bool]("history_zones2.organization.history_zones2.history_zones2_organization_id_fkey")
organizationRelUserCtx = newContextual[bool]("organization.user_.user_.user__organization_id_fkey")
// Relationship Contexts for raster_columns
rasterColumnWithParentsCascadingCtx = newContextual[bool]("rasterColumnWithParentsCascading")
// Relationship Contexts for raster_overviews
rasterOverviewWithParentsCascadingCtx = newContextual[bool]("rasterOverviewWithParentsCascading")
// Relationship Contexts for sessions
sessionWithParentsCascadingCtx = newContextual[bool]("sessionWithParentsCascading")
// Relationship Contexts for spatial_ref_sys
spatialRefSyWithParentsCascadingCtx = newContextual[bool]("spatialRefSyWithParentsCascading")
// Relationship Contexts for user_
userWithParentsCascadingCtx = newContextual[bool]("userWithParentsCascading")
userRelUserNotificationsCtx = newContextual[bool]("notification.user_.notification.notification_user_id_fkey")

View file

@ -10,6 +10,7 @@ import (
enums "github.com/Gleipnir-Technology/nidus-sync/enums"
models "github.com/Gleipnir-Technology/nidus-sync/models"
"github.com/aarondl/opt/null"
"github.com/lib/pq"
)
type Factory struct {
@ -41,7 +42,10 @@ type Factory struct {
baseFSTreatmentareaMods FSTreatmentareaModSlice
baseFSZoneMods FSZoneModSlice
baseFSZones2Mods FSZones2ModSlice
baseGeographyColumnMods GeographyColumnModSlice
baseGeometryColumnMods GeometryColumnModSlice
baseGooseDBVersionMods GooseDBVersionModSlice
baseH3AggregationMods H3AggregationModSlice
baseHistoryContainerrelateMods HistoryContainerrelateModSlice
baseHistoryFieldscoutinglogMods HistoryFieldscoutinglogModSlice
baseHistoryHabitatrelateMods HistoryHabitatrelateModSlice
@ -72,7 +76,10 @@ type Factory struct {
baseNotificationMods NotificationModSlice
baseOauthTokenMods OauthTokenModSlice
baseOrganizationMods OrganizationModSlice
baseRasterColumnMods RasterColumnModSlice
baseRasterOverviewMods RasterOverviewModSlice
baseSessionMods SessionModSlice
baseSpatialRefSyMods SpatialRefSyModSlice
baseUserMods UserModSlice
}
@ -139,7 +146,7 @@ func (f *Factory) FromExistingFSContainerrelate(m *models.FSContainerrelate) *FS
o.Creator = func() null.Val[string] { return m.Creator }
o.Editdate = func() null.Val[int64] { return m.Editdate }
o.Editor = func() null.Val[string] { return m.Editor }
o.Globalid = func() null.Val[string] { return m.Globalid }
o.Globalid = func() string { return m.Globalid }
o.Inspsampleid = func() null.Val[string] { return m.Inspsampleid }
o.Mosquitoinspid = func() null.Val[string] { return m.Mosquitoinspid }
o.Objectid = func() int32 { return m.Objectid }
@ -184,7 +191,7 @@ func (f *Factory) FromExistingFSFieldscoutinglog(m *models.FSFieldscoutinglog) *
o.Creator = func() null.Val[string] { return m.Creator }
o.Editdate = func() null.Val[int64] { return m.Editdate }
o.Editor = func() null.Val[string] { return m.Editor }
o.Globalid = func() null.Val[string] { return m.Globalid }
o.Globalid = func() string { return m.Globalid }
o.Objectid = func() int32 { return m.Objectid }
o.Status = func() null.Val[int16] { return m.Status }
o.CreatedDate = func() null.Val[int64] { return m.CreatedDate }
@ -228,7 +235,7 @@ func (f *Factory) FromExistingFSHabitatrelate(m *models.FSHabitatrelate) *FSHabi
o.Editdate = func() null.Val[int64] { return m.Editdate }
o.Editor = func() null.Val[string] { return m.Editor }
o.ForeignID = func() null.Val[string] { return m.ForeignID }
o.Globalid = func() null.Val[string] { return m.Globalid }
o.Globalid = func() string { return m.Globalid }
o.Habitattype = func() null.Val[string] { return m.Habitattype }
o.Objectid = func() int32 { return m.Objectid }
o.CreatedDate = func() null.Val[int64] { return m.CreatedDate }
@ -271,7 +278,7 @@ func (f *Factory) FromExistingFSInspectionsample(m *models.FSInspectionsample) *
o.Creator = func() null.Val[string] { return m.Creator }
o.Editdate = func() null.Val[int64] { return m.Editdate }
o.Editor = func() null.Val[string] { return m.Editor }
o.Globalid = func() null.Val[string] { return m.Globalid }
o.Globalid = func() string { return m.Globalid }
o.Idbytech = func() null.Val[string] { return m.Idbytech }
o.InspID = func() null.Val[string] { return m.InspID }
o.Objectid = func() int32 { return m.Objectid }
@ -325,7 +332,7 @@ func (f *Factory) FromExistingFSInspectionsampledetail(m *models.FSInspectionsam
o.Flarvcount = func() null.Val[int16] { return m.Flarvcount }
o.Flstages = func() null.Val[string] { return m.Flstages }
o.Fpupcount = func() null.Val[int16] { return m.Fpupcount }
o.Globalid = func() null.Val[string] { return m.Globalid }
o.Globalid = func() string { return m.Globalid }
o.InspsampleID = func() null.Val[string] { return m.InspsampleID }
o.Labspecies = func() null.Val[string] { return m.Labspecies }
o.Ldomstage = func() null.Val[string] { return m.Ldomstage }
@ -380,7 +387,7 @@ func (f *Factory) FromExistingFSLinelocation(m *models.FSLinelocation) *FSLinelo
o.Externalid = func() null.Val[string] { return m.Externalid }
o.Editdate = func() null.Val[int64] { return m.Editdate }
o.Editor = func() null.Val[string] { return m.Editor }
o.Globalid = func() null.Val[string] { return m.Globalid }
o.Globalid = func() string { return m.Globalid }
o.Habitat = func() null.Val[string] { return m.Habitat }
o.Hectares = func() null.Val[float64] { return m.Hectares }
o.Jurisdiction = func() null.Val[string] { return m.Jurisdiction }
@ -456,7 +463,7 @@ func (f *Factory) FromExistingFSLocationtracking(m *models.FSLocationtracking) *
o.Editdate = func() null.Val[int64] { return m.Editdate }
o.Editor = func() null.Val[string] { return m.Editor }
o.Fieldtech = func() null.Val[string] { return m.Fieldtech }
o.Globalid = func() null.Val[string] { return m.Globalid }
o.Globalid = func() string { return m.Globalid }
o.Objectid = func() int32 { return m.Objectid }
o.CreatedDate = func() null.Val[int64] { return m.CreatedDate }
o.CreatedUser = func() null.Val[string] { return m.CreatedUser }
@ -513,7 +520,7 @@ func (f *Factory) FromExistingFSMosquitoinspection(m *models.FSMosquitoinspectio
o.Editor = func() null.Val[string] { return m.Editor }
o.Fieldspecies = func() null.Val[string] { return m.Fieldspecies }
o.Fieldtech = func() null.Val[string] { return m.Fieldtech }
o.Globalid = func() null.Val[string] { return m.Globalid }
o.Globalid = func() string { return m.Globalid }
o.Jurisdiction = func() null.Val[string] { return m.Jurisdiction }
o.Larvaepresent = func() null.Val[int16] { return m.Larvaepresent }
o.Linelocid = func() null.Val[string] { return m.Linelocid }
@ -592,7 +599,7 @@ func (f *Factory) FromExistingFSPointlocation(m *models.FSPointlocation) *FSPoin
o.Externalid = func() null.Val[string] { return m.Externalid }
o.Editdate = func() null.Val[int64] { return m.Editdate }
o.Editor = func() null.Val[string] { return m.Editor }
o.Globalid = func() null.Val[string] { return m.Globalid }
o.Globalid = func() string { return m.Globalid }
o.Habitat = func() null.Val[string] { return m.Habitat }
o.Jurisdiction = func() null.Val[string] { return m.Jurisdiction }
o.Larvinspectinterval = func() null.Val[int16] { return m.Larvinspectinterval }
@ -623,8 +630,8 @@ func (f *Factory) FromExistingFSPointlocation(m *models.FSPointlocation) *FSPoin
o.Y = func() null.Val[float64] { return m.Y }
o.Zone = func() null.Val[string] { return m.Zone }
o.Zone2 = func() null.Val[string] { return m.Zone2 }
o.GeometryX = func() null.Val[float64] { return m.GeometryX }
o.GeometryY = func() null.Val[float64] { return m.GeometryY }
o.GeometryX = func() float64 { return m.GeometryX }
o.GeometryY = func() float64 { return m.GeometryY }
o.Assignedtech = func() null.Val[string] { return m.Assignedtech }
o.DeactivateReason = func() null.Val[string] { return m.DeactivateReason }
o.Scalarpriority = func() null.Val[int64] { return m.Scalarpriority }
@ -670,7 +677,7 @@ func (f *Factory) FromExistingFSPolygonlocation(m *models.FSPolygonlocation) *FS
o.Editdate = func() null.Val[int64] { return m.Editdate }
o.Editor = func() null.Val[string] { return m.Editor }
o.Filter = func() null.Val[string] { return m.Filter }
o.Globalid = func() null.Val[string] { return m.Globalid }
o.Globalid = func() string { return m.Globalid }
o.Habitat = func() null.Val[string] { return m.Habitat }
o.Hectares = func() null.Val[float64] { return m.Hectares }
o.Jurisdiction = func() null.Val[string] { return m.Jurisdiction }
@ -743,7 +750,7 @@ func (f *Factory) FromExistingFSPool(m *models.FSPool) *FSPoolTemplate {
o.Editdate = func() null.Val[int64] { return m.Editdate }
o.Editor = func() null.Val[string] { return m.Editor }
o.Gatewaysync = func() null.Val[int16] { return m.Gatewaysync }
o.Globalid = func() null.Val[string] { return m.Globalid }
o.Globalid = func() string { return m.Globalid }
o.Lab = func() null.Val[string] { return m.Lab }
o.LabID = func() null.Val[string] { return m.LabID }
o.Objectid = func() int32 { return m.Objectid }
@ -798,7 +805,7 @@ func (f *Factory) FromExistingFSPooldetail(m *models.FSPooldetail) *FSPooldetail
o.Editdate = func() null.Val[int64] { return m.Editdate }
o.Editor = func() null.Val[string] { return m.Editor }
o.Females = func() null.Val[int16] { return m.Females }
o.Globalid = func() null.Val[string] { return m.Globalid }
o.Globalid = func() string { return m.Globalid }
o.Objectid = func() int32 { return m.Objectid }
o.PoolID = func() null.Val[string] { return m.PoolID }
o.Species = func() null.Val[string] { return m.Species }
@ -850,7 +857,7 @@ func (f *Factory) FromExistingFSProposedtreatmentarea(m *models.FSProposedtreatm
o.Exported = func() null.Val[int16] { return m.Exported }
o.Editdate = func() null.Val[int64] { return m.Editdate }
o.Editor = func() null.Val[string] { return m.Editor }
o.Globalid = func() null.Val[string] { return m.Globalid }
o.Globalid = func() string { return m.Globalid }
o.Hectares = func() null.Val[float64] { return m.Hectares }
o.Issprayroute = func() null.Val[int16] { return m.Issprayroute }
o.Lasttreatactivity = func() null.Val[string] { return m.Lasttreatactivity }
@ -918,7 +925,7 @@ func (f *Factory) FromExistingFSQamosquitoinspection(m *models.FSQamosquitoinspe
o.Editor = func() null.Val[string] { return m.Editor }
o.Fieldtech = func() null.Val[string] { return m.Fieldtech }
o.Fish = func() null.Val[int16] { return m.Fish }
o.Globalid = func() null.Val[string] { return m.Globalid }
o.Globalid = func() string { return m.Globalid }
o.Habvalue1 = func() null.Val[int16] { return m.Habvalue1 }
o.Habvalue1percent = func() null.Val[int16] { return m.Habvalue1percent }
o.Habvalue2 = func() null.Val[int16] { return m.Habvalue2 }
@ -1007,7 +1014,7 @@ func (f *Factory) FromExistingFSRodentlocation(m *models.FSRodentlocation) *FSRo
o.Externalid = func() null.Val[string] { return m.Externalid }
o.Editdate = func() null.Val[int64] { return m.Editdate }
o.Editor = func() null.Val[string] { return m.Editor }
o.Globalid = func() null.Val[string] { return m.Globalid }
o.Globalid = func() string { return m.Globalid }
o.Habitat = func() null.Val[string] { return m.Habitat }
o.Lastinspectaction = func() null.Val[string] { return m.Lastinspectaction }
o.Lastinspectconditions = func() null.Val[string] { return m.Lastinspectconditions }
@ -1076,7 +1083,7 @@ func (f *Factory) FromExistingFSSamplecollection(m *models.FSSamplecollection) *
o.Fieldtech = func() null.Val[string] { return m.Fieldtech }
o.Flockid = func() null.Val[string] { return m.Flockid }
o.Gatewaysync = func() null.Val[int16] { return m.Gatewaysync }
o.Globalid = func() null.Val[string] { return m.Globalid }
o.Globalid = func() string { return m.Globalid }
o.Lab = func() null.Val[string] { return m.Lab }
o.Locationname = func() null.Val[string] { return m.Locationname }
o.LocID = func() null.Val[string] { return m.LocID }
@ -1148,7 +1155,7 @@ func (f *Factory) FromExistingFSSamplelocation(m *models.FSSamplelocation) *FSSa
o.Editdate = func() null.Val[int64] { return m.Editdate }
o.Editor = func() null.Val[string] { return m.Editor }
o.Gatewaysync = func() null.Val[int16] { return m.Gatewaysync }
o.Globalid = func() null.Val[string] { return m.Globalid }
o.Globalid = func() string { return m.Globalid }
o.Habitat = func() null.Val[string] { return m.Habitat }
o.Locationnumber = func() null.Val[int64] { return m.Locationnumber }
o.Name = func() null.Val[string] { return m.Name }
@ -1224,7 +1231,7 @@ func (f *Factory) FromExistingFSServicerequest(m *models.FSServicerequest) *FSSe
o.Editdate = func() null.Val[int64] { return m.Editdate }
o.Editor = func() null.Val[string] { return m.Editor }
o.Firstresponsedate = func() null.Val[int64] { return m.Firstresponsedate }
o.Globalid = func() null.Val[string] { return m.Globalid }
o.Globalid = func() string { return m.Globalid }
o.Issuesreported = func() null.Val[string] { return m.Issuesreported }
o.Jurisdiction = func() null.Val[string] { return m.Jurisdiction }
o.Nextaction = func() null.Val[string] { return m.Nextaction }
@ -1274,8 +1281,8 @@ func (f *Factory) FromExistingFSServicerequest(m *models.FSServicerequest) *FSSe
o.Zone2 = func() null.Val[string] { return m.Zone2 }
o.CreatedDate = func() null.Val[int64] { return m.CreatedDate }
o.CreatedUser = func() null.Val[string] { return m.CreatedUser }
o.GeometryX = func() null.Val[float64] { return m.GeometryX }
o.GeometryY = func() null.Val[float64] { return m.GeometryY }
o.GeometryX = func() float64 { return m.GeometryX }
o.GeometryY = func() float64 { return m.GeometryY }
o.LastEditedDate = func() null.Val[int64] { return m.LastEditedDate }
o.LastEditedUser = func() null.Val[string] { return m.LastEditedUser }
o.Dog = func() null.Val[int64] { return m.Dog }
@ -1320,7 +1327,7 @@ func (f *Factory) FromExistingFSSpeciesabundance(m *models.FSSpeciesabundance) *
o.Editor = func() null.Val[string] { return m.Editor }
o.Females = func() null.Val[int64] { return m.Females }
o.Gravidfem = func() null.Val[int16] { return m.Gravidfem }
o.Globalid = func() null.Val[string] { return m.Globalid }
o.Globalid = func() string { return m.Globalid }
o.Larvae = func() null.Val[int16] { return m.Larvae }
o.Males = func() null.Val[int16] { return m.Males }
o.Objectid = func() int32 { return m.Objectid }
@ -1377,7 +1384,7 @@ func (f *Factory) FromExistingFSStormdrain(m *models.FSStormdrain) *FSStormdrain
o.Creator = func() null.Val[string] { return m.Creator }
o.Editdate = func() null.Val[int64] { return m.Editdate }
o.Editor = func() null.Val[string] { return m.Editor }
o.Globalid = func() null.Val[string] { return m.Globalid }
o.Globalid = func() string { return m.Globalid }
o.Jurisdiction = func() null.Val[string] { return m.Jurisdiction }
o.Lastaction = func() null.Val[string] { return m.Lastaction }
o.Laststatus = func() null.Val[string] { return m.Laststatus }
@ -1434,7 +1441,7 @@ func (f *Factory) FromExistingFSTimecard(m *models.FSTimecard) *FSTimecardTempla
o.Editdate = func() null.Val[int64] { return m.Editdate }
o.Editor = func() null.Val[string] { return m.Editor }
o.Fieldtech = func() null.Val[string] { return m.Fieldtech }
o.Globalid = func() null.Val[string] { return m.Globalid }
o.Globalid = func() string { return m.Globalid }
o.Lclocid = func() null.Val[string] { return m.Lclocid }
o.Linelocid = func() null.Val[string] { return m.Linelocid }
o.Locationname = func() null.Val[string] { return m.Locationname }
@ -1494,7 +1501,7 @@ func (f *Factory) FromExistingFSTrapdatum(m *models.FSTrapdatum) *FSTrapdatumTem
o.Fieldtech = func() null.Val[string] { return m.Fieldtech }
o.Field = func() null.Val[int64] { return m.Field }
o.Gatewaysync = func() null.Val[int16] { return m.Gatewaysync }
o.Globalid = func() null.Val[string] { return m.Globalid }
o.Globalid = func() string { return m.Globalid }
o.Idbytech = func() null.Val[string] { return m.Idbytech }
o.Locationname = func() null.Val[string] { return m.Locationname }
o.LocID = func() null.Val[string] { return m.LocID }
@ -1568,7 +1575,7 @@ func (f *Factory) FromExistingFSTraplocation(m *models.FSTraplocation) *FSTraplo
o.Editdate = func() null.Val[int64] { return m.Editdate }
o.Editor = func() null.Val[string] { return m.Editor }
o.Gatewaysync = func() null.Val[int16] { return m.Gatewaysync }
o.Globalid = func() null.Val[string] { return m.Globalid }
o.Globalid = func() string { return m.Globalid }
o.Habitat = func() null.Val[string] { return m.Habitat }
o.Locationnumber = func() null.Val[int64] { return m.Locationnumber }
o.Name = func() null.Val[string] { return m.Name }
@ -1635,7 +1642,7 @@ func (f *Factory) FromExistingFSTreatment(m *models.FSTreatment) *FSTreatmentTem
o.Editor = func() null.Val[string] { return m.Editor }
o.Fieldtech = func() null.Val[string] { return m.Fieldtech }
o.Flowrate = func() null.Val[float64] { return m.Flowrate }
o.Globalid = func() null.Val[string] { return m.Globalid }
o.Globalid = func() string { return m.Globalid }
o.Habitat = func() null.Val[string] { return m.Habitat }
o.InspID = func() null.Val[string] { return m.InspID }
o.Invloc = func() null.Val[string] { return m.Invloc }
@ -1711,7 +1718,7 @@ func (f *Factory) FromExistingFSTreatmentarea(m *models.FSTreatmentarea) *FSTrea
o.Creator = func() null.Val[string] { return m.Creator }
o.Editdate = func() null.Val[int64] { return m.Editdate }
o.Editor = func() null.Val[string] { return m.Editor }
o.Globalid = func() null.Val[string] { return m.Globalid }
o.Globalid = func() string { return m.Globalid }
o.Notified = func() null.Val[int16] { return m.Notified }
o.Objectid = func() int32 { return m.Objectid }
o.SessionID = func() null.Val[string] { return m.SessionID }
@ -1761,7 +1768,7 @@ func (f *Factory) FromExistingFSZone(m *models.FSZone) *FSZoneTemplate {
o.Creator = func() null.Val[string] { return m.Creator }
o.Editdate = func() null.Val[int64] { return m.Editdate }
o.Editor = func() null.Val[string] { return m.Editor }
o.Globalid = func() null.Val[string] { return m.Globalid }
o.Globalid = func() string { return m.Globalid }
o.Name = func() null.Val[string] { return m.Name }
o.Objectid = func() int32 { return m.Objectid }
o.ShapeArea = func() null.Val[float64] { return m.ShapeArea }
@ -1806,7 +1813,7 @@ func (f *Factory) FromExistingFSZones2(m *models.FSZones2) *FSZones2Template {
o.Creator = func() null.Val[string] { return m.Creator }
o.Editdate = func() null.Val[int64] { return m.Editdate }
o.Editor = func() null.Val[string] { return m.Editor }
o.Globalid = func() null.Val[string] { return m.Globalid }
o.Globalid = func() string { return m.Globalid }
o.Name = func() null.Val[string] { return m.Name }
o.Objectid = func() int32 { return m.Objectid }
o.ShapeArea = func() null.Val[float64] { return m.ShapeArea }
@ -1827,6 +1834,66 @@ func (f *Factory) FromExistingFSZones2(m *models.FSZones2) *FSZones2Template {
return o
}
func (f *Factory) NewGeographyColumn(mods ...GeographyColumnMod) *GeographyColumnTemplate {
return f.NewGeographyColumnWithContext(context.Background(), mods...)
}
func (f *Factory) NewGeographyColumnWithContext(ctx context.Context, mods ...GeographyColumnMod) *GeographyColumnTemplate {
o := &GeographyColumnTemplate{f: f}
if f != nil {
f.baseGeographyColumnMods.Apply(ctx, o)
}
GeographyColumnModSlice(mods).Apply(ctx, o)
return o
}
func (f *Factory) FromExistingGeographyColumn(m *models.GeographyColumn) *GeographyColumnTemplate {
o := &GeographyColumnTemplate{f: f, alreadyPersisted: true}
o.FTableCatalog = func() null.Val[string] { return m.FTableCatalog }
o.FTableSchema = func() null.Val[string] { return m.FTableSchema }
o.FTableName = func() null.Val[string] { return m.FTableName }
o.FGeographyColumn = func() null.Val[string] { return m.FGeographyColumn }
o.CoordDimension = func() null.Val[int32] { return m.CoordDimension }
o.Srid = func() null.Val[int32] { return m.Srid }
o.Type = func() null.Val[string] { return m.Type }
return o
}
func (f *Factory) NewGeometryColumn(mods ...GeometryColumnMod) *GeometryColumnTemplate {
return f.NewGeometryColumnWithContext(context.Background(), mods...)
}
func (f *Factory) NewGeometryColumnWithContext(ctx context.Context, mods ...GeometryColumnMod) *GeometryColumnTemplate {
o := &GeometryColumnTemplate{f: f}
if f != nil {
f.baseGeometryColumnMods.Apply(ctx, o)
}
GeometryColumnModSlice(mods).Apply(ctx, o)
return o
}
func (f *Factory) FromExistingGeometryColumn(m *models.GeometryColumn) *GeometryColumnTemplate {
o := &GeometryColumnTemplate{f: f, alreadyPersisted: true}
o.FTableCatalog = func() null.Val[string] { return m.FTableCatalog }
o.FTableSchema = func() null.Val[string] { return m.FTableSchema }
o.FTableName = func() null.Val[string] { return m.FTableName }
o.FGeometryColumn = func() null.Val[string] { return m.FGeometryColumn }
o.CoordDimension = func() null.Val[int32] { return m.CoordDimension }
o.Srid = func() null.Val[int32] { return m.Srid }
o.Type = func() null.Val[string] { return m.Type }
return o
}
func (f *Factory) NewGooseDBVersion(mods ...GooseDBVersionMod) *GooseDBVersionTemplate {
return f.NewGooseDBVersionWithContext(context.Background(), mods...)
}
@ -1854,6 +1921,40 @@ func (f *Factory) FromExistingGooseDBVersion(m *models.GooseDBVersion) *GooseDBV
return o
}
func (f *Factory) NewH3Aggregation(mods ...H3AggregationMod) *H3AggregationTemplate {
return f.NewH3AggregationWithContext(context.Background(), mods...)
}
func (f *Factory) NewH3AggregationWithContext(ctx context.Context, mods ...H3AggregationMod) *H3AggregationTemplate {
o := &H3AggregationTemplate{f: f}
if f != nil {
f.baseH3AggregationMods.Apply(ctx, o)
}
H3AggregationModSlice(mods).Apply(ctx, o)
return o
}
func (f *Factory) FromExistingH3Aggregation(m *models.H3Aggregation) *H3AggregationTemplate {
o := &H3AggregationTemplate{f: f, alreadyPersisted: true}
o.ID = func() int32 { return m.ID }
o.Cell = func() string { return m.Cell }
o.Resolution = func() int32 { return m.Resolution }
o.Count = func() int32 { return m.Count }
o.Type = func() enums.H3aggregationtype { return m.Type }
o.OrganizationID = func() int32 { return m.OrganizationID }
ctx := context.Background()
if m.R.Organization != nil {
H3AggregationMods.WithExistingOrganization(m.R.Organization).Apply(ctx, o)
}
return o
}
func (f *Factory) NewHistoryContainerrelate(mods ...HistoryContainerrelateMod) *HistoryContainerrelateTemplate {
return f.NewHistoryContainerrelateWithContext(context.Background(), mods...)
}
@ -3777,6 +3878,9 @@ func (f *Factory) FromExistingOrganization(m *models.Organization) *Organization
if len(m.R.FSZones2s) > 0 {
OrganizationMods.AddExistingFSZones2s(m.R.FSZones2s...).Apply(ctx, o)
}
if len(m.R.H3Aggregations) > 0 {
OrganizationMods.AddExistingH3Aggregations(m.R.H3Aggregations...).Apply(ctx, o)
}
if len(m.R.HistoryContainerrelates) > 0 {
OrganizationMods.AddExistingHistoryContainerrelates(m.R.HistoryContainerrelates...).Apply(ctx, o)
}
@ -3865,6 +3969,78 @@ func (f *Factory) FromExistingOrganization(m *models.Organization) *Organization
return o
}
func (f *Factory) NewRasterColumn(mods ...RasterColumnMod) *RasterColumnTemplate {
return f.NewRasterColumnWithContext(context.Background(), mods...)
}
func (f *Factory) NewRasterColumnWithContext(ctx context.Context, mods ...RasterColumnMod) *RasterColumnTemplate {
o := &RasterColumnTemplate{f: f}
if f != nil {
f.baseRasterColumnMods.Apply(ctx, o)
}
RasterColumnModSlice(mods).Apply(ctx, o)
return o
}
func (f *Factory) FromExistingRasterColumn(m *models.RasterColumn) *RasterColumnTemplate {
o := &RasterColumnTemplate{f: f, alreadyPersisted: true}
o.RTableCatalog = func() null.Val[string] { return m.RTableCatalog }
o.RTableSchema = func() null.Val[string] { return m.RTableSchema }
o.RTableName = func() null.Val[string] { return m.RTableName }
o.RRasterColumn = func() null.Val[string] { return m.RRasterColumn }
o.Srid = func() null.Val[int32] { return m.Srid }
o.ScaleX = func() null.Val[float64] { return m.ScaleX }
o.ScaleY = func() null.Val[float64] { return m.ScaleY }
o.BlocksizeX = func() null.Val[int32] { return m.BlocksizeX }
o.BlocksizeY = func() null.Val[int32] { return m.BlocksizeY }
o.SameAlignment = func() null.Val[bool] { return m.SameAlignment }
o.RegularBlocking = func() null.Val[bool] { return m.RegularBlocking }
o.NumBands = func() null.Val[int32] { return m.NumBands }
o.PixelTypes = func() null.Val[pq.StringArray] { return m.PixelTypes }
o.NodataValues = func() null.Val[pq.Float64Array] { return m.NodataValues }
o.OutDB = func() null.Val[pq.BoolArray] { return m.OutDB }
o.Extent = func() null.Val[string] { return m.Extent }
o.SpatialIndex = func() null.Val[bool] { return m.SpatialIndex }
return o
}
func (f *Factory) NewRasterOverview(mods ...RasterOverviewMod) *RasterOverviewTemplate {
return f.NewRasterOverviewWithContext(context.Background(), mods...)
}
func (f *Factory) NewRasterOverviewWithContext(ctx context.Context, mods ...RasterOverviewMod) *RasterOverviewTemplate {
o := &RasterOverviewTemplate{f: f}
if f != nil {
f.baseRasterOverviewMods.Apply(ctx, o)
}
RasterOverviewModSlice(mods).Apply(ctx, o)
return o
}
func (f *Factory) FromExistingRasterOverview(m *models.RasterOverview) *RasterOverviewTemplate {
o := &RasterOverviewTemplate{f: f, alreadyPersisted: true}
o.OTableCatalog = func() null.Val[string] { return m.OTableCatalog }
o.OTableSchema = func() null.Val[string] { return m.OTableSchema }
o.OTableName = func() null.Val[string] { return m.OTableName }
o.ORasterColumn = func() null.Val[string] { return m.ORasterColumn }
o.RTableCatalog = func() null.Val[string] { return m.RTableCatalog }
o.RTableSchema = func() null.Val[string] { return m.RTableSchema }
o.RTableName = func() null.Val[string] { return m.RTableName }
o.RRasterColumn = func() null.Val[string] { return m.RRasterColumn }
o.OverviewFactor = func() null.Val[int32] { return m.OverviewFactor }
return o
}
func (f *Factory) NewSession(mods ...SessionMod) *SessionTemplate {
return f.NewSessionWithContext(context.Background(), mods...)
}
@ -3891,6 +4067,34 @@ func (f *Factory) FromExistingSession(m *models.Session) *SessionTemplate {
return o
}
func (f *Factory) NewSpatialRefSy(mods ...SpatialRefSyMod) *SpatialRefSyTemplate {
return f.NewSpatialRefSyWithContext(context.Background(), mods...)
}
func (f *Factory) NewSpatialRefSyWithContext(ctx context.Context, mods ...SpatialRefSyMod) *SpatialRefSyTemplate {
o := &SpatialRefSyTemplate{f: f}
if f != nil {
f.baseSpatialRefSyMods.Apply(ctx, o)
}
SpatialRefSyModSlice(mods).Apply(ctx, o)
return o
}
func (f *Factory) FromExistingSpatialRefSy(m *models.SpatialRefSy) *SpatialRefSyTemplate {
o := &SpatialRefSyTemplate{f: f, alreadyPersisted: true}
o.Srid = func() int32 { return m.Srid }
o.AuthName = func() null.Val[string] { return m.AuthName }
o.AuthSrid = func() null.Val[int32] { return m.AuthSrid }
o.Srtext = func() null.Val[string] { return m.Srtext }
o.Proj4text = func() null.Val[string] { return m.Proj4text }
return o
}
func (f *Factory) NewUser(mods ...UserMod) *UserTemplate {
return f.NewUserWithContext(context.Background(), mods...)
}
@ -4161,6 +4365,22 @@ func (f *Factory) AddBaseFSZones2Mod(mods ...FSZones2Mod) {
f.baseFSZones2Mods = append(f.baseFSZones2Mods, mods...)
}
func (f *Factory) ClearBaseGeographyColumnMods() {
f.baseGeographyColumnMods = nil
}
func (f *Factory) AddBaseGeographyColumnMod(mods ...GeographyColumnMod) {
f.baseGeographyColumnMods = append(f.baseGeographyColumnMods, mods...)
}
func (f *Factory) ClearBaseGeometryColumnMods() {
f.baseGeometryColumnMods = nil
}
func (f *Factory) AddBaseGeometryColumnMod(mods ...GeometryColumnMod) {
f.baseGeometryColumnMods = append(f.baseGeometryColumnMods, mods...)
}
func (f *Factory) ClearBaseGooseDBVersionMods() {
f.baseGooseDBVersionMods = nil
}
@ -4169,6 +4389,14 @@ func (f *Factory) AddBaseGooseDBVersionMod(mods ...GooseDBVersionMod) {
f.baseGooseDBVersionMods = append(f.baseGooseDBVersionMods, mods...)
}
func (f *Factory) ClearBaseH3AggregationMods() {
f.baseH3AggregationMods = nil
}
func (f *Factory) AddBaseH3AggregationMod(mods ...H3AggregationMod) {
f.baseH3AggregationMods = append(f.baseH3AggregationMods, mods...)
}
func (f *Factory) ClearBaseHistoryContainerrelateMods() {
f.baseHistoryContainerrelateMods = nil
}
@ -4409,6 +4637,22 @@ func (f *Factory) AddBaseOrganizationMod(mods ...OrganizationMod) {
f.baseOrganizationMods = append(f.baseOrganizationMods, mods...)
}
func (f *Factory) ClearBaseRasterColumnMods() {
f.baseRasterColumnMods = nil
}
func (f *Factory) AddBaseRasterColumnMod(mods ...RasterColumnMod) {
f.baseRasterColumnMods = append(f.baseRasterColumnMods, mods...)
}
func (f *Factory) ClearBaseRasterOverviewMods() {
f.baseRasterOverviewMods = nil
}
func (f *Factory) AddBaseRasterOverviewMod(mods ...RasterOverviewMod) {
f.baseRasterOverviewMods = append(f.baseRasterOverviewMods, mods...)
}
func (f *Factory) ClearBaseSessionMods() {
f.baseSessionMods = nil
}
@ -4417,6 +4661,14 @@ func (f *Factory) AddBaseSessionMod(mods ...SessionMod) {
f.baseSessionMods = append(f.baseSessionMods, mods...)
}
func (f *Factory) ClearBaseSpatialRefSyMods() {
f.baseSpatialRefSyMods = nil
}
func (f *Factory) AddBaseSpatialRefSyMod(mods ...SpatialRefSyMod) {
f.baseSpatialRefSyMods = append(f.baseSpatialRefSyMods, mods...)
}
func (f *Factory) ClearBaseUserMods() {
f.baseUserMods = nil
}

View file

@ -704,6 +704,30 @@ func TestCreateGooseDBVersion(t *testing.T) {
}
}
func TestCreateH3Aggregation(t *testing.T) {
if testDB == nil {
t.Skip("skipping test, no DSN provided")
}
ctx, cancel := context.WithCancel(t.Context())
t.Cleanup(cancel)
tx, err := testDB.Begin(ctx)
if err != nil {
t.Fatalf("Error starting transaction: %v", err)
}
defer func() {
if err := tx.Rollback(ctx); err != nil {
t.Fatalf("Error rolling back transaction: %v", err)
}
}()
if _, err := New().NewH3AggregationWithContext(ctx).Create(ctx, tx); err != nil {
t.Fatalf("Error creating H3Aggregation: %v", err)
}
}
func TestCreateHistoryContainerrelate(t *testing.T) {
if testDB == nil {
t.Skip("skipping test, no DSN provided")
@ -1448,6 +1472,30 @@ func TestCreateSession(t *testing.T) {
}
}
func TestCreateSpatialRefSy(t *testing.T) {
if testDB == nil {
t.Skip("skipping test, no DSN provided")
}
ctx, cancel := context.WithCancel(t.Context())
t.Cleanup(cancel)
tx, err := testDB.Begin(ctx)
if err != nil {
t.Fatalf("Error starting transaction: %v", err)
}
defer func() {
if err := tx.Rollback(ctx); err != nil {
t.Fatalf("Error rolling back transaction: %v", err)
}
}()
if _, err := New().NewSpatialRefSyWithContext(ctx).Create(ctx, tx); err != nil {
t.Fatalf("Error creating SpatialRefSy: %v", err)
}
}
func TestCreateUser(t *testing.T) {
if testDB == nil {
t.Skip("skipping test, no DSN provided")

View file

@ -11,6 +11,7 @@ import (
enums "github.com/Gleipnir-Technology/nidus-sync/enums"
"github.com/jaswdr/faker/v2"
"github.com/lib/pq"
)
var defaultFaker = faker.New()
@ -41,6 +42,16 @@ func random_enums_Arcgislicensetype(f *faker.Faker, limits ...string) enums.Arcg
return all[f.IntBetween(0, len(all)-1)]
}
func random_enums_H3aggregationtype(f *faker.Faker, limits ...string) enums.H3aggregationtype {
if f == nil {
f = &defaultFaker
}
var e enums.H3aggregationtype
all := e.All()
return all[f.IntBetween(0, len(all)-1)]
}
func random_enums_Hashtype(f *faker.Faker, limits ...string) enums.Hashtype {
if f == nil {
f = &defaultFaker
@ -114,6 +125,42 @@ func random_int64(f *faker.Faker, limits ...string) int64 {
return f.Int64()
}
func random_pq_BoolArray(f *faker.Faker, limits ...string) pq.BoolArray {
if f == nil {
f = &defaultFaker
}
arr := make(pq.BoolArray, f.IntBetween(1, 5))
for i := range arr {
arr[i] = random_bool(f, limits...)
}
return arr
}
func random_pq_Float64Array(f *faker.Faker, limits ...string) pq.Float64Array {
if f == nil {
f = &defaultFaker
}
arr := make(pq.Float64Array, f.IntBetween(1, 5))
for i := range arr {
arr[i] = random_float64(f, limits...)
}
return arr
}
func random_pq_StringArray(f *faker.Faker, limits ...string) pq.StringArray {
if f == nil {
f = &defaultFaker
}
arr := make(pq.StringArray, f.IntBetween(1, 5))
for i := range arr {
arr[i] = random_string(f, limits...)
}
return arr
}
func random_string(f *faker.Faker, limits ...string) string {
if f == nil {
f = &defaultFaker

View file

@ -5,6 +5,7 @@ package factory
import (
"bytes"
"slices"
"testing"
"github.com/stephenafamo/bob"
@ -68,6 +69,28 @@ func TestRandom_int64(t *testing.T) {
}
}
func TestRandom_pq_Float64Array(t *testing.T) {
t.Parallel()
val1 := random_pq_Float64Array(nil)
val2 := random_pq_Float64Array(nil)
if slices.Equal(val1, val2) {
t.Fatalf("random_pq_Float64Array() returned the same value twice: %v", val1)
}
}
func TestRandom_pq_StringArray(t *testing.T) {
t.Parallel()
val1 := random_pq_StringArray(nil)
val2 := random_pq_StringArray(nil)
if slices.Equal(val1, val2) {
t.Fatalf("random_pq_StringArray() returned the same value twice: %v", val1)
}
}
func TestRandom_string(t *testing.T) {
t.Parallel()

View file

@ -43,7 +43,7 @@ type FSContainerrelateTemplate struct {
Creator func() null.Val[string]
Editdate func() null.Val[int64]
Editor func() null.Val[string]
Globalid func() null.Val[string]
Globalid func() string
Inspsampleid func() null.Val[string]
Mosquitoinspid func() null.Val[string]
Objectid func() int32
@ -119,7 +119,7 @@ func (o FSContainerrelateTemplate) BuildSetter() *models.FSContainerrelateSetter
}
if o.Globalid != nil {
val := o.Globalid()
m.Globalid = omitnull.FromNull(val)
m.Globalid = omit.From(val)
}
if o.Inspsampleid != nil {
val := o.Inspsampleid()
@ -265,6 +265,10 @@ func ensureCreatableFSContainerrelate(m *models.FSContainerrelateSetter) {
val := random_int32(nil)
m.OrganizationID = omit.From(val)
}
if !(m.Globalid.IsValue()) {
val := random_string(nil)
m.Globalid = omit.From(val)
}
if !(m.Objectid.IsValue()) {
val := random_int32(nil)
m.Objectid = omit.From(val)
@ -706,14 +710,14 @@ func (m fsContainerrelateMods) RandomEditorNotNull(f *faker.Faker) FSContainerre
}
// Set the model columns to this value
func (m fsContainerrelateMods) Globalid(val null.Val[string]) FSContainerrelateMod {
func (m fsContainerrelateMods) Globalid(val string) FSContainerrelateMod {
return FSContainerrelateModFunc(func(_ context.Context, o *FSContainerrelateTemplate) {
o.Globalid = func() null.Val[string] { return val }
o.Globalid = func() string { return val }
})
}
// Set the Column from the function
func (m fsContainerrelateMods) GlobalidFunc(f func() null.Val[string]) FSContainerrelateMod {
func (m fsContainerrelateMods) GlobalidFunc(f func() string) FSContainerrelateMod {
return FSContainerrelateModFunc(func(_ context.Context, o *FSContainerrelateTemplate) {
o.Globalid = f
})
@ -728,32 +732,10 @@ func (m fsContainerrelateMods) UnsetGlobalid() FSContainerrelateMod {
// 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 fsContainerrelateMods) RandomGlobalid(f *faker.Faker) FSContainerrelateMod {
return FSContainerrelateModFunc(func(_ context.Context, o *FSContainerrelateTemplate) {
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 fsContainerrelateMods) RandomGlobalidNotNull(f *faker.Faker) FSContainerrelateMod {
return FSContainerrelateModFunc(func(_ context.Context, o *FSContainerrelateTemplate) {
o.Globalid = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
o.Globalid = func() string {
return random_string(f)
}
})
}

View file

@ -42,7 +42,7 @@ type FSFieldscoutinglogTemplate struct {
Creator func() null.Val[string]
Editdate func() null.Val[int64]
Editor func() null.Val[string]
Globalid func() null.Val[string]
Globalid func() string
Objectid func() int32
Status func() null.Val[int16]
CreatedDate func() null.Val[int64]
@ -112,7 +112,7 @@ func (o FSFieldscoutinglogTemplate) BuildSetter() *models.FSFieldscoutinglogSett
}
if o.Globalid != nil {
val := o.Globalid()
m.Globalid = omitnull.FromNull(val)
m.Globalid = omit.From(val)
}
if o.Objectid != nil {
val := o.Objectid()
@ -241,6 +241,10 @@ func ensureCreatableFSFieldscoutinglog(m *models.FSFieldscoutinglogSetter) {
val := random_int32(nil)
m.OrganizationID = omit.From(val)
}
if !(m.Globalid.IsValue()) {
val := random_string(nil)
m.Globalid = omit.From(val)
}
if !(m.Objectid.IsValue()) {
val := random_int32(nil)
m.Objectid = omit.From(val)
@ -626,14 +630,14 @@ func (m fsFieldscoutinglogMods) RandomEditorNotNull(f *faker.Faker) FSFieldscout
}
// Set the model columns to this value
func (m fsFieldscoutinglogMods) Globalid(val null.Val[string]) FSFieldscoutinglogMod {
func (m fsFieldscoutinglogMods) Globalid(val string) FSFieldscoutinglogMod {
return FSFieldscoutinglogModFunc(func(_ context.Context, o *FSFieldscoutinglogTemplate) {
o.Globalid = func() null.Val[string] { return val }
o.Globalid = func() string { return val }
})
}
// Set the Column from the function
func (m fsFieldscoutinglogMods) GlobalidFunc(f func() null.Val[string]) FSFieldscoutinglogMod {
func (m fsFieldscoutinglogMods) GlobalidFunc(f func() string) FSFieldscoutinglogMod {
return FSFieldscoutinglogModFunc(func(_ context.Context, o *FSFieldscoutinglogTemplate) {
o.Globalid = f
})
@ -648,32 +652,10 @@ func (m fsFieldscoutinglogMods) UnsetGlobalid() FSFieldscoutinglogMod {
// 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 fsFieldscoutinglogMods) RandomGlobalid(f *faker.Faker) FSFieldscoutinglogMod {
return FSFieldscoutinglogModFunc(func(_ context.Context, o *FSFieldscoutinglogTemplate) {
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 fsFieldscoutinglogMods) RandomGlobalidNotNull(f *faker.Faker) FSFieldscoutinglogMod {
return FSFieldscoutinglogModFunc(func(_ context.Context, o *FSFieldscoutinglogTemplate) {
o.Globalid = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
o.Globalid = func() string {
return random_string(f)
}
})
}

View file

@ -43,7 +43,7 @@ type FSHabitatrelateTemplate struct {
Editdate func() null.Val[int64]
Editor func() null.Val[string]
ForeignID func() null.Val[string]
Globalid func() null.Val[string]
Globalid func() string
Habitattype func() null.Val[string]
Objectid func() int32
CreatedDate func() null.Val[int64]
@ -117,7 +117,7 @@ func (o FSHabitatrelateTemplate) BuildSetter() *models.FSHabitatrelateSetter {
}
if o.Globalid != nil {
val := o.Globalid()
m.Globalid = omitnull.FromNull(val)
m.Globalid = omit.From(val)
}
if o.Habitattype != nil {
val := o.Habitattype()
@ -249,6 +249,10 @@ func ensureCreatableFSHabitatrelate(m *models.FSHabitatrelateSetter) {
val := random_int32(nil)
m.OrganizationID = omit.From(val)
}
if !(m.Globalid.IsValue()) {
val := random_string(nil)
m.Globalid = omit.From(val)
}
if !(m.Objectid.IsValue()) {
val := random_int32(nil)
m.Objectid = omit.From(val)
@ -688,14 +692,14 @@ func (m fsHabitatrelateMods) RandomForeignIDNotNull(f *faker.Faker) FSHabitatrel
}
// Set the model columns to this value
func (m fsHabitatrelateMods) Globalid(val null.Val[string]) FSHabitatrelateMod {
func (m fsHabitatrelateMods) Globalid(val string) FSHabitatrelateMod {
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
o.Globalid = func() null.Val[string] { return val }
o.Globalid = func() string { return val }
})
}
// Set the Column from the function
func (m fsHabitatrelateMods) GlobalidFunc(f func() null.Val[string]) FSHabitatrelateMod {
func (m fsHabitatrelateMods) GlobalidFunc(f func() string) FSHabitatrelateMod {
return FSHabitatrelateModFunc(func(_ context.Context, o *FSHabitatrelateTemplate) {
o.Globalid = f
})
@ -710,32 +714,10 @@ func (m fsHabitatrelateMods) UnsetGlobalid() FSHabitatrelateMod {
// 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)
o.Globalid = func() string {
return random_string(f)
}
})
}

View file

@ -42,7 +42,7 @@ type FSInspectionsampleTemplate struct {
Creator func() null.Val[string]
Editdate func() null.Val[int64]
Editor func() null.Val[string]
Globalid func() null.Val[string]
Globalid func() string
Idbytech func() null.Val[string]
InspID func() null.Val[string]
Objectid func() int32
@ -115,7 +115,7 @@ func (o FSInspectionsampleTemplate) BuildSetter() *models.FSInspectionsampleSett
}
if o.Globalid != nil {
val := o.Globalid()
m.Globalid = omitnull.FromNull(val)
m.Globalid = omit.From(val)
}
if o.Idbytech != nil {
val := o.Idbytech()
@ -265,6 +265,10 @@ func ensureCreatableFSInspectionsample(m *models.FSInspectionsampleSetter) {
val := random_int32(nil)
m.OrganizationID = omit.From(val)
}
if !(m.Globalid.IsValue()) {
val := random_string(nil)
m.Globalid = omit.From(val)
}
if !(m.Objectid.IsValue()) {
val := random_int32(nil)
m.Objectid = omit.From(val)
@ -653,14 +657,14 @@ func (m fsInspectionsampleMods) RandomEditorNotNull(f *faker.Faker) FSInspection
}
// Set the model columns to this value
func (m fsInspectionsampleMods) Globalid(val null.Val[string]) FSInspectionsampleMod {
func (m fsInspectionsampleMods) Globalid(val string) FSInspectionsampleMod {
return FSInspectionsampleModFunc(func(_ context.Context, o *FSInspectionsampleTemplate) {
o.Globalid = func() null.Val[string] { return val }
o.Globalid = func() string { return val }
})
}
// Set the Column from the function
func (m fsInspectionsampleMods) GlobalidFunc(f func() null.Val[string]) FSInspectionsampleMod {
func (m fsInspectionsampleMods) GlobalidFunc(f func() string) FSInspectionsampleMod {
return FSInspectionsampleModFunc(func(_ context.Context, o *FSInspectionsampleTemplate) {
o.Globalid = f
})
@ -675,32 +679,10 @@ func (m fsInspectionsampleMods) UnsetGlobalid() FSInspectionsampleMod {
// 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 fsInspectionsampleMods) RandomGlobalid(f *faker.Faker) FSInspectionsampleMod {
return FSInspectionsampleModFunc(func(_ context.Context, o *FSInspectionsampleTemplate) {
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 fsInspectionsampleMods) RandomGlobalidNotNull(f *faker.Faker) FSInspectionsampleMod {
return FSInspectionsampleModFunc(func(_ context.Context, o *FSInspectionsampleTemplate) {
o.Globalid = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
o.Globalid = func() string {
return random_string(f)
}
})
}

View file

@ -50,7 +50,7 @@ type FSInspectionsampledetailTemplate struct {
Flarvcount func() null.Val[int16]
Flstages func() null.Val[string]
Fpupcount func() null.Val[int16]
Globalid func() null.Val[string]
Globalid func() string
InspsampleID func() null.Val[string]
Labspecies func() null.Val[string]
Ldomstage func() null.Val[string]
@ -158,7 +158,7 @@ func (o FSInspectionsampledetailTemplate) BuildSetter() *models.FSInspectionsamp
}
if o.Globalid != nil {
val := o.Globalid()
m.Globalid = omitnull.FromNull(val)
m.Globalid = omit.From(val)
}
if o.InspsampleID != nil {
val := o.InspsampleID()
@ -353,6 +353,10 @@ func ensureCreatableFSInspectionsampledetail(m *models.FSInspectionsampledetailS
val := random_int32(nil)
m.OrganizationID = omit.From(val)
}
if !(m.Globalid.IsValue()) {
val := random_string(nil)
m.Globalid = omit.From(val)
}
if !(m.Objectid.IsValue()) {
val := random_int32(nil)
m.Objectid = omit.From(val)
@ -1176,14 +1180,14 @@ func (m fsInspectionsampledetailMods) RandomFpupcountNotNull(f *faker.Faker) FSI
}
// Set the model columns to this value
func (m fsInspectionsampledetailMods) Globalid(val null.Val[string]) FSInspectionsampledetailMod {
func (m fsInspectionsampledetailMods) Globalid(val string) FSInspectionsampledetailMod {
return FSInspectionsampledetailModFunc(func(_ context.Context, o *FSInspectionsampledetailTemplate) {
o.Globalid = func() null.Val[string] { return val }
o.Globalid = func() string { return val }
})
}
// Set the Column from the function
func (m fsInspectionsampledetailMods) GlobalidFunc(f func() null.Val[string]) FSInspectionsampledetailMod {
func (m fsInspectionsampledetailMods) GlobalidFunc(f func() string) FSInspectionsampledetailMod {
return FSInspectionsampledetailModFunc(func(_ context.Context, o *FSInspectionsampledetailTemplate) {
o.Globalid = f
})
@ -1198,32 +1202,10 @@ func (m fsInspectionsampledetailMods) UnsetGlobalid() FSInspectionsampledetailMo
// 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 fsInspectionsampledetailMods) RandomGlobalid(f *faker.Faker) FSInspectionsampledetailMod {
return FSInspectionsampledetailModFunc(func(_ context.Context, o *FSInspectionsampledetailTemplate) {
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 fsInspectionsampledetailMods) RandomGlobalidNotNull(f *faker.Faker) FSInspectionsampledetailMod {
return FSInspectionsampledetailModFunc(func(_ context.Context, o *FSInspectionsampledetailTemplate) {
o.Globalid = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
o.Globalid = func() string {
return random_string(f)
}
})
}

View file

@ -48,7 +48,7 @@ type FSLinelocationTemplate struct {
Externalid func() null.Val[string]
Editdate func() null.Val[int64]
Editor func() null.Val[string]
Globalid func() null.Val[string]
Globalid func() string
Habitat func() null.Val[string]
Hectares func() null.Val[float64]
Jurisdiction func() null.Val[string]
@ -173,7 +173,7 @@ func (o FSLinelocationTemplate) BuildSetter() *models.FSLinelocationSetter {
}
if o.Globalid != nil {
val := o.Globalid()
m.Globalid = omitnull.FromNull(val)
m.Globalid = omit.From(val)
}
if o.Habitat != nil {
val := o.Habitat()
@ -537,6 +537,10 @@ func ensureCreatableFSLinelocation(m *models.FSLinelocationSetter) {
val := random_int32(nil)
m.OrganizationID = omit.From(val)
}
if !(m.Globalid.IsValue()) {
val := random_string(nil)
m.Globalid = omit.From(val)
}
if !(m.Objectid.IsValue()) {
val := random_int32(nil)
m.Objectid = omit.From(val)
@ -1277,14 +1281,14 @@ func (m fsLinelocationMods) RandomEditorNotNull(f *faker.Faker) FSLinelocationMo
}
// Set the model columns to this value
func (m fsLinelocationMods) Globalid(val null.Val[string]) FSLinelocationMod {
func (m fsLinelocationMods) Globalid(val string) FSLinelocationMod {
return FSLinelocationModFunc(func(_ context.Context, o *FSLinelocationTemplate) {
o.Globalid = func() null.Val[string] { return val }
o.Globalid = func() string { return val }
})
}
// Set the Column from the function
func (m fsLinelocationMods) GlobalidFunc(f func() null.Val[string]) FSLinelocationMod {
func (m fsLinelocationMods) GlobalidFunc(f func() string) FSLinelocationMod {
return FSLinelocationModFunc(func(_ context.Context, o *FSLinelocationTemplate) {
o.Globalid = f
})
@ -1299,32 +1303,10 @@ func (m fsLinelocationMods) UnsetGlobalid() FSLinelocationMod {
// 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 fsLinelocationMods) RandomGlobalid(f *faker.Faker) FSLinelocationMod {
return FSLinelocationModFunc(func(_ context.Context, o *FSLinelocationTemplate) {
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 fsLinelocationMods) RandomGlobalidNotNull(f *faker.Faker) FSLinelocationMod {
return FSLinelocationModFunc(func(_ context.Context, o *FSLinelocationTemplate) {
o.Globalid = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
o.Globalid = func() string {
return random_string(f)
}
})
}

View file

@ -44,7 +44,7 @@ type FSLocationtrackingTemplate struct {
Editdate func() null.Val[int64]
Editor func() null.Val[string]
Fieldtech func() null.Val[string]
Globalid func() null.Val[string]
Globalid func() string
Objectid func() int32
CreatedDate func() null.Val[int64]
CreatedUser func() null.Val[string]
@ -121,7 +121,7 @@ func (o FSLocationtrackingTemplate) BuildSetter() *models.FSLocationtrackingSett
}
if o.Globalid != nil {
val := o.Globalid()
m.Globalid = omitnull.FromNull(val)
m.Globalid = omit.From(val)
}
if o.Objectid != nil {
val := o.Objectid()
@ -249,6 +249,10 @@ func ensureCreatableFSLocationtracking(m *models.FSLocationtrackingSetter) {
val := random_int32(nil)
m.OrganizationID = omit.From(val)
}
if !(m.Globalid.IsValue()) {
val := random_string(nil)
m.Globalid = omit.From(val)
}
if !(m.Objectid.IsValue()) {
val := random_int32(nil)
m.Objectid = omit.From(val)
@ -741,14 +745,14 @@ func (m fsLocationtrackingMods) RandomFieldtechNotNull(f *faker.Faker) FSLocatio
}
// Set the model columns to this value
func (m fsLocationtrackingMods) Globalid(val null.Val[string]) FSLocationtrackingMod {
func (m fsLocationtrackingMods) Globalid(val string) FSLocationtrackingMod {
return FSLocationtrackingModFunc(func(_ context.Context, o *FSLocationtrackingTemplate) {
o.Globalid = func() null.Val[string] { return val }
o.Globalid = func() string { return val }
})
}
// Set the Column from the function
func (m fsLocationtrackingMods) GlobalidFunc(f func() null.Val[string]) FSLocationtrackingMod {
func (m fsLocationtrackingMods) GlobalidFunc(f func() string) FSLocationtrackingMod {
return FSLocationtrackingModFunc(func(_ context.Context, o *FSLocationtrackingTemplate) {
o.Globalid = f
})
@ -763,32 +767,10 @@ func (m fsLocationtrackingMods) UnsetGlobalid() FSLocationtrackingMod {
// 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 fsLocationtrackingMods) RandomGlobalid(f *faker.Faker) FSLocationtrackingMod {
return FSLocationtrackingModFunc(func(_ context.Context, o *FSLocationtrackingTemplate) {
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 fsLocationtrackingMods) RandomGlobalidNotNull(f *faker.Faker) FSLocationtrackingMod {
return FSLocationtrackingModFunc(func(_ context.Context, o *FSLocationtrackingTemplate) {
o.Globalid = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
o.Globalid = func() string {
return random_string(f)
}
})
}

View file

@ -57,7 +57,7 @@ type FSMosquitoinspectionTemplate struct {
Editor func() null.Val[string]
Fieldspecies func() null.Val[string]
Fieldtech func() null.Val[string]
Globalid func() null.Val[string]
Globalid func() string
Jurisdiction func() null.Val[string]
Larvaepresent func() null.Val[int16]
Linelocid func() null.Val[string]
@ -218,7 +218,7 @@ func (o FSMosquitoinspectionTemplate) BuildSetter() *models.FSMosquitoinspection
}
if o.Globalid != nil {
val := o.Globalid()
m.Globalid = omitnull.FromNull(val)
m.Globalid = omit.From(val)
}
if o.Jurisdiction != nil {
val := o.Jurisdiction()
@ -609,6 +609,10 @@ func ensureCreatableFSMosquitoinspection(m *models.FSMosquitoinspectionSetter) {
val := random_int32(nil)
m.OrganizationID = omit.From(val)
}
if !(m.Globalid.IsValue()) {
val := random_string(nil)
m.Globalid = omit.From(val)
}
if !(m.Objectid.IsValue()) {
val := random_int32(nil)
m.Objectid = omit.From(val)
@ -1835,14 +1839,14 @@ func (m fsMosquitoinspectionMods) RandomFieldtechNotNull(f *faker.Faker) FSMosqu
}
// Set the model columns to this value
func (m fsMosquitoinspectionMods) Globalid(val null.Val[string]) FSMosquitoinspectionMod {
func (m fsMosquitoinspectionMods) Globalid(val string) FSMosquitoinspectionMod {
return FSMosquitoinspectionModFunc(func(_ context.Context, o *FSMosquitoinspectionTemplate) {
o.Globalid = func() null.Val[string] { return val }
o.Globalid = func() string { return val }
})
}
// Set the Column from the function
func (m fsMosquitoinspectionMods) GlobalidFunc(f func() null.Val[string]) FSMosquitoinspectionMod {
func (m fsMosquitoinspectionMods) GlobalidFunc(f func() string) FSMosquitoinspectionMod {
return FSMosquitoinspectionModFunc(func(_ context.Context, o *FSMosquitoinspectionTemplate) {
o.Globalid = f
})
@ -1857,32 +1861,10 @@ func (m fsMosquitoinspectionMods) UnsetGlobalid() FSMosquitoinspectionMod {
// 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 fsMosquitoinspectionMods) RandomGlobalid(f *faker.Faker) FSMosquitoinspectionMod {
return FSMosquitoinspectionModFunc(func(_ context.Context, o *FSMosquitoinspectionTemplate) {
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 fsMosquitoinspectionMods) RandomGlobalidNotNull(f *faker.Faker) FSMosquitoinspectionMod {
return FSMosquitoinspectionModFunc(func(_ context.Context, o *FSMosquitoinspectionTemplate) {
o.Globalid = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
o.Globalid = func() string {
return random_string(f)
}
})
}

View file

@ -47,7 +47,7 @@ type FSPointlocationTemplate struct {
Externalid func() null.Val[string]
Editdate func() null.Val[int64]
Editor func() null.Val[string]
Globalid func() null.Val[string]
Globalid func() string
Habitat func() null.Val[string]
Jurisdiction func() null.Val[string]
Larvinspectinterval func() null.Val[int16]
@ -78,8 +78,8 @@ type FSPointlocationTemplate struct {
Y func() null.Val[float64]
Zone func() null.Val[string]
Zone2 func() null.Val[string]
GeometryX func() null.Val[float64]
GeometryY func() null.Val[float64]
GeometryX func() float64
GeometryY func() float64
Assignedtech func() null.Val[string]
DeactivateReason func() null.Val[string]
Scalarpriority func() null.Val[int64]
@ -165,7 +165,7 @@ func (o FSPointlocationTemplate) BuildSetter() *models.FSPointlocationSetter {
}
if o.Globalid != nil {
val := o.Globalid()
m.Globalid = omitnull.FromNull(val)
m.Globalid = omit.From(val)
}
if o.Habitat != nil {
val := o.Habitat()
@ -289,11 +289,11 @@ func (o FSPointlocationTemplate) BuildSetter() *models.FSPointlocationSetter {
}
if o.GeometryX != nil {
val := o.GeometryX()
m.GeometryX = omitnull.FromNull(val)
m.GeometryX = omit.From(val)
}
if o.GeometryY != nil {
val := o.GeometryY()
m.GeometryY = omitnull.FromNull(val)
m.GeometryY = omit.From(val)
}
if o.Assignedtech != nil {
val := o.Assignedtech()
@ -505,10 +505,22 @@ func ensureCreatableFSPointlocation(m *models.FSPointlocationSetter) {
val := random_int32(nil)
m.OrganizationID = omit.From(val)
}
if !(m.Globalid.IsValue()) {
val := random_string(nil)
m.Globalid = omit.From(val)
}
if !(m.Objectid.IsValue()) {
val := random_int32(nil)
m.Objectid = omit.From(val)
}
if !(m.GeometryX.IsValue()) {
val := random_float64(nil)
m.GeometryX = omit.From(val)
}
if !(m.GeometryY.IsValue()) {
val := random_float64(nil)
m.GeometryY = omit.From(val)
}
}
// insertOptRels creates and inserts any optional the relationships on *models.FSPointlocation
@ -1188,14 +1200,14 @@ func (m fsPointlocationMods) RandomEditorNotNull(f *faker.Faker) FSPointlocation
}
// Set the model columns to this value
func (m fsPointlocationMods) Globalid(val null.Val[string]) FSPointlocationMod {
func (m fsPointlocationMods) Globalid(val string) FSPointlocationMod {
return FSPointlocationModFunc(func(_ context.Context, o *FSPointlocationTemplate) {
o.Globalid = func() null.Val[string] { return val }
o.Globalid = func() string { return val }
})
}
// Set the Column from the function
func (m fsPointlocationMods) GlobalidFunc(f func() null.Val[string]) FSPointlocationMod {
func (m fsPointlocationMods) GlobalidFunc(f func() string) FSPointlocationMod {
return FSPointlocationModFunc(func(_ context.Context, o *FSPointlocationTemplate) {
o.Globalid = f
})
@ -1210,32 +1222,10 @@ func (m fsPointlocationMods) UnsetGlobalid() FSPointlocationMod {
// 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 fsPointlocationMods) RandomGlobalid(f *faker.Faker) FSPointlocationMod {
return FSPointlocationModFunc(func(_ context.Context, o *FSPointlocationTemplate) {
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 fsPointlocationMods) RandomGlobalidNotNull(f *faker.Faker) FSPointlocationMod {
return FSPointlocationModFunc(func(_ context.Context, o *FSPointlocationTemplate) {
o.Globalid = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
o.Globalid = func() string {
return random_string(f)
}
})
}
@ -2809,14 +2799,14 @@ func (m fsPointlocationMods) RandomZone2NotNull(f *faker.Faker) FSPointlocationM
}
// Set the model columns to this value
func (m fsPointlocationMods) GeometryX(val null.Val[float64]) FSPointlocationMod {
func (m fsPointlocationMods) GeometryX(val float64) FSPointlocationMod {
return FSPointlocationModFunc(func(_ context.Context, o *FSPointlocationTemplate) {
o.GeometryX = func() null.Val[float64] { return val }
o.GeometryX = func() float64 { return val }
})
}
// Set the Column from the function
func (m fsPointlocationMods) GeometryXFunc(f func() null.Val[float64]) FSPointlocationMod {
func (m fsPointlocationMods) GeometryXFunc(f func() float64) FSPointlocationMod {
return FSPointlocationModFunc(func(_ context.Context, o *FSPointlocationTemplate) {
o.GeometryX = f
})
@ -2831,45 +2821,23 @@ func (m fsPointlocationMods) UnsetGeometryX() FSPointlocationMod {
// 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 fsPointlocationMods) RandomGeometryX(f *faker.Faker) FSPointlocationMod {
return FSPointlocationModFunc(func(_ context.Context, o *FSPointlocationTemplate) {
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 fsPointlocationMods) RandomGeometryXNotNull(f *faker.Faker) FSPointlocationMod {
return FSPointlocationModFunc(func(_ context.Context, o *FSPointlocationTemplate) {
o.GeometryX = func() null.Val[float64] {
if f == nil {
f = &defaultFaker
}
val := random_float64(f)
return null.From(val)
o.GeometryX = func() float64 {
return random_float64(f)
}
})
}
// Set the model columns to this value
func (m fsPointlocationMods) GeometryY(val null.Val[float64]) FSPointlocationMod {
func (m fsPointlocationMods) GeometryY(val float64) FSPointlocationMod {
return FSPointlocationModFunc(func(_ context.Context, o *FSPointlocationTemplate) {
o.GeometryY = func() null.Val[float64] { return val }
o.GeometryY = func() float64 { return val }
})
}
// Set the Column from the function
func (m fsPointlocationMods) GeometryYFunc(f func() null.Val[float64]) FSPointlocationMod {
func (m fsPointlocationMods) GeometryYFunc(f func() float64) FSPointlocationMod {
return FSPointlocationModFunc(func(_ context.Context, o *FSPointlocationTemplate) {
o.GeometryY = f
})
@ -2884,32 +2852,10 @@ func (m fsPointlocationMods) UnsetGeometryY() FSPointlocationMod {
// 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 fsPointlocationMods) RandomGeometryY(f *faker.Faker) FSPointlocationMod {
return FSPointlocationModFunc(func(_ context.Context, o *FSPointlocationTemplate) {
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 fsPointlocationMods) RandomGeometryYNotNull(f *faker.Faker) FSPointlocationMod {
return FSPointlocationModFunc(func(_ context.Context, o *FSPointlocationTemplate) {
o.GeometryY = func() null.Val[float64] {
if f == nil {
f = &defaultFaker
}
val := random_float64(f)
return null.From(val)
o.GeometryY = func() float64 {
return random_float64(f)
}
})
}

View file

@ -49,7 +49,7 @@ type FSPolygonlocationTemplate struct {
Editdate func() null.Val[int64]
Editor func() null.Val[string]
Filter func() null.Val[string]
Globalid func() null.Val[string]
Globalid func() string
Habitat func() null.Val[string]
Hectares func() null.Val[float64]
Jurisdiction func() null.Val[string]
@ -171,7 +171,7 @@ func (o FSPolygonlocationTemplate) BuildSetter() *models.FSPolygonlocationSetter
}
if o.Globalid != nil {
val := o.Globalid()
m.Globalid = omitnull.FromNull(val)
m.Globalid = omit.From(val)
}
if o.Habitat != nil {
val := o.Habitat()
@ -489,6 +489,10 @@ func ensureCreatableFSPolygonlocation(m *models.FSPolygonlocationSetter) {
val := random_int32(nil)
m.OrganizationID = omit.From(val)
}
if !(m.Globalid.IsValue()) {
val := random_string(nil)
m.Globalid = omit.From(val)
}
if !(m.Objectid.IsValue()) {
val := random_int32(nil)
m.Objectid = omit.From(val)
@ -1276,14 +1280,14 @@ func (m fsPolygonlocationMods) RandomFilterNotNull(f *faker.Faker) FSPolygonloca
}
// Set the model columns to this value
func (m fsPolygonlocationMods) Globalid(val null.Val[string]) FSPolygonlocationMod {
func (m fsPolygonlocationMods) Globalid(val string) FSPolygonlocationMod {
return FSPolygonlocationModFunc(func(_ context.Context, o *FSPolygonlocationTemplate) {
o.Globalid = func() null.Val[string] { return val }
o.Globalid = func() string { return val }
})
}
// Set the Column from the function
func (m fsPolygonlocationMods) GlobalidFunc(f func() null.Val[string]) FSPolygonlocationMod {
func (m fsPolygonlocationMods) GlobalidFunc(f func() string) FSPolygonlocationMod {
return FSPolygonlocationModFunc(func(_ context.Context, o *FSPolygonlocationTemplate) {
o.Globalid = f
})
@ -1298,32 +1302,10 @@ func (m fsPolygonlocationMods) UnsetGlobalid() FSPolygonlocationMod {
// 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 fsPolygonlocationMods) RandomGlobalid(f *faker.Faker) FSPolygonlocationMod {
return FSPolygonlocationModFunc(func(_ context.Context, o *FSPolygonlocationTemplate) {
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 fsPolygonlocationMods) RandomGlobalidNotNull(f *faker.Faker) FSPolygonlocationMod {
return FSPolygonlocationModFunc(func(_ context.Context, o *FSPolygonlocationTemplate) {
o.Globalid = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
o.Globalid = func() string {
return random_string(f)
}
})
}

View file

@ -48,7 +48,7 @@ type FSPoolTemplate struct {
Editdate func() null.Val[int64]
Editor func() null.Val[string]
Gatewaysync func() null.Val[int16]
Globalid func() null.Val[string]
Globalid func() string
Lab func() null.Val[string]
LabID func() null.Val[string]
Objectid func() int32
@ -153,7 +153,7 @@ func (o FSPoolTemplate) BuildSetter() *models.FSPoolSetter {
}
if o.Globalid != nil {
val := o.Globalid()
m.Globalid = omitnull.FromNull(val)
m.Globalid = omit.From(val)
}
if o.Lab != nil {
val := o.Lab()
@ -377,6 +377,10 @@ func ensureCreatableFSPool(m *models.FSPoolSetter) {
val := random_int32(nil)
m.OrganizationID = omit.From(val)
}
if !(m.Globalid.IsValue()) {
val := random_string(nil)
m.Globalid = omit.From(val)
}
if !(m.Objectid.IsValue()) {
val := random_int32(nil)
m.Objectid = omit.From(val)
@ -1097,14 +1101,14 @@ func (m fsPoolMods) RandomGatewaysyncNotNull(f *faker.Faker) FSPoolMod {
}
// Set the model columns to this value
func (m fsPoolMods) Globalid(val null.Val[string]) FSPoolMod {
func (m fsPoolMods) Globalid(val string) FSPoolMod {
return FSPoolModFunc(func(_ context.Context, o *FSPoolTemplate) {
o.Globalid = func() null.Val[string] { return val }
o.Globalid = func() string { return val }
})
}
// Set the Column from the function
func (m fsPoolMods) GlobalidFunc(f func() null.Val[string]) FSPoolMod {
func (m fsPoolMods) GlobalidFunc(f func() string) FSPoolMod {
return FSPoolModFunc(func(_ context.Context, o *FSPoolTemplate) {
o.Globalid = f
})
@ -1119,32 +1123,10 @@ func (m fsPoolMods) UnsetGlobalid() FSPoolMod {
// 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 fsPoolMods) RandomGlobalid(f *faker.Faker) FSPoolMod {
return FSPoolModFunc(func(_ context.Context, o *FSPoolTemplate) {
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 fsPoolMods) RandomGlobalidNotNull(f *faker.Faker) FSPoolMod {
return FSPoolModFunc(func(_ context.Context, o *FSPoolTemplate) {
o.Globalid = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
o.Globalid = func() string {
return random_string(f)
}
})
}

View file

@ -43,7 +43,7 @@ type FSPooldetailTemplate struct {
Editdate func() null.Val[int64]
Editor func() null.Val[string]
Females func() null.Val[int16]
Globalid func() null.Val[string]
Globalid func() string
Objectid func() int32
PoolID func() null.Val[string]
Species func() null.Val[string]
@ -119,7 +119,7 @@ func (o FSPooldetailTemplate) BuildSetter() *models.FSPooldetailSetter {
}
if o.Globalid != nil {
val := o.Globalid()
m.Globalid = omitnull.FromNull(val)
m.Globalid = omit.From(val)
}
if o.Objectid != nil {
val := o.Objectid()
@ -265,6 +265,10 @@ func ensureCreatableFSPooldetail(m *models.FSPooldetailSetter) {
val := random_int32(nil)
m.OrganizationID = omit.From(val)
}
if !(m.Globalid.IsValue()) {
val := random_string(nil)
m.Globalid = omit.From(val)
}
if !(m.Objectid.IsValue()) {
val := random_int32(nil)
m.Objectid = omit.From(val)
@ -706,14 +710,14 @@ func (m fsPooldetailMods) RandomFemalesNotNull(f *faker.Faker) FSPooldetailMod {
}
// Set the model columns to this value
func (m fsPooldetailMods) Globalid(val null.Val[string]) FSPooldetailMod {
func (m fsPooldetailMods) Globalid(val string) FSPooldetailMod {
return FSPooldetailModFunc(func(_ context.Context, o *FSPooldetailTemplate) {
o.Globalid = func() null.Val[string] { return val }
o.Globalid = func() string { return val }
})
}
// Set the Column from the function
func (m fsPooldetailMods) GlobalidFunc(f func() null.Val[string]) FSPooldetailMod {
func (m fsPooldetailMods) GlobalidFunc(f func() string) FSPooldetailMod {
return FSPooldetailModFunc(func(_ context.Context, o *FSPooldetailTemplate) {
o.Globalid = f
})
@ -728,32 +732,10 @@ func (m fsPooldetailMods) UnsetGlobalid() FSPooldetailMod {
// 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 fsPooldetailMods) RandomGlobalid(f *faker.Faker) FSPooldetailMod {
return FSPooldetailModFunc(func(_ context.Context, o *FSPooldetailTemplate) {
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 fsPooldetailMods) RandomGlobalidNotNull(f *faker.Faker) FSPooldetailMod {
return FSPooldetailModFunc(func(_ context.Context, o *FSPooldetailTemplate) {
o.Globalid = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
o.Globalid = func() string {
return random_string(f)
}
})
}

View file

@ -49,7 +49,7 @@ type FSProposedtreatmentareaTemplate struct {
Exported func() null.Val[int16]
Editdate func() null.Val[int64]
Editor func() null.Val[string]
Globalid func() null.Val[string]
Globalid func() string
Hectares func() null.Val[float64]
Issprayroute func() null.Val[int16]
Lasttreatactivity func() null.Val[string]
@ -162,7 +162,7 @@ func (o FSProposedtreatmentareaTemplate) BuildSetter() *models.FSProposedtreatme
}
if o.Globalid != nil {
val := o.Globalid()
m.Globalid = omitnull.FromNull(val)
m.Globalid = omit.From(val)
}
if o.Hectares != nil {
val := o.Hectares()
@ -417,6 +417,10 @@ func ensureCreatableFSProposedtreatmentarea(m *models.FSProposedtreatmentareaSet
val := random_int32(nil)
m.OrganizationID = omit.From(val)
}
if !(m.Globalid.IsValue()) {
val := random_string(nil)
m.Globalid = omit.From(val)
}
if !(m.Objectid.IsValue()) {
val := random_int32(nil)
m.Objectid = omit.From(val)
@ -1195,14 +1199,14 @@ func (m fsProposedtreatmentareaMods) RandomEditorNotNull(f *faker.Faker) FSPropo
}
// Set the model columns to this value
func (m fsProposedtreatmentareaMods) Globalid(val null.Val[string]) FSProposedtreatmentareaMod {
func (m fsProposedtreatmentareaMods) Globalid(val string) FSProposedtreatmentareaMod {
return FSProposedtreatmentareaModFunc(func(_ context.Context, o *FSProposedtreatmentareaTemplate) {
o.Globalid = func() null.Val[string] { return val }
o.Globalid = func() string { return val }
})
}
// Set the Column from the function
func (m fsProposedtreatmentareaMods) GlobalidFunc(f func() null.Val[string]) FSProposedtreatmentareaMod {
func (m fsProposedtreatmentareaMods) GlobalidFunc(f func() string) FSProposedtreatmentareaMod {
return FSProposedtreatmentareaModFunc(func(_ context.Context, o *FSProposedtreatmentareaTemplate) {
o.Globalid = f
})
@ -1217,32 +1221,10 @@ func (m fsProposedtreatmentareaMods) UnsetGlobalid() FSProposedtreatmentareaMod
// 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 fsProposedtreatmentareaMods) RandomGlobalid(f *faker.Faker) FSProposedtreatmentareaMod {
return FSProposedtreatmentareaModFunc(func(_ context.Context, o *FSProposedtreatmentareaTemplate) {
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 fsProposedtreatmentareaMods) RandomGlobalidNotNull(f *faker.Faker) FSProposedtreatmentareaMod {
return FSProposedtreatmentareaModFunc(func(_ context.Context, o *FSProposedtreatmentareaTemplate) {
o.Globalid = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
o.Globalid = func() string {
return random_string(f)
}
})
}

View file

@ -52,7 +52,7 @@ type FSQamosquitoinspectionTemplate struct {
Editor func() null.Val[string]
Fieldtech func() null.Val[string]
Fish func() null.Val[int16]
Globalid func() null.Val[string]
Globalid func() string
Habvalue1 func() null.Val[int16]
Habvalue1percent func() null.Val[int16]
Habvalue2 func() null.Val[int16]
@ -203,7 +203,7 @@ func (o FSQamosquitoinspectionTemplate) BuildSetter() *models.FSQamosquitoinspec
}
if o.Globalid != nil {
val := o.Globalid()
m.Globalid = omitnull.FromNull(val)
m.Globalid = omit.From(val)
}
if o.Habvalue1 != nil {
val := o.Habvalue1()
@ -649,6 +649,10 @@ func ensureCreatableFSQamosquitoinspection(m *models.FSQamosquitoinspectionSette
val := random_int32(nil)
m.OrganizationID = omit.From(val)
}
if !(m.Globalid.IsValue()) {
val := random_string(nil)
m.Globalid = omit.From(val)
}
if !(m.Objectid.IsValue()) {
val := random_int32(nil)
m.Objectid = omit.From(val)
@ -1615,14 +1619,14 @@ func (m fsQamosquitoinspectionMods) RandomFishNotNull(f *faker.Faker) FSQamosqui
}
// Set the model columns to this value
func (m fsQamosquitoinspectionMods) Globalid(val null.Val[string]) FSQamosquitoinspectionMod {
func (m fsQamosquitoinspectionMods) Globalid(val string) FSQamosquitoinspectionMod {
return FSQamosquitoinspectionModFunc(func(_ context.Context, o *FSQamosquitoinspectionTemplate) {
o.Globalid = func() null.Val[string] { return val }
o.Globalid = func() string { return val }
})
}
// Set the Column from the function
func (m fsQamosquitoinspectionMods) GlobalidFunc(f func() null.Val[string]) FSQamosquitoinspectionMod {
func (m fsQamosquitoinspectionMods) GlobalidFunc(f func() string) FSQamosquitoinspectionMod {
return FSQamosquitoinspectionModFunc(func(_ context.Context, o *FSQamosquitoinspectionTemplate) {
o.Globalid = f
})
@ -1637,32 +1641,10 @@ func (m fsQamosquitoinspectionMods) UnsetGlobalid() FSQamosquitoinspectionMod {
// 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 fsQamosquitoinspectionMods) RandomGlobalid(f *faker.Faker) FSQamosquitoinspectionMod {
return FSQamosquitoinspectionModFunc(func(_ context.Context, o *FSQamosquitoinspectionTemplate) {
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 fsQamosquitoinspectionMods) RandomGlobalidNotNull(f *faker.Faker) FSQamosquitoinspectionMod {
return FSQamosquitoinspectionModFunc(func(_ context.Context, o *FSQamosquitoinspectionTemplate) {
o.Globalid = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
o.Globalid = func() string {
return random_string(f)
}
})
}

View file

@ -47,7 +47,7 @@ type FSRodentlocationTemplate struct {
Externalid func() null.Val[string]
Editdate func() null.Val[int64]
Editor func() null.Val[string]
Globalid func() null.Val[string]
Globalid func() string
Habitat func() null.Val[string]
Lastinspectaction func() null.Val[string]
Lastinspectconditions func() null.Val[string]
@ -151,7 +151,7 @@ func (o FSRodentlocationTemplate) BuildSetter() *models.FSRodentlocationSetter {
}
if o.Globalid != nil {
val := o.Globalid()
m.Globalid = omitnull.FromNull(val)
m.Globalid = omit.From(val)
}
if o.Habitat != nil {
val := o.Habitat()
@ -393,6 +393,10 @@ func ensureCreatableFSRodentlocation(m *models.FSRodentlocationSetter) {
val := random_int32(nil)
m.OrganizationID = omit.From(val)
}
if !(m.Globalid.IsValue()) {
val := random_string(nil)
m.Globalid = omit.From(val)
}
if !(m.Objectid.IsValue()) {
val := random_int32(nil)
m.Objectid = omit.From(val)
@ -1062,14 +1066,14 @@ func (m fsRodentlocationMods) RandomEditorNotNull(f *faker.Faker) FSRodentlocati
}
// Set the model columns to this value
func (m fsRodentlocationMods) Globalid(val null.Val[string]) FSRodentlocationMod {
func (m fsRodentlocationMods) Globalid(val string) FSRodentlocationMod {
return FSRodentlocationModFunc(func(_ context.Context, o *FSRodentlocationTemplate) {
o.Globalid = func() null.Val[string] { return val }
o.Globalid = func() string { return val }
})
}
// Set the Column from the function
func (m fsRodentlocationMods) GlobalidFunc(f func() null.Val[string]) FSRodentlocationMod {
func (m fsRodentlocationMods) GlobalidFunc(f func() string) FSRodentlocationMod {
return FSRodentlocationModFunc(func(_ context.Context, o *FSRodentlocationTemplate) {
o.Globalid = f
})
@ -1084,32 +1088,10 @@ func (m fsRodentlocationMods) UnsetGlobalid() FSRodentlocationMod {
// 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 fsRodentlocationMods) RandomGlobalid(f *faker.Faker) FSRodentlocationMod {
return FSRodentlocationModFunc(func(_ context.Context, o *FSRodentlocationTemplate) {
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 fsRodentlocationMods) RandomGlobalidNotNull(f *faker.Faker) FSRodentlocationMod {
return FSRodentlocationModFunc(func(_ context.Context, o *FSRodentlocationTemplate) {
o.Globalid = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
o.Globalid = func() string {
return random_string(f)
}
})
}

View file

@ -54,7 +54,7 @@ type FSSamplecollectionTemplate struct {
Fieldtech func() null.Val[string]
Flockid func() null.Val[string]
Gatewaysync func() null.Val[int16]
Globalid func() null.Val[string]
Globalid func() string
Lab func() null.Val[string]
Locationname func() null.Val[string]
LocID func() null.Val[string]
@ -195,7 +195,7 @@ func (o FSSamplecollectionTemplate) BuildSetter() *models.FSSamplecollectionSett
}
if o.Globalid != nil {
val := o.Globalid()
m.Globalid = omitnull.FromNull(val)
m.Globalid = omit.From(val)
}
if o.Lab != nil {
val := o.Lab()
@ -521,6 +521,10 @@ func ensureCreatableFSSamplecollection(m *models.FSSamplecollectionSetter) {
val := random_int32(nil)
m.OrganizationID = omit.From(val)
}
if !(m.Globalid.IsValue()) {
val := random_string(nil)
m.Globalid = omit.From(val)
}
if !(m.Objectid.IsValue()) {
val := random_int32(nil)
m.Objectid = omit.From(val)
@ -1577,14 +1581,14 @@ func (m fsSamplecollectionMods) RandomGatewaysyncNotNull(f *faker.Faker) FSSampl
}
// Set the model columns to this value
func (m fsSamplecollectionMods) Globalid(val null.Val[string]) FSSamplecollectionMod {
func (m fsSamplecollectionMods) Globalid(val string) FSSamplecollectionMod {
return FSSamplecollectionModFunc(func(_ context.Context, o *FSSamplecollectionTemplate) {
o.Globalid = func() null.Val[string] { return val }
o.Globalid = func() string { return val }
})
}
// Set the Column from the function
func (m fsSamplecollectionMods) GlobalidFunc(f func() null.Val[string]) FSSamplecollectionMod {
func (m fsSamplecollectionMods) GlobalidFunc(f func() string) FSSamplecollectionMod {
return FSSamplecollectionModFunc(func(_ context.Context, o *FSSamplecollectionTemplate) {
o.Globalid = f
})
@ -1599,32 +1603,10 @@ func (m fsSamplecollectionMods) UnsetGlobalid() FSSamplecollectionMod {
// 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 fsSamplecollectionMods) RandomGlobalid(f *faker.Faker) FSSamplecollectionMod {
return FSSamplecollectionModFunc(func(_ context.Context, o *FSSamplecollectionTemplate) {
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 fsSamplecollectionMods) RandomGlobalidNotNull(f *faker.Faker) FSSamplecollectionMod {
return FSSamplecollectionModFunc(func(_ context.Context, o *FSSamplecollectionTemplate) {
o.Globalid = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
o.Globalid = func() string {
return random_string(f)
}
})
}

View file

@ -48,7 +48,7 @@ type FSSamplelocationTemplate struct {
Editdate func() null.Val[int64]
Editor func() null.Val[string]
Gatewaysync func() null.Val[int16]
Globalid func() null.Val[string]
Globalid func() string
Habitat func() null.Val[string]
Locationnumber func() null.Val[int64]
Name func() null.Val[string]
@ -149,7 +149,7 @@ func (o FSSamplelocationTemplate) BuildSetter() *models.FSSamplelocationSetter {
}
if o.Globalid != nil {
val := o.Globalid()
m.Globalid = omitnull.FromNull(val)
m.Globalid = omit.From(val)
}
if o.Habitat != nil {
val := o.Habitat()
@ -345,6 +345,10 @@ func ensureCreatableFSSamplelocation(m *models.FSSamplelocationSetter) {
val := random_int32(nil)
m.OrganizationID = omit.From(val)
}
if !(m.Globalid.IsValue()) {
val := random_string(nil)
m.Globalid = omit.From(val)
}
if !(m.Objectid.IsValue()) {
val := random_int32(nil)
m.Objectid = omit.From(val)
@ -1061,14 +1065,14 @@ func (m fsSamplelocationMods) RandomGatewaysyncNotNull(f *faker.Faker) FSSamplel
}
// Set the model columns to this value
func (m fsSamplelocationMods) Globalid(val null.Val[string]) FSSamplelocationMod {
func (m fsSamplelocationMods) Globalid(val string) FSSamplelocationMod {
return FSSamplelocationModFunc(func(_ context.Context, o *FSSamplelocationTemplate) {
o.Globalid = func() null.Val[string] { return val }
o.Globalid = func() string { return val }
})
}
// Set the Column from the function
func (m fsSamplelocationMods) GlobalidFunc(f func() null.Val[string]) FSSamplelocationMod {
func (m fsSamplelocationMods) GlobalidFunc(f func() string) FSSamplelocationMod {
return FSSamplelocationModFunc(func(_ context.Context, o *FSSamplelocationTemplate) {
o.Globalid = f
})
@ -1083,32 +1087,10 @@ func (m fsSamplelocationMods) UnsetGlobalid() FSSamplelocationMod {
// 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 fsSamplelocationMods) RandomGlobalid(f *faker.Faker) FSSamplelocationMod {
return FSSamplelocationModFunc(func(_ context.Context, o *FSSamplelocationTemplate) {
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 fsSamplelocationMods) RandomGlobalidNotNull(f *faker.Faker) FSSamplelocationMod {
return FSSamplelocationModFunc(func(_ context.Context, o *FSSamplelocationTemplate) {
o.Globalid = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
o.Globalid = func() string {
return random_string(f)
}
})
}

View file

@ -68,7 +68,7 @@ type FSServicerequestTemplate struct {
Editdate func() null.Val[int64]
Editor func() null.Val[string]
Firstresponsedate func() null.Val[int64]
Globalid func() null.Val[string]
Globalid func() string
Issuesreported func() null.Val[string]
Jurisdiction func() null.Val[string]
Nextaction func() null.Val[string]
@ -118,8 +118,8 @@ type FSServicerequestTemplate struct {
Zone2 func() null.Val[string]
CreatedDate func() null.Val[int64]
CreatedUser func() null.Val[string]
GeometryX func() null.Val[float64]
GeometryY func() null.Val[float64]
GeometryX func() float64
GeometryY func() float64
LastEditedDate func() null.Val[int64]
LastEditedUser func() null.Val[string]
Dog func() null.Val[int64]
@ -291,7 +291,7 @@ func (o FSServicerequestTemplate) BuildSetter() *models.FSServicerequestSetter {
}
if o.Globalid != nil {
val := o.Globalid()
m.Globalid = omitnull.FromNull(val)
m.Globalid = omit.From(val)
}
if o.Issuesreported != nil {
val := o.Issuesreported()
@ -491,11 +491,11 @@ func (o FSServicerequestTemplate) BuildSetter() *models.FSServicerequestSetter {
}
if o.GeometryX != nil {
val := o.GeometryX()
m.GeometryX = omitnull.FromNull(val)
m.GeometryX = omit.From(val)
}
if o.GeometryY != nil {
val := o.GeometryY()
m.GeometryY = omitnull.FromNull(val)
m.GeometryY = omit.From(val)
}
if o.LastEditedDate != nil {
val := o.LastEditedDate()
@ -841,10 +841,22 @@ func ensureCreatableFSServicerequest(m *models.FSServicerequestSetter) {
val := random_int32(nil)
m.OrganizationID = omit.From(val)
}
if !(m.Globalid.IsValue()) {
val := random_string(nil)
m.Globalid = omit.From(val)
}
if !(m.Objectid.IsValue()) {
val := random_int32(nil)
m.Objectid = omit.From(val)
}
if !(m.GeometryX.IsValue()) {
val := random_float64(nil)
m.GeometryX = omit.From(val)
}
if !(m.GeometryY.IsValue()) {
val := random_float64(nil)
m.GeometryY = omit.From(val)
}
}
// insertOptRels creates and inserts any optional the relationships on *models.FSServicerequest
@ -2679,14 +2691,14 @@ func (m fsServicerequestMods) RandomFirstresponsedateNotNull(f *faker.Faker) FSS
}
// Set the model columns to this value
func (m fsServicerequestMods) Globalid(val null.Val[string]) FSServicerequestMod {
func (m fsServicerequestMods) Globalid(val string) FSServicerequestMod {
return FSServicerequestModFunc(func(_ context.Context, o *FSServicerequestTemplate) {
o.Globalid = func() null.Val[string] { return val }
o.Globalid = func() string { return val }
})
}
// Set the Column from the function
func (m fsServicerequestMods) GlobalidFunc(f func() null.Val[string]) FSServicerequestMod {
func (m fsServicerequestMods) GlobalidFunc(f func() string) FSServicerequestMod {
return FSServicerequestModFunc(func(_ context.Context, o *FSServicerequestTemplate) {
o.Globalid = f
})
@ -2701,32 +2713,10 @@ func (m fsServicerequestMods) UnsetGlobalid() FSServicerequestMod {
// 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 fsServicerequestMods) RandomGlobalid(f *faker.Faker) FSServicerequestMod {
return FSServicerequestModFunc(func(_ context.Context, o *FSServicerequestTemplate) {
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 fsServicerequestMods) RandomGlobalidNotNull(f *faker.Faker) FSServicerequestMod {
return FSServicerequestModFunc(func(_ context.Context, o *FSServicerequestTemplate) {
o.Globalid = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
o.Globalid = func() string {
return random_string(f)
}
})
}
@ -5307,14 +5297,14 @@ func (m fsServicerequestMods) RandomCreatedUserNotNull(f *faker.Faker) FSService
}
// Set the model columns to this value
func (m fsServicerequestMods) GeometryX(val null.Val[float64]) FSServicerequestMod {
func (m fsServicerequestMods) GeometryX(val float64) FSServicerequestMod {
return FSServicerequestModFunc(func(_ context.Context, o *FSServicerequestTemplate) {
o.GeometryX = func() null.Val[float64] { return val }
o.GeometryX = func() float64 { return val }
})
}
// Set the Column from the function
func (m fsServicerequestMods) GeometryXFunc(f func() null.Val[float64]) FSServicerequestMod {
func (m fsServicerequestMods) GeometryXFunc(f func() float64) FSServicerequestMod {
return FSServicerequestModFunc(func(_ context.Context, o *FSServicerequestTemplate) {
o.GeometryX = f
})
@ -5329,45 +5319,23 @@ func (m fsServicerequestMods) UnsetGeometryX() FSServicerequestMod {
// 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 fsServicerequestMods) RandomGeometryX(f *faker.Faker) FSServicerequestMod {
return FSServicerequestModFunc(func(_ context.Context, o *FSServicerequestTemplate) {
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 fsServicerequestMods) RandomGeometryXNotNull(f *faker.Faker) FSServicerequestMod {
return FSServicerequestModFunc(func(_ context.Context, o *FSServicerequestTemplate) {
o.GeometryX = func() null.Val[float64] {
if f == nil {
f = &defaultFaker
}
val := random_float64(f)
return null.From(val)
o.GeometryX = func() float64 {
return random_float64(f)
}
})
}
// Set the model columns to this value
func (m fsServicerequestMods) GeometryY(val null.Val[float64]) FSServicerequestMod {
func (m fsServicerequestMods) GeometryY(val float64) FSServicerequestMod {
return FSServicerequestModFunc(func(_ context.Context, o *FSServicerequestTemplate) {
o.GeometryY = func() null.Val[float64] { return val }
o.GeometryY = func() float64 { return val }
})
}
// Set the Column from the function
func (m fsServicerequestMods) GeometryYFunc(f func() null.Val[float64]) FSServicerequestMod {
func (m fsServicerequestMods) GeometryYFunc(f func() float64) FSServicerequestMod {
return FSServicerequestModFunc(func(_ context.Context, o *FSServicerequestTemplate) {
o.GeometryY = f
})
@ -5382,32 +5350,10 @@ func (m fsServicerequestMods) UnsetGeometryY() FSServicerequestMod {
// 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 fsServicerequestMods) RandomGeometryY(f *faker.Faker) FSServicerequestMod {
return FSServicerequestModFunc(func(_ context.Context, o *FSServicerequestTemplate) {
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 fsServicerequestMods) RandomGeometryYNotNull(f *faker.Faker) FSServicerequestMod {
return FSServicerequestModFunc(func(_ context.Context, o *FSServicerequestTemplate) {
o.GeometryY = func() null.Val[float64] {
if f == nil {
f = &defaultFaker
}
val := random_float64(f)
return null.From(val)
o.GeometryY = func() float64 {
return random_float64(f)
}
})
}

View file

@ -46,7 +46,7 @@ type FSSpeciesabundanceTemplate struct {
Editor func() null.Val[string]
Females func() null.Val[int64]
Gravidfem func() null.Val[int16]
Globalid func() null.Val[string]
Globalid func() string
Larvae func() null.Val[int16]
Males func() null.Val[int16]
Objectid func() int32
@ -146,7 +146,7 @@ func (o FSSpeciesabundanceTemplate) BuildSetter() *models.FSSpeciesabundanceSett
}
if o.Globalid != nil {
val := o.Globalid()
m.Globalid = omitnull.FromNull(val)
m.Globalid = omit.From(val)
}
if o.Larvae != nil {
val := o.Larvae()
@ -385,6 +385,10 @@ func ensureCreatableFSSpeciesabundance(m *models.FSSpeciesabundanceSetter) {
val := random_int32(nil)
m.OrganizationID = omit.From(val)
}
if !(m.Globalid.IsValue()) {
val := random_string(nil)
m.Globalid = omit.From(val)
}
if !(m.Objectid.IsValue()) {
val := random_int32(nil)
m.Objectid = omit.From(val)
@ -1000,14 +1004,14 @@ func (m fsSpeciesabundanceMods) RandomGravidfemNotNull(f *faker.Faker) FSSpecies
}
// Set the model columns to this value
func (m fsSpeciesabundanceMods) Globalid(val null.Val[string]) FSSpeciesabundanceMod {
func (m fsSpeciesabundanceMods) Globalid(val string) FSSpeciesabundanceMod {
return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) {
o.Globalid = func() null.Val[string] { return val }
o.Globalid = func() string { return val }
})
}
// Set the Column from the function
func (m fsSpeciesabundanceMods) GlobalidFunc(f func() null.Val[string]) FSSpeciesabundanceMod {
func (m fsSpeciesabundanceMods) GlobalidFunc(f func() string) FSSpeciesabundanceMod {
return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) {
o.Globalid = f
})
@ -1022,32 +1026,10 @@ func (m fsSpeciesabundanceMods) UnsetGlobalid() FSSpeciesabundanceMod {
// 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 fsSpeciesabundanceMods) RandomGlobalid(f *faker.Faker) FSSpeciesabundanceMod {
return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) {
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 fsSpeciesabundanceMods) RandomGlobalidNotNull(f *faker.Faker) FSSpeciesabundanceMod {
return FSSpeciesabundanceModFunc(func(_ context.Context, o *FSSpeciesabundanceTemplate) {
o.Globalid = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
o.Globalid = func() string {
return random_string(f)
}
})
}

View file

@ -42,7 +42,7 @@ type FSStormdrainTemplate struct {
Creator func() null.Val[string]
Editdate func() null.Val[int64]
Editor func() null.Val[string]
Globalid func() null.Val[string]
Globalid func() string
Jurisdiction func() null.Val[string]
Lastaction func() null.Val[string]
Laststatus func() null.Val[string]
@ -120,7 +120,7 @@ func (o FSStormdrainTemplate) BuildSetter() *models.FSStormdrainSetter {
}
if o.Globalid != nil {
val := o.Globalid()
m.Globalid = omitnull.FromNull(val)
m.Globalid = omit.From(val)
}
if o.Jurisdiction != nil {
val := o.Jurisdiction()
@ -305,6 +305,10 @@ func ensureCreatableFSStormdrain(m *models.FSStormdrainSetter) {
val := random_int32(nil)
m.OrganizationID = omit.From(val)
}
if !(m.Globalid.IsValue()) {
val := random_string(nil)
m.Globalid = omit.From(val)
}
if !(m.Objectid.IsValue()) {
val := random_int32(nil)
m.Objectid = omit.From(val)
@ -698,14 +702,14 @@ func (m fsStormdrainMods) RandomEditorNotNull(f *faker.Faker) FSStormdrainMod {
}
// Set the model columns to this value
func (m fsStormdrainMods) Globalid(val null.Val[string]) FSStormdrainMod {
func (m fsStormdrainMods) Globalid(val string) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Globalid = func() null.Val[string] { return val }
o.Globalid = func() string { return val }
})
}
// Set the Column from the function
func (m fsStormdrainMods) GlobalidFunc(f func() null.Val[string]) FSStormdrainMod {
func (m fsStormdrainMods) GlobalidFunc(f func() string) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Globalid = f
})
@ -720,32 +724,10 @@ func (m fsStormdrainMods) UnsetGlobalid() FSStormdrainMod {
// 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 fsStormdrainMods) RandomGlobalid(f *faker.Faker) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
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 fsStormdrainMods) RandomGlobalidNotNull(f *faker.Faker) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Globalid = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
o.Globalid = func() string {
return random_string(f)
}
})
}

View file

@ -48,7 +48,7 @@ type FSTimecardTemplate struct {
Editdate func() null.Val[int64]
Editor func() null.Val[string]
Fieldtech func() null.Val[string]
Globalid func() null.Val[string]
Globalid func() string
Lclocid func() null.Val[string]
Linelocid func() null.Val[string]
Locationname func() null.Val[string]
@ -153,7 +153,7 @@ func (o FSTimecardTemplate) BuildSetter() *models.FSTimecardSetter {
}
if o.Globalid != nil {
val := o.Globalid()
m.Globalid = omitnull.FromNull(val)
m.Globalid = omit.From(val)
}
if o.Lclocid != nil {
val := o.Lclocid()
@ -377,6 +377,10 @@ func ensureCreatableFSTimecard(m *models.FSTimecardSetter) {
val := random_int32(nil)
m.OrganizationID = omit.From(val)
}
if !(m.Globalid.IsValue()) {
val := random_string(nil)
m.Globalid = omit.From(val)
}
if !(m.Objectid.IsValue()) {
val := random_int32(nil)
m.Objectid = omit.From(val)
@ -1097,14 +1101,14 @@ func (m fsTimecardMods) RandomFieldtechNotNull(f *faker.Faker) FSTimecardMod {
}
// Set the model columns to this value
func (m fsTimecardMods) Globalid(val null.Val[string]) FSTimecardMod {
func (m fsTimecardMods) Globalid(val string) FSTimecardMod {
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
o.Globalid = func() null.Val[string] { return val }
o.Globalid = func() string { return val }
})
}
// Set the Column from the function
func (m fsTimecardMods) GlobalidFunc(f func() null.Val[string]) FSTimecardMod {
func (m fsTimecardMods) GlobalidFunc(f func() string) FSTimecardMod {
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
o.Globalid = f
})
@ -1119,32 +1123,10 @@ func (m fsTimecardMods) UnsetGlobalid() FSTimecardMod {
// 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 fsTimecardMods) RandomGlobalid(f *faker.Faker) FSTimecardMod {
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
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 fsTimecardMods) RandomGlobalidNotNull(f *faker.Faker) FSTimecardMod {
return FSTimecardModFunc(func(_ context.Context, o *FSTimecardTemplate) {
o.Globalid = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
o.Globalid = func() string {
return random_string(f)
}
})
}

View file

@ -48,7 +48,7 @@ type FSTrapdatumTemplate struct {
Fieldtech func() null.Val[string]
Field func() null.Val[int64]
Gatewaysync func() null.Val[int16]
Globalid func() null.Val[string]
Globalid func() string
Idbytech func() null.Val[string]
Locationname func() null.Val[string]
LocID func() null.Val[string]
@ -167,7 +167,7 @@ func (o FSTrapdatumTemplate) BuildSetter() *models.FSTrapdatumSetter {
}
if o.Globalid != nil {
val := o.Globalid()
m.Globalid = omitnull.FromNull(val)
m.Globalid = omit.From(val)
}
if o.Idbytech != nil {
val := o.Idbytech()
@ -489,6 +489,10 @@ func ensureCreatableFSTrapdatum(m *models.FSTrapdatumSetter) {
val := random_int32(nil)
m.OrganizationID = omit.From(val)
}
if !(m.Globalid.IsValue()) {
val := random_string(nil)
m.Globalid = omit.From(val)
}
if !(m.Objectid.IsValue()) {
val := random_int32(nil)
m.Objectid = omit.From(val)
@ -1223,14 +1227,14 @@ func (m fsTrapdatumMods) RandomGatewaysyncNotNull(f *faker.Faker) FSTrapdatumMod
}
// Set the model columns to this value
func (m fsTrapdatumMods) Globalid(val null.Val[string]) FSTrapdatumMod {
func (m fsTrapdatumMods) Globalid(val string) FSTrapdatumMod {
return FSTrapdatumModFunc(func(_ context.Context, o *FSTrapdatumTemplate) {
o.Globalid = func() null.Val[string] { return val }
o.Globalid = func() string { return val }
})
}
// Set the Column from the function
func (m fsTrapdatumMods) GlobalidFunc(f func() null.Val[string]) FSTrapdatumMod {
func (m fsTrapdatumMods) GlobalidFunc(f func() string) FSTrapdatumMod {
return FSTrapdatumModFunc(func(_ context.Context, o *FSTrapdatumTemplate) {
o.Globalid = f
})
@ -1245,32 +1249,10 @@ func (m fsTrapdatumMods) UnsetGlobalid() FSTrapdatumMod {
// 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 fsTrapdatumMods) RandomGlobalid(f *faker.Faker) FSTrapdatumMod {
return FSTrapdatumModFunc(func(_ context.Context, o *FSTrapdatumTemplate) {
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 fsTrapdatumMods) RandomGlobalidNotNull(f *faker.Faker) FSTrapdatumMod {
return FSTrapdatumModFunc(func(_ context.Context, o *FSTrapdatumTemplate) {
o.Globalid = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
o.Globalid = func() string {
return random_string(f)
}
})
}

View file

@ -48,7 +48,7 @@ type FSTraplocationTemplate struct {
Editdate func() null.Val[int64]
Editor func() null.Val[string]
Gatewaysync func() null.Val[int16]
Globalid func() null.Val[string]
Globalid func() string
Habitat func() null.Val[string]
Locationnumber func() null.Val[int64]
Name func() null.Val[string]
@ -155,7 +155,7 @@ func (o FSTraplocationTemplate) BuildSetter() *models.FSTraplocationSetter {
}
if o.Globalid != nil {
val := o.Globalid()
m.Globalid = omitnull.FromNull(val)
m.Globalid = omit.From(val)
}
if o.Habitat != nil {
val := o.Habitat()
@ -393,6 +393,10 @@ func ensureCreatableFSTraplocation(m *models.FSTraplocationSetter) {
val := random_int32(nil)
m.OrganizationID = omit.From(val)
}
if !(m.Globalid.IsValue()) {
val := random_string(nil)
m.Globalid = omit.From(val)
}
if !(m.Objectid.IsValue()) {
val := random_int32(nil)
m.Objectid = omit.From(val)
@ -1115,14 +1119,14 @@ func (m fsTraplocationMods) RandomGatewaysyncNotNull(f *faker.Faker) FSTraplocat
}
// Set the model columns to this value
func (m fsTraplocationMods) Globalid(val null.Val[string]) FSTraplocationMod {
func (m fsTraplocationMods) Globalid(val string) FSTraplocationMod {
return FSTraplocationModFunc(func(_ context.Context, o *FSTraplocationTemplate) {
o.Globalid = func() null.Val[string] { return val }
o.Globalid = func() string { return val }
})
}
// Set the Column from the function
func (m fsTraplocationMods) GlobalidFunc(f func() null.Val[string]) FSTraplocationMod {
func (m fsTraplocationMods) GlobalidFunc(f func() string) FSTraplocationMod {
return FSTraplocationModFunc(func(_ context.Context, o *FSTraplocationTemplate) {
o.Globalid = f
})
@ -1137,32 +1141,10 @@ func (m fsTraplocationMods) UnsetGlobalid() FSTraplocationMod {
// 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 fsTraplocationMods) RandomGlobalid(f *faker.Faker) FSTraplocationMod {
return FSTraplocationModFunc(func(_ context.Context, o *FSTraplocationTemplate) {
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 fsTraplocationMods) RandomGlobalidNotNull(f *faker.Faker) FSTraplocationMod {
return FSTraplocationModFunc(func(_ context.Context, o *FSTraplocationTemplate) {
o.Globalid = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
o.Globalid = func() string {
return random_string(f)
}
})
}

View file

@ -53,7 +53,7 @@ type FSTreatmentTemplate struct {
Editor func() null.Val[string]
Fieldtech func() null.Val[string]
Flowrate func() null.Val[float64]
Globalid func() null.Val[string]
Globalid func() string
Habitat func() null.Val[string]
InspID func() null.Val[string]
Invloc func() null.Val[string]
@ -199,7 +199,7 @@ func (o FSTreatmentTemplate) BuildSetter() *models.FSTreatmentSetter {
}
if o.Globalid != nil {
val := o.Globalid()
m.Globalid = omitnull.FromNull(val)
m.Globalid = omit.From(val)
}
if o.Habitat != nil {
val := o.Habitat()
@ -585,6 +585,10 @@ func ensureCreatableFSTreatment(m *models.FSTreatmentSetter) {
val := random_int32(nil)
m.OrganizationID = omit.From(val)
}
if !(m.Globalid.IsValue()) {
val := random_string(nil)
m.Globalid = omit.From(val)
}
if !(m.Objectid.IsValue()) {
val := random_int32(nil)
m.Objectid = omit.From(val)
@ -1596,14 +1600,14 @@ func (m fsTreatmentMods) RandomFlowrateNotNull(f *faker.Faker) FSTreatmentMod {
}
// Set the model columns to this value
func (m fsTreatmentMods) Globalid(val null.Val[string]) FSTreatmentMod {
func (m fsTreatmentMods) Globalid(val string) FSTreatmentMod {
return FSTreatmentModFunc(func(_ context.Context, o *FSTreatmentTemplate) {
o.Globalid = func() null.Val[string] { return val }
o.Globalid = func() string { return val }
})
}
// Set the Column from the function
func (m fsTreatmentMods) GlobalidFunc(f func() null.Val[string]) FSTreatmentMod {
func (m fsTreatmentMods) GlobalidFunc(f func() string) FSTreatmentMod {
return FSTreatmentModFunc(func(_ context.Context, o *FSTreatmentTemplate) {
o.Globalid = f
})
@ -1618,32 +1622,10 @@ func (m fsTreatmentMods) UnsetGlobalid() FSTreatmentMod {
// 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 fsTreatmentMods) RandomGlobalid(f *faker.Faker) FSTreatmentMod {
return FSTreatmentModFunc(func(_ context.Context, o *FSTreatmentTemplate) {
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 fsTreatmentMods) RandomGlobalidNotNull(f *faker.Faker) FSTreatmentMod {
return FSTreatmentModFunc(func(_ context.Context, o *FSTreatmentTemplate) {
o.Globalid = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
o.Globalid = func() string {
return random_string(f)
}
})
}

View file

@ -43,7 +43,7 @@ type FSTreatmentareaTemplate struct {
Creator func() null.Val[string]
Editdate func() null.Val[int64]
Editor func() null.Val[string]
Globalid func() null.Val[string]
Globalid func() string
Notified func() null.Val[int16]
Objectid func() int32
SessionID func() null.Val[string]
@ -123,7 +123,7 @@ func (o FSTreatmentareaTemplate) BuildSetter() *models.FSTreatmentareaSetter {
}
if o.Globalid != nil {
val := o.Globalid()
m.Globalid = omitnull.FromNull(val)
m.Globalid = omit.From(val)
}
if o.Notified != nil {
val := o.Notified()
@ -297,6 +297,10 @@ func ensureCreatableFSTreatmentarea(m *models.FSTreatmentareaSetter) {
val := random_int32(nil)
m.OrganizationID = omit.From(val)
}
if !(m.Globalid.IsValue()) {
val := random_string(nil)
m.Globalid = omit.From(val)
}
if !(m.Objectid.IsValue()) {
val := random_int32(nil)
m.Objectid = omit.From(val)
@ -742,14 +746,14 @@ func (m fsTreatmentareaMods) RandomEditorNotNull(f *faker.Faker) FSTreatmentarea
}
// Set the model columns to this value
func (m fsTreatmentareaMods) Globalid(val null.Val[string]) FSTreatmentareaMod {
func (m fsTreatmentareaMods) Globalid(val string) FSTreatmentareaMod {
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
o.Globalid = func() null.Val[string] { return val }
o.Globalid = func() string { return val }
})
}
// Set the Column from the function
func (m fsTreatmentareaMods) GlobalidFunc(f func() null.Val[string]) FSTreatmentareaMod {
func (m fsTreatmentareaMods) GlobalidFunc(f func() string) FSTreatmentareaMod {
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
o.Globalid = f
})
@ -764,32 +768,10 @@ func (m fsTreatmentareaMods) UnsetGlobalid() FSTreatmentareaMod {
// 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 fsTreatmentareaMods) RandomGlobalid(f *faker.Faker) FSTreatmentareaMod {
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
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 fsTreatmentareaMods) RandomGlobalidNotNull(f *faker.Faker) FSTreatmentareaMod {
return FSTreatmentareaModFunc(func(_ context.Context, o *FSTreatmentareaTemplate) {
o.Globalid = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
o.Globalid = func() string {
return random_string(f)
}
})
}

View file

@ -43,7 +43,7 @@ type FSZoneTemplate struct {
Creator func() null.Val[string]
Editdate func() null.Val[int64]
Editor func() null.Val[string]
Globalid func() null.Val[string]
Globalid func() string
Name func() null.Val[string]
Objectid func() int32
ShapeArea func() null.Val[float64]
@ -119,7 +119,7 @@ func (o FSZoneTemplate) BuildSetter() *models.FSZoneSetter {
}
if o.Globalid != nil {
val := o.Globalid()
m.Globalid = omitnull.FromNull(val)
m.Globalid = omit.From(val)
}
if o.Name != nil {
val := o.Name()
@ -265,6 +265,10 @@ func ensureCreatableFSZone(m *models.FSZoneSetter) {
val := random_int32(nil)
m.OrganizationID = omit.From(val)
}
if !(m.Globalid.IsValue()) {
val := random_string(nil)
m.Globalid = omit.From(val)
}
if !(m.Objectid.IsValue()) {
val := random_int32(nil)
m.Objectid = omit.From(val)
@ -706,14 +710,14 @@ func (m fsZoneMods) RandomEditorNotNull(f *faker.Faker) FSZoneMod {
}
// Set the model columns to this value
func (m fsZoneMods) Globalid(val null.Val[string]) FSZoneMod {
func (m fsZoneMods) Globalid(val string) FSZoneMod {
return FSZoneModFunc(func(_ context.Context, o *FSZoneTemplate) {
o.Globalid = func() null.Val[string] { return val }
o.Globalid = func() string { return val }
})
}
// Set the Column from the function
func (m fsZoneMods) GlobalidFunc(f func() null.Val[string]) FSZoneMod {
func (m fsZoneMods) GlobalidFunc(f func() string) FSZoneMod {
return FSZoneModFunc(func(_ context.Context, o *FSZoneTemplate) {
o.Globalid = f
})
@ -728,32 +732,10 @@ func (m fsZoneMods) UnsetGlobalid() FSZoneMod {
// 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 fsZoneMods) RandomGlobalid(f *faker.Faker) FSZoneMod {
return FSZoneModFunc(func(_ context.Context, o *FSZoneTemplate) {
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 fsZoneMods) RandomGlobalidNotNull(f *faker.Faker) FSZoneMod {
return FSZoneModFunc(func(_ context.Context, o *FSZoneTemplate) {
o.Globalid = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
o.Globalid = func() string {
return random_string(f)
}
})
}

View file

@ -42,7 +42,7 @@ type FSZones2Template struct {
Creator func() null.Val[string]
Editdate func() null.Val[int64]
Editor func() null.Val[string]
Globalid func() null.Val[string]
Globalid func() string
Name func() null.Val[string]
Objectid func() int32
ShapeArea func() null.Val[float64]
@ -114,7 +114,7 @@ func (o FSZones2Template) BuildSetter() *models.FSZones2Setter {
}
if o.Globalid != nil {
val := o.Globalid()
m.Globalid = omitnull.FromNull(val)
m.Globalid = omit.From(val)
}
if o.Name != nil {
val := o.Name()
@ -257,6 +257,10 @@ func ensureCreatableFSZones2(m *models.FSZones2Setter) {
val := random_int32(nil)
m.OrganizationID = omit.From(val)
}
if !(m.Globalid.IsValue()) {
val := random_string(nil)
m.Globalid = omit.From(val)
}
if !(m.Objectid.IsValue()) {
val := random_int32(nil)
m.Objectid = omit.From(val)
@ -644,14 +648,14 @@ func (m fsZones2Mods) RandomEditorNotNull(f *faker.Faker) FSZones2Mod {
}
// Set the model columns to this value
func (m fsZones2Mods) Globalid(val null.Val[string]) FSZones2Mod {
func (m fsZones2Mods) Globalid(val string) FSZones2Mod {
return FSZones2ModFunc(func(_ context.Context, o *FSZones2Template) {
o.Globalid = func() null.Val[string] { return val }
o.Globalid = func() string { return val }
})
}
// Set the Column from the function
func (m fsZones2Mods) GlobalidFunc(f func() null.Val[string]) FSZones2Mod {
func (m fsZones2Mods) GlobalidFunc(f func() string) FSZones2Mod {
return FSZones2ModFunc(func(_ context.Context, o *FSZones2Template) {
o.Globalid = f
})
@ -666,32 +670,10 @@ func (m fsZones2Mods) UnsetGlobalid() FSZones2Mod {
// 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 fsZones2Mods) RandomGlobalid(f *faker.Faker) FSZones2Mod {
return FSZones2ModFunc(func(_ context.Context, o *FSZones2Template) {
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 fsZones2Mods) RandomGlobalidNotNull(f *faker.Faker) FSZones2Mod {
return FSZones2ModFunc(func(_ context.Context, o *FSZones2Template) {
o.Globalid = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
o.Globalid = func() string {
return random_string(f)
}
})
}

View file

@ -0,0 +1,500 @@
// 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"
models "github.com/Gleipnir-Technology/nidus-sync/models"
"github.com/aarondl/opt/null"
"github.com/jaswdr/faker/v2"
)
type GeographyColumnMod interface {
Apply(context.Context, *GeographyColumnTemplate)
}
type GeographyColumnModFunc func(context.Context, *GeographyColumnTemplate)
func (f GeographyColumnModFunc) Apply(ctx context.Context, n *GeographyColumnTemplate) {
f(ctx, n)
}
type GeographyColumnModSlice []GeographyColumnMod
func (mods GeographyColumnModSlice) Apply(ctx context.Context, n *GeographyColumnTemplate) {
for _, f := range mods {
f.Apply(ctx, n)
}
}
// GeographyColumnTemplate is an object representing the database table.
// all columns are optional and should be set by mods
type GeographyColumnTemplate struct {
FTableCatalog func() null.Val[string]
FTableSchema func() null.Val[string]
FTableName func() null.Val[string]
FGeographyColumn func() null.Val[string]
CoordDimension func() null.Val[int32]
Srid func() null.Val[int32]
Type func() null.Val[string]
f *Factory
alreadyPersisted bool
}
// Apply mods to the GeographyColumnTemplate
func (o *GeographyColumnTemplate) Apply(ctx context.Context, mods ...GeographyColumnMod) {
for _, mod := range mods {
mod.Apply(ctx, o)
}
}
// setModelRels creates and sets the relationships on *models.GeographyColumn
// according to the relationships in the template. Nothing is inserted into the db
func (t GeographyColumnTemplate) setModelRels(o *models.GeographyColumn) {}
// Build returns an *models.GeographyColumn
// Related objects are also created and placed in the .R field
// NOTE: Objects are not inserted into the database. Use GeographyColumnTemplate.Create
func (o GeographyColumnTemplate) Build() *models.GeographyColumn {
m := &models.GeographyColumn{}
if o.FTableCatalog != nil {
m.FTableCatalog = o.FTableCatalog()
}
if o.FTableSchema != nil {
m.FTableSchema = o.FTableSchema()
}
if o.FTableName != nil {
m.FTableName = o.FTableName()
}
if o.FGeographyColumn != nil {
m.FGeographyColumn = o.FGeographyColumn()
}
if o.CoordDimension != nil {
m.CoordDimension = o.CoordDimension()
}
if o.Srid != nil {
m.Srid = o.Srid()
}
if o.Type != nil {
m.Type = o.Type()
}
o.setModelRels(m)
return m
}
// BuildMany returns an models.GeographyColumnSlice
// Related objects are also created and placed in the .R field
// NOTE: Objects are not inserted into the database. Use GeographyColumnTemplate.CreateMany
func (o GeographyColumnTemplate) BuildMany(number int) models.GeographyColumnSlice {
m := make(models.GeographyColumnSlice, number)
for i := range m {
m[i] = o.Build()
}
return m
}
// GeographyColumn has methods that act as mods for the GeographyColumnTemplate
var GeographyColumnMods geographyColumnMods
type geographyColumnMods struct{}
func (m geographyColumnMods) RandomizeAllColumns(f *faker.Faker) GeographyColumnMod {
return GeographyColumnModSlice{
GeographyColumnMods.RandomFTableCatalog(f),
GeographyColumnMods.RandomFTableSchema(f),
GeographyColumnMods.RandomFTableName(f),
GeographyColumnMods.RandomFGeographyColumn(f),
GeographyColumnMods.RandomCoordDimension(f),
GeographyColumnMods.RandomSrid(f),
GeographyColumnMods.RandomType(f),
}
}
// Set the model columns to this value
func (m geographyColumnMods) FTableCatalog(val null.Val[string]) GeographyColumnMod {
return GeographyColumnModFunc(func(_ context.Context, o *GeographyColumnTemplate) {
o.FTableCatalog = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m geographyColumnMods) FTableCatalogFunc(f func() null.Val[string]) GeographyColumnMod {
return GeographyColumnModFunc(func(_ context.Context, o *GeographyColumnTemplate) {
o.FTableCatalog = f
})
}
// Clear any values for the column
func (m geographyColumnMods) UnsetFTableCatalog() GeographyColumnMod {
return GeographyColumnModFunc(func(_ context.Context, o *GeographyColumnTemplate) {
o.FTableCatalog = 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 geographyColumnMods) RandomFTableCatalog(f *faker.Faker) GeographyColumnMod {
return GeographyColumnModFunc(func(_ context.Context, o *GeographyColumnTemplate) {
o.FTableCatalog = 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 geographyColumnMods) RandomFTableCatalogNotNull(f *faker.Faker) GeographyColumnMod {
return GeographyColumnModFunc(func(_ context.Context, o *GeographyColumnTemplate) {
o.FTableCatalog = 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 geographyColumnMods) FTableSchema(val null.Val[string]) GeographyColumnMod {
return GeographyColumnModFunc(func(_ context.Context, o *GeographyColumnTemplate) {
o.FTableSchema = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m geographyColumnMods) FTableSchemaFunc(f func() null.Val[string]) GeographyColumnMod {
return GeographyColumnModFunc(func(_ context.Context, o *GeographyColumnTemplate) {
o.FTableSchema = f
})
}
// Clear any values for the column
func (m geographyColumnMods) UnsetFTableSchema() GeographyColumnMod {
return GeographyColumnModFunc(func(_ context.Context, o *GeographyColumnTemplate) {
o.FTableSchema = 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 geographyColumnMods) RandomFTableSchema(f *faker.Faker) GeographyColumnMod {
return GeographyColumnModFunc(func(_ context.Context, o *GeographyColumnTemplate) {
o.FTableSchema = 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 geographyColumnMods) RandomFTableSchemaNotNull(f *faker.Faker) GeographyColumnMod {
return GeographyColumnModFunc(func(_ context.Context, o *GeographyColumnTemplate) {
o.FTableSchema = 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 geographyColumnMods) FTableName(val null.Val[string]) GeographyColumnMod {
return GeographyColumnModFunc(func(_ context.Context, o *GeographyColumnTemplate) {
o.FTableName = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m geographyColumnMods) FTableNameFunc(f func() null.Val[string]) GeographyColumnMod {
return GeographyColumnModFunc(func(_ context.Context, o *GeographyColumnTemplate) {
o.FTableName = f
})
}
// Clear any values for the column
func (m geographyColumnMods) UnsetFTableName() GeographyColumnMod {
return GeographyColumnModFunc(func(_ context.Context, o *GeographyColumnTemplate) {
o.FTableName = 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 geographyColumnMods) RandomFTableName(f *faker.Faker) GeographyColumnMod {
return GeographyColumnModFunc(func(_ context.Context, o *GeographyColumnTemplate) {
o.FTableName = 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 geographyColumnMods) RandomFTableNameNotNull(f *faker.Faker) GeographyColumnMod {
return GeographyColumnModFunc(func(_ context.Context, o *GeographyColumnTemplate) {
o.FTableName = 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 geographyColumnMods) FGeographyColumn(val null.Val[string]) GeographyColumnMod {
return GeographyColumnModFunc(func(_ context.Context, o *GeographyColumnTemplate) {
o.FGeographyColumn = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m geographyColumnMods) FGeographyColumnFunc(f func() null.Val[string]) GeographyColumnMod {
return GeographyColumnModFunc(func(_ context.Context, o *GeographyColumnTemplate) {
o.FGeographyColumn = f
})
}
// Clear any values for the column
func (m geographyColumnMods) UnsetFGeographyColumn() GeographyColumnMod {
return GeographyColumnModFunc(func(_ context.Context, o *GeographyColumnTemplate) {
o.FGeographyColumn = 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 geographyColumnMods) RandomFGeographyColumn(f *faker.Faker) GeographyColumnMod {
return GeographyColumnModFunc(func(_ context.Context, o *GeographyColumnTemplate) {
o.FGeographyColumn = 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 geographyColumnMods) RandomFGeographyColumnNotNull(f *faker.Faker) GeographyColumnMod {
return GeographyColumnModFunc(func(_ context.Context, o *GeographyColumnTemplate) {
o.FGeographyColumn = 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 geographyColumnMods) CoordDimension(val null.Val[int32]) GeographyColumnMod {
return GeographyColumnModFunc(func(_ context.Context, o *GeographyColumnTemplate) {
o.CoordDimension = func() null.Val[int32] { return val }
})
}
// Set the Column from the function
func (m geographyColumnMods) CoordDimensionFunc(f func() null.Val[int32]) GeographyColumnMod {
return GeographyColumnModFunc(func(_ context.Context, o *GeographyColumnTemplate) {
o.CoordDimension = f
})
}
// Clear any values for the column
func (m geographyColumnMods) UnsetCoordDimension() GeographyColumnMod {
return GeographyColumnModFunc(func(_ context.Context, o *GeographyColumnTemplate) {
o.CoordDimension = 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 geographyColumnMods) RandomCoordDimension(f *faker.Faker) GeographyColumnMod {
return GeographyColumnModFunc(func(_ context.Context, o *GeographyColumnTemplate) {
o.CoordDimension = 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 geographyColumnMods) RandomCoordDimensionNotNull(f *faker.Faker) GeographyColumnMod {
return GeographyColumnModFunc(func(_ context.Context, o *GeographyColumnTemplate) {
o.CoordDimension = 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 geographyColumnMods) Srid(val null.Val[int32]) GeographyColumnMod {
return GeographyColumnModFunc(func(_ context.Context, o *GeographyColumnTemplate) {
o.Srid = func() null.Val[int32] { return val }
})
}
// Set the Column from the function
func (m geographyColumnMods) SridFunc(f func() null.Val[int32]) GeographyColumnMod {
return GeographyColumnModFunc(func(_ context.Context, o *GeographyColumnTemplate) {
o.Srid = f
})
}
// Clear any values for the column
func (m geographyColumnMods) UnsetSrid() GeographyColumnMod {
return GeographyColumnModFunc(func(_ context.Context, o *GeographyColumnTemplate) {
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 geographyColumnMods) RandomSrid(f *faker.Faker) GeographyColumnMod {
return GeographyColumnModFunc(func(_ context.Context, o *GeographyColumnTemplate) {
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 geographyColumnMods) RandomSridNotNull(f *faker.Faker) GeographyColumnMod {
return GeographyColumnModFunc(func(_ context.Context, o *GeographyColumnTemplate) {
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 geographyColumnMods) Type(val null.Val[string]) GeographyColumnMod {
return GeographyColumnModFunc(func(_ context.Context, o *GeographyColumnTemplate) {
o.Type = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m geographyColumnMods) TypeFunc(f func() null.Val[string]) GeographyColumnMod {
return GeographyColumnModFunc(func(_ context.Context, o *GeographyColumnTemplate) {
o.Type = f
})
}
// Clear any values for the column
func (m geographyColumnMods) UnsetType() GeographyColumnMod {
return GeographyColumnModFunc(func(_ context.Context, o *GeographyColumnTemplate) {
o.Type = 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 geographyColumnMods) RandomType(f *faker.Faker) GeographyColumnMod {
return GeographyColumnModFunc(func(_ context.Context, o *GeographyColumnTemplate) {
o.Type = 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 geographyColumnMods) RandomTypeNotNull(f *faker.Faker) GeographyColumnMod {
return GeographyColumnModFunc(func(_ context.Context, o *GeographyColumnTemplate) {
o.Type = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f)
return null.From(val)
}
})
}
func (m geographyColumnMods) WithParentsCascading() GeographyColumnMod {
return GeographyColumnModFunc(func(ctx context.Context, o *GeographyColumnTemplate) {
if isDone, _ := geographyColumnWithParentsCascadingCtx.Value(ctx); isDone {
return
}
ctx = geographyColumnWithParentsCascadingCtx.WithValue(ctx, true)
})
}

View file

@ -0,0 +1,500 @@
// 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"
models "github.com/Gleipnir-Technology/nidus-sync/models"
"github.com/aarondl/opt/null"
"github.com/jaswdr/faker/v2"
)
type GeometryColumnMod interface {
Apply(context.Context, *GeometryColumnTemplate)
}
type GeometryColumnModFunc func(context.Context, *GeometryColumnTemplate)
func (f GeometryColumnModFunc) Apply(ctx context.Context, n *GeometryColumnTemplate) {
f(ctx, n)
}
type GeometryColumnModSlice []GeometryColumnMod
func (mods GeometryColumnModSlice) Apply(ctx context.Context, n *GeometryColumnTemplate) {
for _, f := range mods {
f.Apply(ctx, n)
}
}
// GeometryColumnTemplate is an object representing the database table.
// all columns are optional and should be set by mods
type GeometryColumnTemplate struct {
FTableCatalog func() null.Val[string]
FTableSchema func() null.Val[string]
FTableName func() null.Val[string]
FGeometryColumn func() null.Val[string]
CoordDimension func() null.Val[int32]
Srid func() null.Val[int32]
Type func() null.Val[string]
f *Factory
alreadyPersisted bool
}
// Apply mods to the GeometryColumnTemplate
func (o *GeometryColumnTemplate) Apply(ctx context.Context, mods ...GeometryColumnMod) {
for _, mod := range mods {
mod.Apply(ctx, o)
}
}
// setModelRels creates and sets the relationships on *models.GeometryColumn
// according to the relationships in the template. Nothing is inserted into the db
func (t GeometryColumnTemplate) setModelRels(o *models.GeometryColumn) {}
// Build returns an *models.GeometryColumn
// Related objects are also created and placed in the .R field
// NOTE: Objects are not inserted into the database. Use GeometryColumnTemplate.Create
func (o GeometryColumnTemplate) Build() *models.GeometryColumn {
m := &models.GeometryColumn{}
if o.FTableCatalog != nil {
m.FTableCatalog = o.FTableCatalog()
}
if o.FTableSchema != nil {
m.FTableSchema = o.FTableSchema()
}
if o.FTableName != nil {
m.FTableName = o.FTableName()
}
if o.FGeometryColumn != nil {
m.FGeometryColumn = o.FGeometryColumn()
}
if o.CoordDimension != nil {
m.CoordDimension = o.CoordDimension()
}
if o.Srid != nil {
m.Srid = o.Srid()
}
if o.Type != nil {
m.Type = o.Type()
}
o.setModelRels(m)
return m
}
// BuildMany returns an models.GeometryColumnSlice
// Related objects are also created and placed in the .R field
// NOTE: Objects are not inserted into the database. Use GeometryColumnTemplate.CreateMany
func (o GeometryColumnTemplate) BuildMany(number int) models.GeometryColumnSlice {
m := make(models.GeometryColumnSlice, number)
for i := range m {
m[i] = o.Build()
}
return m
}
// GeometryColumn has methods that act as mods for the GeometryColumnTemplate
var GeometryColumnMods geometryColumnMods
type geometryColumnMods struct{}
func (m geometryColumnMods) RandomizeAllColumns(f *faker.Faker) GeometryColumnMod {
return GeometryColumnModSlice{
GeometryColumnMods.RandomFTableCatalog(f),
GeometryColumnMods.RandomFTableSchema(f),
GeometryColumnMods.RandomFTableName(f),
GeometryColumnMods.RandomFGeometryColumn(f),
GeometryColumnMods.RandomCoordDimension(f),
GeometryColumnMods.RandomSrid(f),
GeometryColumnMods.RandomType(f),
}
}
// Set the model columns to this value
func (m geometryColumnMods) FTableCatalog(val null.Val[string]) GeometryColumnMod {
return GeometryColumnModFunc(func(_ context.Context, o *GeometryColumnTemplate) {
o.FTableCatalog = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m geometryColumnMods) FTableCatalogFunc(f func() null.Val[string]) GeometryColumnMod {
return GeometryColumnModFunc(func(_ context.Context, o *GeometryColumnTemplate) {
o.FTableCatalog = f
})
}
// Clear any values for the column
func (m geometryColumnMods) UnsetFTableCatalog() GeometryColumnMod {
return GeometryColumnModFunc(func(_ context.Context, o *GeometryColumnTemplate) {
o.FTableCatalog = 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 geometryColumnMods) RandomFTableCatalog(f *faker.Faker) GeometryColumnMod {
return GeometryColumnModFunc(func(_ context.Context, o *GeometryColumnTemplate) {
o.FTableCatalog = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "256")
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 geometryColumnMods) RandomFTableCatalogNotNull(f *faker.Faker) GeometryColumnMod {
return GeometryColumnModFunc(func(_ context.Context, o *GeometryColumnTemplate) {
o.FTableCatalog = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "256")
return null.From(val)
}
})
}
// Set the model columns to this value
func (m geometryColumnMods) FTableSchema(val null.Val[string]) GeometryColumnMod {
return GeometryColumnModFunc(func(_ context.Context, o *GeometryColumnTemplate) {
o.FTableSchema = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m geometryColumnMods) FTableSchemaFunc(f func() null.Val[string]) GeometryColumnMod {
return GeometryColumnModFunc(func(_ context.Context, o *GeometryColumnTemplate) {
o.FTableSchema = f
})
}
// Clear any values for the column
func (m geometryColumnMods) UnsetFTableSchema() GeometryColumnMod {
return GeometryColumnModFunc(func(_ context.Context, o *GeometryColumnTemplate) {
o.FTableSchema = 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 geometryColumnMods) RandomFTableSchema(f *faker.Faker) GeometryColumnMod {
return GeometryColumnModFunc(func(_ context.Context, o *GeometryColumnTemplate) {
o.FTableSchema = 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 geometryColumnMods) RandomFTableSchemaNotNull(f *faker.Faker) GeometryColumnMod {
return GeometryColumnModFunc(func(_ context.Context, o *GeometryColumnTemplate) {
o.FTableSchema = 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 geometryColumnMods) FTableName(val null.Val[string]) GeometryColumnMod {
return GeometryColumnModFunc(func(_ context.Context, o *GeometryColumnTemplate) {
o.FTableName = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m geometryColumnMods) FTableNameFunc(f func() null.Val[string]) GeometryColumnMod {
return GeometryColumnModFunc(func(_ context.Context, o *GeometryColumnTemplate) {
o.FTableName = f
})
}
// Clear any values for the column
func (m geometryColumnMods) UnsetFTableName() GeometryColumnMod {
return GeometryColumnModFunc(func(_ context.Context, o *GeometryColumnTemplate) {
o.FTableName = 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 geometryColumnMods) RandomFTableName(f *faker.Faker) GeometryColumnMod {
return GeometryColumnModFunc(func(_ context.Context, o *GeometryColumnTemplate) {
o.FTableName = 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 geometryColumnMods) RandomFTableNameNotNull(f *faker.Faker) GeometryColumnMod {
return GeometryColumnModFunc(func(_ context.Context, o *GeometryColumnTemplate) {
o.FTableName = 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 geometryColumnMods) FGeometryColumn(val null.Val[string]) GeometryColumnMod {
return GeometryColumnModFunc(func(_ context.Context, o *GeometryColumnTemplate) {
o.FGeometryColumn = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m geometryColumnMods) FGeometryColumnFunc(f func() null.Val[string]) GeometryColumnMod {
return GeometryColumnModFunc(func(_ context.Context, o *GeometryColumnTemplate) {
o.FGeometryColumn = f
})
}
// Clear any values for the column
func (m geometryColumnMods) UnsetFGeometryColumn() GeometryColumnMod {
return GeometryColumnModFunc(func(_ context.Context, o *GeometryColumnTemplate) {
o.FGeometryColumn = 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 geometryColumnMods) RandomFGeometryColumn(f *faker.Faker) GeometryColumnMod {
return GeometryColumnModFunc(func(_ context.Context, o *GeometryColumnTemplate) {
o.FGeometryColumn = 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 geometryColumnMods) RandomFGeometryColumnNotNull(f *faker.Faker) GeometryColumnMod {
return GeometryColumnModFunc(func(_ context.Context, o *GeometryColumnTemplate) {
o.FGeometryColumn = 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 geometryColumnMods) CoordDimension(val null.Val[int32]) GeometryColumnMod {
return GeometryColumnModFunc(func(_ context.Context, o *GeometryColumnTemplate) {
o.CoordDimension = func() null.Val[int32] { return val }
})
}
// Set the Column from the function
func (m geometryColumnMods) CoordDimensionFunc(f func() null.Val[int32]) GeometryColumnMod {
return GeometryColumnModFunc(func(_ context.Context, o *GeometryColumnTemplate) {
o.CoordDimension = f
})
}
// Clear any values for the column
func (m geometryColumnMods) UnsetCoordDimension() GeometryColumnMod {
return GeometryColumnModFunc(func(_ context.Context, o *GeometryColumnTemplate) {
o.CoordDimension = 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 geometryColumnMods) RandomCoordDimension(f *faker.Faker) GeometryColumnMod {
return GeometryColumnModFunc(func(_ context.Context, o *GeometryColumnTemplate) {
o.CoordDimension = 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 geometryColumnMods) RandomCoordDimensionNotNull(f *faker.Faker) GeometryColumnMod {
return GeometryColumnModFunc(func(_ context.Context, o *GeometryColumnTemplate) {
o.CoordDimension = 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 geometryColumnMods) Srid(val null.Val[int32]) GeometryColumnMod {
return GeometryColumnModFunc(func(_ context.Context, o *GeometryColumnTemplate) {
o.Srid = func() null.Val[int32] { return val }
})
}
// Set the Column from the function
func (m geometryColumnMods) SridFunc(f func() null.Val[int32]) GeometryColumnMod {
return GeometryColumnModFunc(func(_ context.Context, o *GeometryColumnTemplate) {
o.Srid = f
})
}
// Clear any values for the column
func (m geometryColumnMods) UnsetSrid() GeometryColumnMod {
return GeometryColumnModFunc(func(_ context.Context, o *GeometryColumnTemplate) {
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 geometryColumnMods) RandomSrid(f *faker.Faker) GeometryColumnMod {
return GeometryColumnModFunc(func(_ context.Context, o *GeometryColumnTemplate) {
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 geometryColumnMods) RandomSridNotNull(f *faker.Faker) GeometryColumnMod {
return GeometryColumnModFunc(func(_ context.Context, o *GeometryColumnTemplate) {
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 geometryColumnMods) Type(val null.Val[string]) GeometryColumnMod {
return GeometryColumnModFunc(func(_ context.Context, o *GeometryColumnTemplate) {
o.Type = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m geometryColumnMods) TypeFunc(f func() null.Val[string]) GeometryColumnMod {
return GeometryColumnModFunc(func(_ context.Context, o *GeometryColumnTemplate) {
o.Type = f
})
}
// Clear any values for the column
func (m geometryColumnMods) UnsetType() GeometryColumnMod {
return GeometryColumnModFunc(func(_ context.Context, o *GeometryColumnTemplate) {
o.Type = 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 geometryColumnMods) RandomType(f *faker.Faker) GeometryColumnMod {
return GeometryColumnModFunc(func(_ context.Context, o *GeometryColumnTemplate) {
o.Type = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "30")
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 geometryColumnMods) RandomTypeNotNull(f *faker.Faker) GeometryColumnMod {
return GeometryColumnModFunc(func(_ context.Context, o *GeometryColumnTemplate) {
o.Type = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "30")
return null.From(val)
}
})
}
func (m geometryColumnMods) WithParentsCascading() GeometryColumnMod {
return GeometryColumnModFunc(func(ctx context.Context, o *GeometryColumnTemplate) {
if isDone, _ := geometryColumnWithParentsCascadingCtx.Value(ctx); isDone {
return
}
ctx = geometryColumnWithParentsCascadingCtx.WithValue(ctx, true)
})
}

View file

@ -0,0 +1,542 @@
// 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"
enums "github.com/Gleipnir-Technology/nidus-sync/enums"
models "github.com/Gleipnir-Technology/nidus-sync/models"
"github.com/aarondl/opt/omit"
"github.com/jaswdr/faker/v2"
"github.com/stephenafamo/bob"
)
type H3AggregationMod interface {
Apply(context.Context, *H3AggregationTemplate)
}
type H3AggregationModFunc func(context.Context, *H3AggregationTemplate)
func (f H3AggregationModFunc) Apply(ctx context.Context, n *H3AggregationTemplate) {
f(ctx, n)
}
type H3AggregationModSlice []H3AggregationMod
func (mods H3AggregationModSlice) Apply(ctx context.Context, n *H3AggregationTemplate) {
for _, f := range mods {
f.Apply(ctx, n)
}
}
// H3AggregationTemplate is an object representing the database table.
// all columns are optional and should be set by mods
type H3AggregationTemplate struct {
ID func() int32
Cell func() string
Resolution func() int32
Count func() int32
Type func() enums.H3aggregationtype
OrganizationID func() int32
r h3AggregationR
f *Factory
alreadyPersisted bool
}
type h3AggregationR struct {
Organization *h3AggregationROrganizationR
}
type h3AggregationROrganizationR struct {
o *OrganizationTemplate
}
// Apply mods to the H3AggregationTemplate
func (o *H3AggregationTemplate) Apply(ctx context.Context, mods ...H3AggregationMod) {
for _, mod := range mods {
mod.Apply(ctx, o)
}
}
// setModelRels creates and sets the relationships on *models.H3Aggregation
// according to the relationships in the template. Nothing is inserted into the db
func (t H3AggregationTemplate) setModelRels(o *models.H3Aggregation) {
if t.r.Organization != nil {
rel := t.r.Organization.o.Build()
rel.R.H3Aggregations = append(rel.R.H3Aggregations, o)
o.OrganizationID = rel.ID // h2
o.R.Organization = rel
}
}
// BuildSetter returns an *models.H3AggregationSetter
// this does nothing with the relationship templates
func (o H3AggregationTemplate) BuildSetter() *models.H3AggregationSetter {
m := &models.H3AggregationSetter{}
if o.ID != nil {
val := o.ID()
m.ID = omit.From(val)
}
if o.Cell != nil {
val := o.Cell()
m.Cell = omit.From(val)
}
if o.Resolution != nil {
val := o.Resolution()
m.Resolution = omit.From(val)
}
if o.Count != nil {
val := o.Count()
m.Count = omit.From(val)
}
if o.Type != nil {
val := o.Type()
m.Type = omit.From(val)
}
if o.OrganizationID != nil {
val := o.OrganizationID()
m.OrganizationID = omit.From(val)
}
return m
}
// BuildManySetter returns an []*models.H3AggregationSetter
// this does nothing with the relationship templates
func (o H3AggregationTemplate) BuildManySetter(number int) []*models.H3AggregationSetter {
m := make([]*models.H3AggregationSetter, number)
for i := range m {
m[i] = o.BuildSetter()
}
return m
}
// Build returns an *models.H3Aggregation
// Related objects are also created and placed in the .R field
// NOTE: Objects are not inserted into the database. Use H3AggregationTemplate.Create
func (o H3AggregationTemplate) Build() *models.H3Aggregation {
m := &models.H3Aggregation{}
if o.ID != nil {
m.ID = o.ID()
}
if o.Cell != nil {
m.Cell = o.Cell()
}
if o.Resolution != nil {
m.Resolution = o.Resolution()
}
if o.Count != nil {
m.Count = o.Count()
}
if o.Type != nil {
m.Type = o.Type()
}
if o.OrganizationID != nil {
m.OrganizationID = o.OrganizationID()
}
o.setModelRels(m)
return m
}
// BuildMany returns an models.H3AggregationSlice
// Related objects are also created and placed in the .R field
// NOTE: Objects are not inserted into the database. Use H3AggregationTemplate.CreateMany
func (o H3AggregationTemplate) BuildMany(number int) models.H3AggregationSlice {
m := make(models.H3AggregationSlice, number)
for i := range m {
m[i] = o.Build()
}
return m
}
func ensureCreatableH3Aggregation(m *models.H3AggregationSetter) {
if !(m.Cell.IsValue()) {
val := random_string(nil)
m.Cell = omit.From(val)
}
if !(m.Resolution.IsValue()) {
val := random_int32(nil)
m.Resolution = omit.From(val)
}
if !(m.Count.IsValue()) {
val := random_int32(nil)
m.Count = omit.From(val)
}
if !(m.Type.IsValue()) {
val := random_enums_H3aggregationtype(nil)
m.Type = 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.H3Aggregation
// according to the relationships in the template.
// any required relationship should have already exist on the model
func (o *H3AggregationTemplate) insertOptRels(ctx context.Context, exec bob.Executor, m *models.H3Aggregation) error {
var err error
return err
}
// Create builds a h3Aggregation and inserts it into the database
// Relations objects are also inserted and placed in the .R field
func (o *H3AggregationTemplate) Create(ctx context.Context, exec bob.Executor) (*models.H3Aggregation, error) {
var err error
opt := o.BuildSetter()
ensureCreatableH3Aggregation(opt)
if o.r.Organization == nil {
H3AggregationMods.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.H3Aggregations.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 h3Aggregation and inserts it into the database
// Relations objects are also inserted and placed in the .R field
// panics if an error occurs
func (o *H3AggregationTemplate) MustCreate(ctx context.Context, exec bob.Executor) *models.H3Aggregation {
m, err := o.Create(ctx, exec)
if err != nil {
panic(err)
}
return m
}
// CreateOrFail builds a h3Aggregation 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 *H3AggregationTemplate) CreateOrFail(ctx context.Context, tb testing.TB, exec bob.Executor) *models.H3Aggregation {
tb.Helper()
m, err := o.Create(ctx, exec)
if err != nil {
tb.Fatal(err)
return nil
}
return m
}
// CreateMany builds multiple h3Aggregations and inserts them into the database
// Relations objects are also inserted and placed in the .R field
func (o H3AggregationTemplate) CreateMany(ctx context.Context, exec bob.Executor, number int) (models.H3AggregationSlice, error) {
var err error
m := make(models.H3AggregationSlice, number)
for i := range m {
m[i], err = o.Create(ctx, exec)
if err != nil {
return nil, err
}
}
return m, nil
}
// MustCreateMany builds multiple h3Aggregations and inserts them into the database
// Relations objects are also inserted and placed in the .R field
// panics if an error occurs
func (o H3AggregationTemplate) MustCreateMany(ctx context.Context, exec bob.Executor, number int) models.H3AggregationSlice {
m, err := o.CreateMany(ctx, exec, number)
if err != nil {
panic(err)
}
return m
}
// CreateManyOrFail builds multiple h3Aggregations 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 H3AggregationTemplate) CreateManyOrFail(ctx context.Context, tb testing.TB, exec bob.Executor, number int) models.H3AggregationSlice {
tb.Helper()
m, err := o.CreateMany(ctx, exec, number)
if err != nil {
tb.Fatal(err)
return nil
}
return m
}
// H3Aggregation has methods that act as mods for the H3AggregationTemplate
var H3AggregationMods h3AggregationMods
type h3AggregationMods struct{}
func (m h3AggregationMods) RandomizeAllColumns(f *faker.Faker) H3AggregationMod {
return H3AggregationModSlice{
H3AggregationMods.RandomID(f),
H3AggregationMods.RandomCell(f),
H3AggregationMods.RandomResolution(f),
H3AggregationMods.RandomCount(f),
H3AggregationMods.RandomType(f),
H3AggregationMods.RandomOrganizationID(f),
}
}
// Set the model columns to this value
func (m h3AggregationMods) ID(val int32) H3AggregationMod {
return H3AggregationModFunc(func(_ context.Context, o *H3AggregationTemplate) {
o.ID = func() int32 { return val }
})
}
// Set the Column from the function
func (m h3AggregationMods) IDFunc(f func() int32) H3AggregationMod {
return H3AggregationModFunc(func(_ context.Context, o *H3AggregationTemplate) {
o.ID = f
})
}
// Clear any values for the column
func (m h3AggregationMods) UnsetID() H3AggregationMod {
return H3AggregationModFunc(func(_ context.Context, o *H3AggregationTemplate) {
o.ID = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m h3AggregationMods) RandomID(f *faker.Faker) H3AggregationMod {
return H3AggregationModFunc(func(_ context.Context, o *H3AggregationTemplate) {
o.ID = func() int32 {
return random_int32(f)
}
})
}
// Set the model columns to this value
func (m h3AggregationMods) Cell(val string) H3AggregationMod {
return H3AggregationModFunc(func(_ context.Context, o *H3AggregationTemplate) {
o.Cell = func() string { return val }
})
}
// Set the Column from the function
func (m h3AggregationMods) CellFunc(f func() string) H3AggregationMod {
return H3AggregationModFunc(func(_ context.Context, o *H3AggregationTemplate) {
o.Cell = f
})
}
// Clear any values for the column
func (m h3AggregationMods) UnsetCell() H3AggregationMod {
return H3AggregationModFunc(func(_ context.Context, o *H3AggregationTemplate) {
o.Cell = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m h3AggregationMods) RandomCell(f *faker.Faker) H3AggregationMod {
return H3AggregationModFunc(func(_ context.Context, o *H3AggregationTemplate) {
o.Cell = func() string {
return random_string(f)
}
})
}
// Set the model columns to this value
func (m h3AggregationMods) Resolution(val int32) H3AggregationMod {
return H3AggregationModFunc(func(_ context.Context, o *H3AggregationTemplate) {
o.Resolution = func() int32 { return val }
})
}
// Set the Column from the function
func (m h3AggregationMods) ResolutionFunc(f func() int32) H3AggregationMod {
return H3AggregationModFunc(func(_ context.Context, o *H3AggregationTemplate) {
o.Resolution = f
})
}
// Clear any values for the column
func (m h3AggregationMods) UnsetResolution() H3AggregationMod {
return H3AggregationModFunc(func(_ context.Context, o *H3AggregationTemplate) {
o.Resolution = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m h3AggregationMods) RandomResolution(f *faker.Faker) H3AggregationMod {
return H3AggregationModFunc(func(_ context.Context, o *H3AggregationTemplate) {
o.Resolution = func() int32 {
return random_int32(f)
}
})
}
// Set the model columns to this value
func (m h3AggregationMods) Count(val int32) H3AggregationMod {
return H3AggregationModFunc(func(_ context.Context, o *H3AggregationTemplate) {
o.Count = func() int32 { return val }
})
}
// Set the Column from the function
func (m h3AggregationMods) CountFunc(f func() int32) H3AggregationMod {
return H3AggregationModFunc(func(_ context.Context, o *H3AggregationTemplate) {
o.Count = f
})
}
// Clear any values for the column
func (m h3AggregationMods) UnsetCount() H3AggregationMod {
return H3AggregationModFunc(func(_ context.Context, o *H3AggregationTemplate) {
o.Count = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m h3AggregationMods) RandomCount(f *faker.Faker) H3AggregationMod {
return H3AggregationModFunc(func(_ context.Context, o *H3AggregationTemplate) {
o.Count = func() int32 {
return random_int32(f)
}
})
}
// Set the model columns to this value
func (m h3AggregationMods) Type(val enums.H3aggregationtype) H3AggregationMod {
return H3AggregationModFunc(func(_ context.Context, o *H3AggregationTemplate) {
o.Type = func() enums.H3aggregationtype { return val }
})
}
// Set the Column from the function
func (m h3AggregationMods) TypeFunc(f func() enums.H3aggregationtype) H3AggregationMod {
return H3AggregationModFunc(func(_ context.Context, o *H3AggregationTemplate) {
o.Type = f
})
}
// Clear any values for the column
func (m h3AggregationMods) UnsetType() H3AggregationMod {
return H3AggregationModFunc(func(_ context.Context, o *H3AggregationTemplate) {
o.Type = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m h3AggregationMods) RandomType(f *faker.Faker) H3AggregationMod {
return H3AggregationModFunc(func(_ context.Context, o *H3AggregationTemplate) {
o.Type = func() enums.H3aggregationtype {
return random_enums_H3aggregationtype(f)
}
})
}
// Set the model columns to this value
func (m h3AggregationMods) OrganizationID(val int32) H3AggregationMod {
return H3AggregationModFunc(func(_ context.Context, o *H3AggregationTemplate) {
o.OrganizationID = func() int32 { return val }
})
}
// Set the Column from the function
func (m h3AggregationMods) OrganizationIDFunc(f func() int32) H3AggregationMod {
return H3AggregationModFunc(func(_ context.Context, o *H3AggregationTemplate) {
o.OrganizationID = f
})
}
// Clear any values for the column
func (m h3AggregationMods) UnsetOrganizationID() H3AggregationMod {
return H3AggregationModFunc(func(_ context.Context, o *H3AggregationTemplate) {
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 h3AggregationMods) RandomOrganizationID(f *faker.Faker) H3AggregationMod {
return H3AggregationModFunc(func(_ context.Context, o *H3AggregationTemplate) {
o.OrganizationID = func() int32 {
return random_int32(f)
}
})
}
func (m h3AggregationMods) WithParentsCascading() H3AggregationMod {
return H3AggregationModFunc(func(ctx context.Context, o *H3AggregationTemplate) {
if isDone, _ := h3AggregationWithParentsCascadingCtx.Value(ctx); isDone {
return
}
ctx = h3AggregationWithParentsCascadingCtx.WithValue(ctx, true)
{
related := o.f.NewOrganizationWithContext(ctx, OrganizationMods.WithParentsCascading())
m.WithOrganization(related).Apply(ctx, o)
}
})
}
func (m h3AggregationMods) WithOrganization(rel *OrganizationTemplate) H3AggregationMod {
return H3AggregationModFunc(func(ctx context.Context, o *H3AggregationTemplate) {
o.r.Organization = &h3AggregationROrganizationR{
o: rel,
}
})
}
func (m h3AggregationMods) WithNewOrganization(mods ...OrganizationMod) H3AggregationMod {
return H3AggregationModFunc(func(ctx context.Context, o *H3AggregationTemplate) {
related := o.f.NewOrganizationWithContext(ctx, mods...)
m.WithOrganization(related).Apply(ctx, o)
})
}
func (m h3AggregationMods) WithExistingOrganization(em *models.Organization) H3AggregationMod {
return H3AggregationModFunc(func(ctx context.Context, o *H3AggregationTemplate) {
o.r.Organization = &h3AggregationROrganizationR{
o: o.f.FromExistingOrganization(em),
}
})
}
func (m h3AggregationMods) WithoutOrganization() H3AggregationMod {
return H3AggregationModFunc(func(ctx context.Context, o *H3AggregationTemplate) {
o.r.Organization = nil
})
}

View file

@ -77,6 +77,7 @@ type organizationR struct {
FSTreatmentareas []*organizationRFSTreatmentareasR
FSZones []*organizationRFSZonesR
FSZones2s []*organizationRFSZones2sR
H3Aggregations []*organizationRH3AggregationsR
HistoryContainerrelates []*organizationRHistoryContainerrelatesR
HistoryFieldscoutinglogs []*organizationRHistoryFieldscoutinglogsR
HistoryHabitatrelates []*organizationRHistoryHabitatrelatesR
@ -219,6 +220,10 @@ type organizationRFSZones2sR struct {
number int
o *FSZones2Template
}
type organizationRH3AggregationsR struct {
number int
o *H3AggregationTemplate
}
type organizationRHistoryContainerrelatesR struct {
number int
o *HistoryContainerrelateTemplate
@ -706,6 +711,19 @@ func (t OrganizationTemplate) setModelRels(o *models.Organization) {
o.R.FSZones2s = rel
}
if t.r.H3Aggregations != nil {
rel := models.H3AggregationSlice{}
for _, r := range t.r.H3Aggregations {
related := r.o.BuildMany(r.number)
for _, rel := range related {
rel.OrganizationID = o.ID // h2
rel.R.Organization = o
}
rel = append(rel, related...)
}
o.R.H3Aggregations = rel
}
if t.r.HistoryContainerrelates != nil {
rel := models.HistoryContainerrelateSlice{}
for _, r := range t.r.HistoryContainerrelates {
@ -1721,6 +1739,26 @@ func (o *OrganizationTemplate) insertOptRels(ctx context.Context, exec bob.Execu
}
}
isH3AggregationsDone, _ := organizationRelH3AggregationsCtx.Value(ctx)
if !isH3AggregationsDone && o.r.H3Aggregations != nil {
ctx = organizationRelH3AggregationsCtx.WithValue(ctx, true)
for _, r := range o.r.H3Aggregations {
if r.o.alreadyPersisted {
m.R.H3Aggregations = append(m.R.H3Aggregations, r.o.Build())
} else {
rel28, err := r.o.CreateMany(ctx, exec, r.number)
if err != nil {
return err
}
err = m.AttachH3Aggregations(ctx, exec, rel28...)
if err != nil {
return err
}
}
}
}
isHistoryContainerrelatesDone, _ := organizationRelHistoryContainerrelatesCtx.Value(ctx)
if !isHistoryContainerrelatesDone && o.r.HistoryContainerrelates != nil {
ctx = organizationRelHistoryContainerrelatesCtx.WithValue(ctx, true)
@ -1728,12 +1766,12 @@ func (o *OrganizationTemplate) insertOptRels(ctx context.Context, exec bob.Execu
if r.o.alreadyPersisted {
m.R.HistoryContainerrelates = append(m.R.HistoryContainerrelates, r.o.Build())
} else {
rel28, err := r.o.CreateMany(ctx, exec, r.number)
rel29, err := r.o.CreateMany(ctx, exec, r.number)
if err != nil {
return err
}
err = m.AttachHistoryContainerrelates(ctx, exec, rel28...)
err = m.AttachHistoryContainerrelates(ctx, exec, rel29...)
if err != nil {
return err
}
@ -1748,12 +1786,12 @@ func (o *OrganizationTemplate) insertOptRels(ctx context.Context, exec bob.Execu
if r.o.alreadyPersisted {
m.R.HistoryFieldscoutinglogs = append(m.R.HistoryFieldscoutinglogs, r.o.Build())
} else {
rel29, err := r.o.CreateMany(ctx, exec, r.number)
rel30, err := r.o.CreateMany(ctx, exec, r.number)
if err != nil {
return err
}
err = m.AttachHistoryFieldscoutinglogs(ctx, exec, rel29...)
err = m.AttachHistoryFieldscoutinglogs(ctx, exec, rel30...)
if err != nil {
return err
}
@ -1768,12 +1806,12 @@ func (o *OrganizationTemplate) insertOptRels(ctx context.Context, exec bob.Execu
if r.o.alreadyPersisted {
m.R.HistoryHabitatrelates = append(m.R.HistoryHabitatrelates, r.o.Build())
} else {
rel30, err := r.o.CreateMany(ctx, exec, r.number)
rel31, err := r.o.CreateMany(ctx, exec, r.number)
if err != nil {
return err
}
err = m.AttachHistoryHabitatrelates(ctx, exec, rel30...)
err = m.AttachHistoryHabitatrelates(ctx, exec, rel31...)
if err != nil {
return err
}
@ -1788,12 +1826,12 @@ func (o *OrganizationTemplate) insertOptRels(ctx context.Context, exec bob.Execu
if r.o.alreadyPersisted {
m.R.HistoryInspectionsamples = append(m.R.HistoryInspectionsamples, r.o.Build())
} else {
rel31, err := r.o.CreateMany(ctx, exec, r.number)
rel32, err := r.o.CreateMany(ctx, exec, r.number)
if err != nil {
return err
}
err = m.AttachHistoryInspectionsamples(ctx, exec, rel31...)
err = m.AttachHistoryInspectionsamples(ctx, exec, rel32...)
if err != nil {
return err
}
@ -1808,12 +1846,12 @@ func (o *OrganizationTemplate) insertOptRels(ctx context.Context, exec bob.Execu
if r.o.alreadyPersisted {
m.R.HistoryInspectionsampledetails = append(m.R.HistoryInspectionsampledetails, r.o.Build())
} else {
rel32, err := r.o.CreateMany(ctx, exec, r.number)
rel33, err := r.o.CreateMany(ctx, exec, r.number)
if err != nil {
return err
}
err = m.AttachHistoryInspectionsampledetails(ctx, exec, rel32...)
err = m.AttachHistoryInspectionsampledetails(ctx, exec, rel33...)
if err != nil {
return err
}
@ -1828,12 +1866,12 @@ func (o *OrganizationTemplate) insertOptRels(ctx context.Context, exec bob.Execu
if r.o.alreadyPersisted {
m.R.HistoryLinelocations = append(m.R.HistoryLinelocations, r.o.Build())
} else {
rel33, err := r.o.CreateMany(ctx, exec, r.number)
rel34, err := r.o.CreateMany(ctx, exec, r.number)
if err != nil {
return err
}
err = m.AttachHistoryLinelocations(ctx, exec, rel33...)
err = m.AttachHistoryLinelocations(ctx, exec, rel34...)
if err != nil {
return err
}
@ -1848,12 +1886,12 @@ func (o *OrganizationTemplate) insertOptRels(ctx context.Context, exec bob.Execu
if r.o.alreadyPersisted {
m.R.HistoryLocationtrackings = append(m.R.HistoryLocationtrackings, r.o.Build())
} else {
rel34, err := r.o.CreateMany(ctx, exec, r.number)
rel35, err := r.o.CreateMany(ctx, exec, r.number)
if err != nil {
return err
}
err = m.AttachHistoryLocationtrackings(ctx, exec, rel34...)
err = m.AttachHistoryLocationtrackings(ctx, exec, rel35...)
if err != nil {
return err
}
@ -1868,12 +1906,12 @@ func (o *OrganizationTemplate) insertOptRels(ctx context.Context, exec bob.Execu
if r.o.alreadyPersisted {
m.R.HistoryMosquitoinspections = append(m.R.HistoryMosquitoinspections, r.o.Build())
} else {
rel35, err := r.o.CreateMany(ctx, exec, r.number)
rel36, err := r.o.CreateMany(ctx, exec, r.number)
if err != nil {
return err
}
err = m.AttachHistoryMosquitoinspections(ctx, exec, rel35...)
err = m.AttachHistoryMosquitoinspections(ctx, exec, rel36...)
if err != nil {
return err
}
@ -1888,12 +1926,12 @@ func (o *OrganizationTemplate) insertOptRels(ctx context.Context, exec bob.Execu
if r.o.alreadyPersisted {
m.R.HistoryPointlocations = append(m.R.HistoryPointlocations, r.o.Build())
} else {
rel36, err := r.o.CreateMany(ctx, exec, r.number)
rel37, err := r.o.CreateMany(ctx, exec, r.number)
if err != nil {
return err
}
err = m.AttachHistoryPointlocations(ctx, exec, rel36...)
err = m.AttachHistoryPointlocations(ctx, exec, rel37...)
if err != nil {
return err
}
@ -1908,12 +1946,12 @@ func (o *OrganizationTemplate) insertOptRels(ctx context.Context, exec bob.Execu
if r.o.alreadyPersisted {
m.R.HistoryPolygonlocations = append(m.R.HistoryPolygonlocations, r.o.Build())
} else {
rel37, err := r.o.CreateMany(ctx, exec, r.number)
rel38, err := r.o.CreateMany(ctx, exec, r.number)
if err != nil {
return err
}
err = m.AttachHistoryPolygonlocations(ctx, exec, rel37...)
err = m.AttachHistoryPolygonlocations(ctx, exec, rel38...)
if err != nil {
return err
}
@ -1928,12 +1966,12 @@ func (o *OrganizationTemplate) insertOptRels(ctx context.Context, exec bob.Execu
if r.o.alreadyPersisted {
m.R.HistoryPools = append(m.R.HistoryPools, r.o.Build())
} else {
rel38, err := r.o.CreateMany(ctx, exec, r.number)
rel39, err := r.o.CreateMany(ctx, exec, r.number)
if err != nil {
return err
}
err = m.AttachHistoryPools(ctx, exec, rel38...)
err = m.AttachHistoryPools(ctx, exec, rel39...)
if err != nil {
return err
}
@ -1948,12 +1986,12 @@ func (o *OrganizationTemplate) insertOptRels(ctx context.Context, exec bob.Execu
if r.o.alreadyPersisted {
m.R.HistoryPooldetails = append(m.R.HistoryPooldetails, r.o.Build())
} else {
rel39, err := r.o.CreateMany(ctx, exec, r.number)
rel40, err := r.o.CreateMany(ctx, exec, r.number)
if err != nil {
return err
}
err = m.AttachHistoryPooldetails(ctx, exec, rel39...)
err = m.AttachHistoryPooldetails(ctx, exec, rel40...)
if err != nil {
return err
}
@ -1968,12 +2006,12 @@ func (o *OrganizationTemplate) insertOptRels(ctx context.Context, exec bob.Execu
if r.o.alreadyPersisted {
m.R.HistoryProposedtreatmentareas = append(m.R.HistoryProposedtreatmentareas, r.o.Build())
} else {
rel40, err := r.o.CreateMany(ctx, exec, r.number)
rel41, err := r.o.CreateMany(ctx, exec, r.number)
if err != nil {
return err
}
err = m.AttachHistoryProposedtreatmentareas(ctx, exec, rel40...)
err = m.AttachHistoryProposedtreatmentareas(ctx, exec, rel41...)
if err != nil {
return err
}
@ -1988,12 +2026,12 @@ func (o *OrganizationTemplate) insertOptRels(ctx context.Context, exec bob.Execu
if r.o.alreadyPersisted {
m.R.HistoryQamosquitoinspections = append(m.R.HistoryQamosquitoinspections, r.o.Build())
} else {
rel41, err := r.o.CreateMany(ctx, exec, r.number)
rel42, err := r.o.CreateMany(ctx, exec, r.number)
if err != nil {
return err
}
err = m.AttachHistoryQamosquitoinspections(ctx, exec, rel41...)
err = m.AttachHistoryQamosquitoinspections(ctx, exec, rel42...)
if err != nil {
return err
}
@ -2008,12 +2046,12 @@ func (o *OrganizationTemplate) insertOptRels(ctx context.Context, exec bob.Execu
if r.o.alreadyPersisted {
m.R.HistoryRodentlocations = append(m.R.HistoryRodentlocations, r.o.Build())
} else {
rel42, err := r.o.CreateMany(ctx, exec, r.number)
rel43, err := r.o.CreateMany(ctx, exec, r.number)
if err != nil {
return err
}
err = m.AttachHistoryRodentlocations(ctx, exec, rel42...)
err = m.AttachHistoryRodentlocations(ctx, exec, rel43...)
if err != nil {
return err
}
@ -2028,12 +2066,12 @@ func (o *OrganizationTemplate) insertOptRels(ctx context.Context, exec bob.Execu
if r.o.alreadyPersisted {
m.R.HistorySamplecollections = append(m.R.HistorySamplecollections, r.o.Build())
} else {
rel43, err := r.o.CreateMany(ctx, exec, r.number)
rel44, err := r.o.CreateMany(ctx, exec, r.number)
if err != nil {
return err
}
err = m.AttachHistorySamplecollections(ctx, exec, rel43...)
err = m.AttachHistorySamplecollections(ctx, exec, rel44...)
if err != nil {
return err
}
@ -2048,12 +2086,12 @@ func (o *OrganizationTemplate) insertOptRels(ctx context.Context, exec bob.Execu
if r.o.alreadyPersisted {
m.R.HistorySamplelocations = append(m.R.HistorySamplelocations, r.o.Build())
} else {
rel44, err := r.o.CreateMany(ctx, exec, r.number)
rel45, err := r.o.CreateMany(ctx, exec, r.number)
if err != nil {
return err
}
err = m.AttachHistorySamplelocations(ctx, exec, rel44...)
err = m.AttachHistorySamplelocations(ctx, exec, rel45...)
if err != nil {
return err
}
@ -2068,12 +2106,12 @@ func (o *OrganizationTemplate) insertOptRels(ctx context.Context, exec bob.Execu
if r.o.alreadyPersisted {
m.R.HistoryServicerequests = append(m.R.HistoryServicerequests, r.o.Build())
} else {
rel45, err := r.o.CreateMany(ctx, exec, r.number)
rel46, err := r.o.CreateMany(ctx, exec, r.number)
if err != nil {
return err
}
err = m.AttachHistoryServicerequests(ctx, exec, rel45...)
err = m.AttachHistoryServicerequests(ctx, exec, rel46...)
if err != nil {
return err
}
@ -2088,12 +2126,12 @@ func (o *OrganizationTemplate) insertOptRels(ctx context.Context, exec bob.Execu
if r.o.alreadyPersisted {
m.R.HistorySpeciesabundances = append(m.R.HistorySpeciesabundances, r.o.Build())
} else {
rel46, err := r.o.CreateMany(ctx, exec, r.number)
rel47, err := r.o.CreateMany(ctx, exec, r.number)
if err != nil {
return err
}
err = m.AttachHistorySpeciesabundances(ctx, exec, rel46...)
err = m.AttachHistorySpeciesabundances(ctx, exec, rel47...)
if err != nil {
return err
}
@ -2108,12 +2146,12 @@ func (o *OrganizationTemplate) insertOptRels(ctx context.Context, exec bob.Execu
if r.o.alreadyPersisted {
m.R.HistoryStormdrains = append(m.R.HistoryStormdrains, r.o.Build())
} else {
rel47, err := r.o.CreateMany(ctx, exec, r.number)
rel48, err := r.o.CreateMany(ctx, exec, r.number)
if err != nil {
return err
}
err = m.AttachHistoryStormdrains(ctx, exec, rel47...)
err = m.AttachHistoryStormdrains(ctx, exec, rel48...)
if err != nil {
return err
}
@ -2128,12 +2166,12 @@ func (o *OrganizationTemplate) insertOptRels(ctx context.Context, exec bob.Execu
if r.o.alreadyPersisted {
m.R.HistoryTimecards = append(m.R.HistoryTimecards, r.o.Build())
} else {
rel48, err := r.o.CreateMany(ctx, exec, r.number)
rel49, err := r.o.CreateMany(ctx, exec, r.number)
if err != nil {
return err
}
err = m.AttachHistoryTimecards(ctx, exec, rel48...)
err = m.AttachHistoryTimecards(ctx, exec, rel49...)
if err != nil {
return err
}
@ -2148,12 +2186,12 @@ func (o *OrganizationTemplate) insertOptRels(ctx context.Context, exec bob.Execu
if r.o.alreadyPersisted {
m.R.HistoryTrapdata = append(m.R.HistoryTrapdata, r.o.Build())
} else {
rel49, err := r.o.CreateMany(ctx, exec, r.number)
rel50, err := r.o.CreateMany(ctx, exec, r.number)
if err != nil {
return err
}
err = m.AttachHistoryTrapdata(ctx, exec, rel49...)
err = m.AttachHistoryTrapdata(ctx, exec, rel50...)
if err != nil {
return err
}
@ -2168,12 +2206,12 @@ func (o *OrganizationTemplate) insertOptRels(ctx context.Context, exec bob.Execu
if r.o.alreadyPersisted {
m.R.HistoryTraplocations = append(m.R.HistoryTraplocations, r.o.Build())
} else {
rel50, err := r.o.CreateMany(ctx, exec, r.number)
rel51, err := r.o.CreateMany(ctx, exec, r.number)
if err != nil {
return err
}
err = m.AttachHistoryTraplocations(ctx, exec, rel50...)
err = m.AttachHistoryTraplocations(ctx, exec, rel51...)
if err != nil {
return err
}
@ -2188,12 +2226,12 @@ func (o *OrganizationTemplate) insertOptRels(ctx context.Context, exec bob.Execu
if r.o.alreadyPersisted {
m.R.HistoryTreatments = append(m.R.HistoryTreatments, r.o.Build())
} else {
rel51, err := r.o.CreateMany(ctx, exec, r.number)
rel52, err := r.o.CreateMany(ctx, exec, r.number)
if err != nil {
return err
}
err = m.AttachHistoryTreatments(ctx, exec, rel51...)
err = m.AttachHistoryTreatments(ctx, exec, rel52...)
if err != nil {
return err
}
@ -2208,12 +2246,12 @@ func (o *OrganizationTemplate) insertOptRels(ctx context.Context, exec bob.Execu
if r.o.alreadyPersisted {
m.R.HistoryTreatmentareas = append(m.R.HistoryTreatmentareas, r.o.Build())
} else {
rel52, err := r.o.CreateMany(ctx, exec, r.number)
rel53, err := r.o.CreateMany(ctx, exec, r.number)
if err != nil {
return err
}
err = m.AttachHistoryTreatmentareas(ctx, exec, rel52...)
err = m.AttachHistoryTreatmentareas(ctx, exec, rel53...)
if err != nil {
return err
}
@ -2228,12 +2266,12 @@ func (o *OrganizationTemplate) insertOptRels(ctx context.Context, exec bob.Execu
if r.o.alreadyPersisted {
m.R.HistoryZones = append(m.R.HistoryZones, r.o.Build())
} else {
rel53, err := r.o.CreateMany(ctx, exec, r.number)
rel54, err := r.o.CreateMany(ctx, exec, r.number)
if err != nil {
return err
}
err = m.AttachHistoryZones(ctx, exec, rel53...)
err = m.AttachHistoryZones(ctx, exec, rel54...)
if err != nil {
return err
}
@ -2248,12 +2286,12 @@ func (o *OrganizationTemplate) insertOptRels(ctx context.Context, exec bob.Execu
if r.o.alreadyPersisted {
m.R.HistoryZones2s = append(m.R.HistoryZones2s, r.o.Build())
} else {
rel54, err := r.o.CreateMany(ctx, exec, r.number)
rel55, err := r.o.CreateMany(ctx, exec, r.number)
if err != nil {
return err
}
err = m.AttachHistoryZones2s(ctx, exec, rel54...)
err = m.AttachHistoryZones2s(ctx, exec, rel55...)
if err != nil {
return err
}
@ -2268,12 +2306,12 @@ func (o *OrganizationTemplate) insertOptRels(ctx context.Context, exec bob.Execu
if r.o.alreadyPersisted {
m.R.User = append(m.R.User, r.o.Build())
} else {
rel55, err := r.o.CreateMany(ctx, exec, r.number)
rel56, err := r.o.CreateMany(ctx, exec, r.number)
if err != nil {
return err
}
err = m.AttachUser(ctx, exec, rel55...)
err = m.AttachUser(ctx, exec, rel56...)
if err != nil {
return err
}
@ -3977,6 +4015,54 @@ func (m organizationMods) WithoutFSZones2s() OrganizationMod {
})
}
func (m organizationMods) WithH3Aggregations(number int, related *H3AggregationTemplate) OrganizationMod {
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
o.r.H3Aggregations = []*organizationRH3AggregationsR{{
number: number,
o: related,
}}
})
}
func (m organizationMods) WithNewH3Aggregations(number int, mods ...H3AggregationMod) OrganizationMod {
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
related := o.f.NewH3AggregationWithContext(ctx, mods...)
m.WithH3Aggregations(number, related).Apply(ctx, o)
})
}
func (m organizationMods) AddH3Aggregations(number int, related *H3AggregationTemplate) OrganizationMod {
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
o.r.H3Aggregations = append(o.r.H3Aggregations, &organizationRH3AggregationsR{
number: number,
o: related,
})
})
}
func (m organizationMods) AddNewH3Aggregations(number int, mods ...H3AggregationMod) OrganizationMod {
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
related := o.f.NewH3AggregationWithContext(ctx, mods...)
m.AddH3Aggregations(number, related).Apply(ctx, o)
})
}
func (m organizationMods) AddExistingH3Aggregations(existingModels ...*models.H3Aggregation) OrganizationMod {
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
for _, em := range existingModels {
o.r.H3Aggregations = append(o.r.H3Aggregations, &organizationRH3AggregationsR{
o: o.f.FromExistingH3Aggregation(em),
})
}
})
}
func (m organizationMods) WithoutH3Aggregations() OrganizationMod {
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
o.r.H3Aggregations = nil
})
}
func (m organizationMods) WithHistoryContainerrelates(number int, related *HistoryContainerrelateTemplate) OrganizationMod {
return OrganizationModFunc(func(ctx context.Context, o *OrganizationTemplate) {
o.r.HistoryContainerrelates = []*organizationRHistoryContainerrelatesR{{

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,616 @@
// 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"
models "github.com/Gleipnir-Technology/nidus-sync/models"
"github.com/aarondl/opt/null"
"github.com/jaswdr/faker/v2"
)
type RasterOverviewMod interface {
Apply(context.Context, *RasterOverviewTemplate)
}
type RasterOverviewModFunc func(context.Context, *RasterOverviewTemplate)
func (f RasterOverviewModFunc) Apply(ctx context.Context, n *RasterOverviewTemplate) {
f(ctx, n)
}
type RasterOverviewModSlice []RasterOverviewMod
func (mods RasterOverviewModSlice) Apply(ctx context.Context, n *RasterOverviewTemplate) {
for _, f := range mods {
f.Apply(ctx, n)
}
}
// RasterOverviewTemplate is an object representing the database table.
// all columns are optional and should be set by mods
type RasterOverviewTemplate struct {
OTableCatalog func() null.Val[string]
OTableSchema func() null.Val[string]
OTableName func() null.Val[string]
ORasterColumn func() null.Val[string]
RTableCatalog func() null.Val[string]
RTableSchema func() null.Val[string]
RTableName func() null.Val[string]
RRasterColumn func() null.Val[string]
OverviewFactor func() null.Val[int32]
f *Factory
alreadyPersisted bool
}
// Apply mods to the RasterOverviewTemplate
func (o *RasterOverviewTemplate) Apply(ctx context.Context, mods ...RasterOverviewMod) {
for _, mod := range mods {
mod.Apply(ctx, o)
}
}
// setModelRels creates and sets the relationships on *models.RasterOverview
// according to the relationships in the template. Nothing is inserted into the db
func (t RasterOverviewTemplate) setModelRels(o *models.RasterOverview) {}
// Build returns an *models.RasterOverview
// Related objects are also created and placed in the .R field
// NOTE: Objects are not inserted into the database. Use RasterOverviewTemplate.Create
func (o RasterOverviewTemplate) Build() *models.RasterOverview {
m := &models.RasterOverview{}
if o.OTableCatalog != nil {
m.OTableCatalog = o.OTableCatalog()
}
if o.OTableSchema != nil {
m.OTableSchema = o.OTableSchema()
}
if o.OTableName != nil {
m.OTableName = o.OTableName()
}
if o.ORasterColumn != nil {
m.ORasterColumn = o.ORasterColumn()
}
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.OverviewFactor != nil {
m.OverviewFactor = o.OverviewFactor()
}
o.setModelRels(m)
return m
}
// BuildMany returns an models.RasterOverviewSlice
// Related objects are also created and placed in the .R field
// NOTE: Objects are not inserted into the database. Use RasterOverviewTemplate.CreateMany
func (o RasterOverviewTemplate) BuildMany(number int) models.RasterOverviewSlice {
m := make(models.RasterOverviewSlice, number)
for i := range m {
m[i] = o.Build()
}
return m
}
// RasterOverview has methods that act as mods for the RasterOverviewTemplate
var RasterOverviewMods rasterOverviewMods
type rasterOverviewMods struct{}
func (m rasterOverviewMods) RandomizeAllColumns(f *faker.Faker) RasterOverviewMod {
return RasterOverviewModSlice{
RasterOverviewMods.RandomOTableCatalog(f),
RasterOverviewMods.RandomOTableSchema(f),
RasterOverviewMods.RandomOTableName(f),
RasterOverviewMods.RandomORasterColumn(f),
RasterOverviewMods.RandomRTableCatalog(f),
RasterOverviewMods.RandomRTableSchema(f),
RasterOverviewMods.RandomRTableName(f),
RasterOverviewMods.RandomRRasterColumn(f),
RasterOverviewMods.RandomOverviewFactor(f),
}
}
// Set the model columns to this value
func (m rasterOverviewMods) OTableCatalog(val null.Val[string]) RasterOverviewMod {
return RasterOverviewModFunc(func(_ context.Context, o *RasterOverviewTemplate) {
o.OTableCatalog = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m rasterOverviewMods) OTableCatalogFunc(f func() null.Val[string]) RasterOverviewMod {
return RasterOverviewModFunc(func(_ context.Context, o *RasterOverviewTemplate) {
o.OTableCatalog = f
})
}
// Clear any values for the column
func (m rasterOverviewMods) UnsetOTableCatalog() RasterOverviewMod {
return RasterOverviewModFunc(func(_ context.Context, o *RasterOverviewTemplate) {
o.OTableCatalog = 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 rasterOverviewMods) RandomOTableCatalog(f *faker.Faker) RasterOverviewMod {
return RasterOverviewModFunc(func(_ context.Context, o *RasterOverviewTemplate) {
o.OTableCatalog = 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 rasterOverviewMods) RandomOTableCatalogNotNull(f *faker.Faker) RasterOverviewMod {
return RasterOverviewModFunc(func(_ context.Context, o *RasterOverviewTemplate) {
o.OTableCatalog = 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 rasterOverviewMods) OTableSchema(val null.Val[string]) RasterOverviewMod {
return RasterOverviewModFunc(func(_ context.Context, o *RasterOverviewTemplate) {
o.OTableSchema = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m rasterOverviewMods) OTableSchemaFunc(f func() null.Val[string]) RasterOverviewMod {
return RasterOverviewModFunc(func(_ context.Context, o *RasterOverviewTemplate) {
o.OTableSchema = f
})
}
// Clear any values for the column
func (m rasterOverviewMods) UnsetOTableSchema() RasterOverviewMod {
return RasterOverviewModFunc(func(_ context.Context, o *RasterOverviewTemplate) {
o.OTableSchema = 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 rasterOverviewMods) RandomOTableSchema(f *faker.Faker) RasterOverviewMod {
return RasterOverviewModFunc(func(_ context.Context, o *RasterOverviewTemplate) {
o.OTableSchema = 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 rasterOverviewMods) RandomOTableSchemaNotNull(f *faker.Faker) RasterOverviewMod {
return RasterOverviewModFunc(func(_ context.Context, o *RasterOverviewTemplate) {
o.OTableSchema = 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 rasterOverviewMods) OTableName(val null.Val[string]) RasterOverviewMod {
return RasterOverviewModFunc(func(_ context.Context, o *RasterOverviewTemplate) {
o.OTableName = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m rasterOverviewMods) OTableNameFunc(f func() null.Val[string]) RasterOverviewMod {
return RasterOverviewModFunc(func(_ context.Context, o *RasterOverviewTemplate) {
o.OTableName = f
})
}
// Clear any values for the column
func (m rasterOverviewMods) UnsetOTableName() RasterOverviewMod {
return RasterOverviewModFunc(func(_ context.Context, o *RasterOverviewTemplate) {
o.OTableName = 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 rasterOverviewMods) RandomOTableName(f *faker.Faker) RasterOverviewMod {
return RasterOverviewModFunc(func(_ context.Context, o *RasterOverviewTemplate) {
o.OTableName = 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 rasterOverviewMods) RandomOTableNameNotNull(f *faker.Faker) RasterOverviewMod {
return RasterOverviewModFunc(func(_ context.Context, o *RasterOverviewTemplate) {
o.OTableName = 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 rasterOverviewMods) ORasterColumn(val null.Val[string]) RasterOverviewMod {
return RasterOverviewModFunc(func(_ context.Context, o *RasterOverviewTemplate) {
o.ORasterColumn = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m rasterOverviewMods) ORasterColumnFunc(f func() null.Val[string]) RasterOverviewMod {
return RasterOverviewModFunc(func(_ context.Context, o *RasterOverviewTemplate) {
o.ORasterColumn = f
})
}
// Clear any values for the column
func (m rasterOverviewMods) UnsetORasterColumn() RasterOverviewMod {
return RasterOverviewModFunc(func(_ context.Context, o *RasterOverviewTemplate) {
o.ORasterColumn = 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 rasterOverviewMods) RandomORasterColumn(f *faker.Faker) RasterOverviewMod {
return RasterOverviewModFunc(func(_ context.Context, o *RasterOverviewTemplate) {
o.ORasterColumn = 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 rasterOverviewMods) RandomORasterColumnNotNull(f *faker.Faker) RasterOverviewMod {
return RasterOverviewModFunc(func(_ context.Context, o *RasterOverviewTemplate) {
o.ORasterColumn = 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 rasterOverviewMods) RTableCatalog(val null.Val[string]) RasterOverviewMod {
return RasterOverviewModFunc(func(_ context.Context, o *RasterOverviewTemplate) {
o.RTableCatalog = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m rasterOverviewMods) RTableCatalogFunc(f func() null.Val[string]) RasterOverviewMod {
return RasterOverviewModFunc(func(_ context.Context, o *RasterOverviewTemplate) {
o.RTableCatalog = f
})
}
// Clear any values for the column
func (m rasterOverviewMods) UnsetRTableCatalog() RasterOverviewMod {
return RasterOverviewModFunc(func(_ context.Context, o *RasterOverviewTemplate) {
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 rasterOverviewMods) RandomRTableCatalog(f *faker.Faker) RasterOverviewMod {
return RasterOverviewModFunc(func(_ context.Context, o *RasterOverviewTemplate) {
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 rasterOverviewMods) RandomRTableCatalogNotNull(f *faker.Faker) RasterOverviewMod {
return RasterOverviewModFunc(func(_ context.Context, o *RasterOverviewTemplate) {
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 rasterOverviewMods) RTableSchema(val null.Val[string]) RasterOverviewMod {
return RasterOverviewModFunc(func(_ context.Context, o *RasterOverviewTemplate) {
o.RTableSchema = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m rasterOverviewMods) RTableSchemaFunc(f func() null.Val[string]) RasterOverviewMod {
return RasterOverviewModFunc(func(_ context.Context, o *RasterOverviewTemplate) {
o.RTableSchema = f
})
}
// Clear any values for the column
func (m rasterOverviewMods) UnsetRTableSchema() RasterOverviewMod {
return RasterOverviewModFunc(func(_ context.Context, o *RasterOverviewTemplate) {
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 rasterOverviewMods) RandomRTableSchema(f *faker.Faker) RasterOverviewMod {
return RasterOverviewModFunc(func(_ context.Context, o *RasterOverviewTemplate) {
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 rasterOverviewMods) RandomRTableSchemaNotNull(f *faker.Faker) RasterOverviewMod {
return RasterOverviewModFunc(func(_ context.Context, o *RasterOverviewTemplate) {
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 rasterOverviewMods) RTableName(val null.Val[string]) RasterOverviewMod {
return RasterOverviewModFunc(func(_ context.Context, o *RasterOverviewTemplate) {
o.RTableName = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m rasterOverviewMods) RTableNameFunc(f func() null.Val[string]) RasterOverviewMod {
return RasterOverviewModFunc(func(_ context.Context, o *RasterOverviewTemplate) {
o.RTableName = f
})
}
// Clear any values for the column
func (m rasterOverviewMods) UnsetRTableName() RasterOverviewMod {
return RasterOverviewModFunc(func(_ context.Context, o *RasterOverviewTemplate) {
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 rasterOverviewMods) RandomRTableName(f *faker.Faker) RasterOverviewMod {
return RasterOverviewModFunc(func(_ context.Context, o *RasterOverviewTemplate) {
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 rasterOverviewMods) RandomRTableNameNotNull(f *faker.Faker) RasterOverviewMod {
return RasterOverviewModFunc(func(_ context.Context, o *RasterOverviewTemplate) {
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 rasterOverviewMods) RRasterColumn(val null.Val[string]) RasterOverviewMod {
return RasterOverviewModFunc(func(_ context.Context, o *RasterOverviewTemplate) {
o.RRasterColumn = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m rasterOverviewMods) RRasterColumnFunc(f func() null.Val[string]) RasterOverviewMod {
return RasterOverviewModFunc(func(_ context.Context, o *RasterOverviewTemplate) {
o.RRasterColumn = f
})
}
// Clear any values for the column
func (m rasterOverviewMods) UnsetRRasterColumn() RasterOverviewMod {
return RasterOverviewModFunc(func(_ context.Context, o *RasterOverviewTemplate) {
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 rasterOverviewMods) RandomRRasterColumn(f *faker.Faker) RasterOverviewMod {
return RasterOverviewModFunc(func(_ context.Context, o *RasterOverviewTemplate) {
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 rasterOverviewMods) RandomRRasterColumnNotNull(f *faker.Faker) RasterOverviewMod {
return RasterOverviewModFunc(func(_ context.Context, o *RasterOverviewTemplate) {
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 rasterOverviewMods) OverviewFactor(val null.Val[int32]) RasterOverviewMod {
return RasterOverviewModFunc(func(_ context.Context, o *RasterOverviewTemplate) {
o.OverviewFactor = func() null.Val[int32] { return val }
})
}
// Set the Column from the function
func (m rasterOverviewMods) OverviewFactorFunc(f func() null.Val[int32]) RasterOverviewMod {
return RasterOverviewModFunc(func(_ context.Context, o *RasterOverviewTemplate) {
o.OverviewFactor = f
})
}
// Clear any values for the column
func (m rasterOverviewMods) UnsetOverviewFactor() RasterOverviewMod {
return RasterOverviewModFunc(func(_ context.Context, o *RasterOverviewTemplate) {
o.OverviewFactor = 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 rasterOverviewMods) RandomOverviewFactor(f *faker.Faker) RasterOverviewMod {
return RasterOverviewModFunc(func(_ context.Context, o *RasterOverviewTemplate) {
o.OverviewFactor = 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 rasterOverviewMods) RandomOverviewFactorNotNull(f *faker.Faker) RasterOverviewMod {
return RasterOverviewModFunc(func(_ context.Context, o *RasterOverviewTemplate) {
o.OverviewFactor = func() null.Val[int32] {
if f == nil {
f = &defaultFaker
}
val := random_int32(f)
return null.From(val)
}
})
}
func (m rasterOverviewMods) WithParentsCascading() RasterOverviewMod {
return RasterOverviewModFunc(func(ctx context.Context, o *RasterOverviewTemplate) {
if isDone, _ := rasterOverviewWithParentsCascadingCtx.Value(ctx); isDone {
return
}
ctx = rasterOverviewWithParentsCascadingCtx.WithValue(ctx, true)
})
}

View file

@ -0,0 +1,505 @@
// 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"
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 SpatialRefSyMod interface {
Apply(context.Context, *SpatialRefSyTemplate)
}
type SpatialRefSyModFunc func(context.Context, *SpatialRefSyTemplate)
func (f SpatialRefSyModFunc) Apply(ctx context.Context, n *SpatialRefSyTemplate) {
f(ctx, n)
}
type SpatialRefSyModSlice []SpatialRefSyMod
func (mods SpatialRefSyModSlice) Apply(ctx context.Context, n *SpatialRefSyTemplate) {
for _, f := range mods {
f.Apply(ctx, n)
}
}
// SpatialRefSyTemplate is an object representing the database table.
// all columns are optional and should be set by mods
type SpatialRefSyTemplate struct {
Srid func() int32
AuthName func() null.Val[string]
AuthSrid func() null.Val[int32]
Srtext func() null.Val[string]
Proj4text func() null.Val[string]
f *Factory
alreadyPersisted bool
}
// Apply mods to the SpatialRefSyTemplate
func (o *SpatialRefSyTemplate) Apply(ctx context.Context, mods ...SpatialRefSyMod) {
for _, mod := range mods {
mod.Apply(ctx, o)
}
}
// setModelRels creates and sets the relationships on *models.SpatialRefSy
// according to the relationships in the template. Nothing is inserted into the db
func (t SpatialRefSyTemplate) setModelRels(o *models.SpatialRefSy) {}
// BuildSetter returns an *models.SpatialRefSySetter
// this does nothing with the relationship templates
func (o SpatialRefSyTemplate) BuildSetter() *models.SpatialRefSySetter {
m := &models.SpatialRefSySetter{}
if o.Srid != nil {
val := o.Srid()
m.Srid = omit.From(val)
}
if o.AuthName != nil {
val := o.AuthName()
m.AuthName = omitnull.FromNull(val)
}
if o.AuthSrid != nil {
val := o.AuthSrid()
m.AuthSrid = omitnull.FromNull(val)
}
if o.Srtext != nil {
val := o.Srtext()
m.Srtext = omitnull.FromNull(val)
}
if o.Proj4text != nil {
val := o.Proj4text()
m.Proj4text = omitnull.FromNull(val)
}
return m
}
// BuildManySetter returns an []*models.SpatialRefSySetter
// this does nothing with the relationship templates
func (o SpatialRefSyTemplate) BuildManySetter(number int) []*models.SpatialRefSySetter {
m := make([]*models.SpatialRefSySetter, number)
for i := range m {
m[i] = o.BuildSetter()
}
return m
}
// Build returns an *models.SpatialRefSy
// Related objects are also created and placed in the .R field
// NOTE: Objects are not inserted into the database. Use SpatialRefSyTemplate.Create
func (o SpatialRefSyTemplate) Build() *models.SpatialRefSy {
m := &models.SpatialRefSy{}
if o.Srid != nil {
m.Srid = o.Srid()
}
if o.AuthName != nil {
m.AuthName = o.AuthName()
}
if o.AuthSrid != nil {
m.AuthSrid = o.AuthSrid()
}
if o.Srtext != nil {
m.Srtext = o.Srtext()
}
if o.Proj4text != nil {
m.Proj4text = o.Proj4text()
}
o.setModelRels(m)
return m
}
// BuildMany returns an models.SpatialRefSySlice
// Related objects are also created and placed in the .R field
// NOTE: Objects are not inserted into the database. Use SpatialRefSyTemplate.CreateMany
func (o SpatialRefSyTemplate) BuildMany(number int) models.SpatialRefSySlice {
m := make(models.SpatialRefSySlice, number)
for i := range m {
m[i] = o.Build()
}
return m
}
func ensureCreatableSpatialRefSy(m *models.SpatialRefSySetter) {
if !(m.Srid.IsValue()) {
val := random_int32(nil)
m.Srid = omit.From(val)
}
}
// insertOptRels creates and inserts any optional the relationships on *models.SpatialRefSy
// according to the relationships in the template.
// any required relationship should have already exist on the model
func (o *SpatialRefSyTemplate) insertOptRels(ctx context.Context, exec bob.Executor, m *models.SpatialRefSy) error {
var err error
return err
}
// Create builds a spatialRefSy and inserts it into the database
// Relations objects are also inserted and placed in the .R field
func (o *SpatialRefSyTemplate) Create(ctx context.Context, exec bob.Executor) (*models.SpatialRefSy, error) {
var err error
opt := o.BuildSetter()
ensureCreatableSpatialRefSy(opt)
m, err := models.SpatialRefSys.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 spatialRefSy and inserts it into the database
// Relations objects are also inserted and placed in the .R field
// panics if an error occurs
func (o *SpatialRefSyTemplate) MustCreate(ctx context.Context, exec bob.Executor) *models.SpatialRefSy {
m, err := o.Create(ctx, exec)
if err != nil {
panic(err)
}
return m
}
// CreateOrFail builds a spatialRefSy 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 *SpatialRefSyTemplate) CreateOrFail(ctx context.Context, tb testing.TB, exec bob.Executor) *models.SpatialRefSy {
tb.Helper()
m, err := o.Create(ctx, exec)
if err != nil {
tb.Fatal(err)
return nil
}
return m
}
// CreateMany builds multiple spatialRefSys and inserts them into the database
// Relations objects are also inserted and placed in the .R field
func (o SpatialRefSyTemplate) CreateMany(ctx context.Context, exec bob.Executor, number int) (models.SpatialRefSySlice, error) {
var err error
m := make(models.SpatialRefSySlice, number)
for i := range m {
m[i], err = o.Create(ctx, exec)
if err != nil {
return nil, err
}
}
return m, nil
}
// MustCreateMany builds multiple spatialRefSys and inserts them into the database
// Relations objects are also inserted and placed in the .R field
// panics if an error occurs
func (o SpatialRefSyTemplate) MustCreateMany(ctx context.Context, exec bob.Executor, number int) models.SpatialRefSySlice {
m, err := o.CreateMany(ctx, exec, number)
if err != nil {
panic(err)
}
return m
}
// CreateManyOrFail builds multiple spatialRefSys 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 SpatialRefSyTemplate) CreateManyOrFail(ctx context.Context, tb testing.TB, exec bob.Executor, number int) models.SpatialRefSySlice {
tb.Helper()
m, err := o.CreateMany(ctx, exec, number)
if err != nil {
tb.Fatal(err)
return nil
}
return m
}
// SpatialRefSy has methods that act as mods for the SpatialRefSyTemplate
var SpatialRefSyMods spatialRefSyMods
type spatialRefSyMods struct{}
func (m spatialRefSyMods) RandomizeAllColumns(f *faker.Faker) SpatialRefSyMod {
return SpatialRefSyModSlice{
SpatialRefSyMods.RandomSrid(f),
SpatialRefSyMods.RandomAuthName(f),
SpatialRefSyMods.RandomAuthSrid(f),
SpatialRefSyMods.RandomSrtext(f),
SpatialRefSyMods.RandomProj4text(f),
}
}
// Set the model columns to this value
func (m spatialRefSyMods) Srid(val int32) SpatialRefSyMod {
return SpatialRefSyModFunc(func(_ context.Context, o *SpatialRefSyTemplate) {
o.Srid = func() int32 { return val }
})
}
// Set the Column from the function
func (m spatialRefSyMods) SridFunc(f func() int32) SpatialRefSyMod {
return SpatialRefSyModFunc(func(_ context.Context, o *SpatialRefSyTemplate) {
o.Srid = f
})
}
// Clear any values for the column
func (m spatialRefSyMods) UnsetSrid() SpatialRefSyMod {
return SpatialRefSyModFunc(func(_ context.Context, o *SpatialRefSyTemplate) {
o.Srid = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m spatialRefSyMods) RandomSrid(f *faker.Faker) SpatialRefSyMod {
return SpatialRefSyModFunc(func(_ context.Context, o *SpatialRefSyTemplate) {
o.Srid = func() int32 {
return random_int32(f)
}
})
}
// Set the model columns to this value
func (m spatialRefSyMods) AuthName(val null.Val[string]) SpatialRefSyMod {
return SpatialRefSyModFunc(func(_ context.Context, o *SpatialRefSyTemplate) {
o.AuthName = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m spatialRefSyMods) AuthNameFunc(f func() null.Val[string]) SpatialRefSyMod {
return SpatialRefSyModFunc(func(_ context.Context, o *SpatialRefSyTemplate) {
o.AuthName = f
})
}
// Clear any values for the column
func (m spatialRefSyMods) UnsetAuthName() SpatialRefSyMod {
return SpatialRefSyModFunc(func(_ context.Context, o *SpatialRefSyTemplate) {
o.AuthName = 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 spatialRefSyMods) RandomAuthName(f *faker.Faker) SpatialRefSyMod {
return SpatialRefSyModFunc(func(_ context.Context, o *SpatialRefSyTemplate) {
o.AuthName = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "256")
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 spatialRefSyMods) RandomAuthNameNotNull(f *faker.Faker) SpatialRefSyMod {
return SpatialRefSyModFunc(func(_ context.Context, o *SpatialRefSyTemplate) {
o.AuthName = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "256")
return null.From(val)
}
})
}
// Set the model columns to this value
func (m spatialRefSyMods) AuthSrid(val null.Val[int32]) SpatialRefSyMod {
return SpatialRefSyModFunc(func(_ context.Context, o *SpatialRefSyTemplate) {
o.AuthSrid = func() null.Val[int32] { return val }
})
}
// Set the Column from the function
func (m spatialRefSyMods) AuthSridFunc(f func() null.Val[int32]) SpatialRefSyMod {
return SpatialRefSyModFunc(func(_ context.Context, o *SpatialRefSyTemplate) {
o.AuthSrid = f
})
}
// Clear any values for the column
func (m spatialRefSyMods) UnsetAuthSrid() SpatialRefSyMod {
return SpatialRefSyModFunc(func(_ context.Context, o *SpatialRefSyTemplate) {
o.AuthSrid = 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 spatialRefSyMods) RandomAuthSrid(f *faker.Faker) SpatialRefSyMod {
return SpatialRefSyModFunc(func(_ context.Context, o *SpatialRefSyTemplate) {
o.AuthSrid = 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 spatialRefSyMods) RandomAuthSridNotNull(f *faker.Faker) SpatialRefSyMod {
return SpatialRefSyModFunc(func(_ context.Context, o *SpatialRefSyTemplate) {
o.AuthSrid = 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 spatialRefSyMods) Srtext(val null.Val[string]) SpatialRefSyMod {
return SpatialRefSyModFunc(func(_ context.Context, o *SpatialRefSyTemplate) {
o.Srtext = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m spatialRefSyMods) SrtextFunc(f func() null.Val[string]) SpatialRefSyMod {
return SpatialRefSyModFunc(func(_ context.Context, o *SpatialRefSyTemplate) {
o.Srtext = f
})
}
// Clear any values for the column
func (m spatialRefSyMods) UnsetSrtext() SpatialRefSyMod {
return SpatialRefSyModFunc(func(_ context.Context, o *SpatialRefSyTemplate) {
o.Srtext = 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 spatialRefSyMods) RandomSrtext(f *faker.Faker) SpatialRefSyMod {
return SpatialRefSyModFunc(func(_ context.Context, o *SpatialRefSyTemplate) {
o.Srtext = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "2048")
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 spatialRefSyMods) RandomSrtextNotNull(f *faker.Faker) SpatialRefSyMod {
return SpatialRefSyModFunc(func(_ context.Context, o *SpatialRefSyTemplate) {
o.Srtext = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "2048")
return null.From(val)
}
})
}
// Set the model columns to this value
func (m spatialRefSyMods) Proj4text(val null.Val[string]) SpatialRefSyMod {
return SpatialRefSyModFunc(func(_ context.Context, o *SpatialRefSyTemplate) {
o.Proj4text = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m spatialRefSyMods) Proj4textFunc(f func() null.Val[string]) SpatialRefSyMod {
return SpatialRefSyModFunc(func(_ context.Context, o *SpatialRefSyTemplate) {
o.Proj4text = f
})
}
// Clear any values for the column
func (m spatialRefSyMods) UnsetProj4text() SpatialRefSyMod {
return SpatialRefSyModFunc(func(_ context.Context, o *SpatialRefSyTemplate) {
o.Proj4text = 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 spatialRefSyMods) RandomProj4text(f *faker.Faker) SpatialRefSyMod {
return SpatialRefSyModFunc(func(_ context.Context, o *SpatialRefSyTemplate) {
o.Proj4text = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "2048")
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 spatialRefSyMods) RandomProj4textNotNull(f *faker.Faker) SpatialRefSyMod {
return SpatialRefSyModFunc(func(_ context.Context, o *SpatialRefSyTemplate) {
o.Proj4text = func() null.Val[string] {
if f == nil {
f = &defaultFaker
}
val := random_string(f, "2048")
return null.From(val)
}
})
}
func (m spatialRefSyMods) WithParentsCascading() SpatialRefSyMod {
return SpatialRefSyModFunc(func(ctx context.Context, o *SpatialRefSyTemplate) {
if isDone, _ := spatialRefSyWithParentsCascadingCtx.Value(ctx); isDone {
return
}
ctx = spatialRefSyWithParentsCascadingCtx.WithValue(ctx, true)
})
}

3
go.mod
View file

@ -22,7 +22,7 @@ require (
github.com/stephenafamo/bob v0.41.1
github.com/stephenafamo/scan v0.7.0
github.com/tidwall/geojson v1.4.5
github.com/uber/h3-go/v3 v3.7.1
github.com/uber/h3-go/v4 v4.3.0
github.com/wasilibs/go-pgquery v0.0.0-20250409022910-10ac41983c07
golang.org/x/crypto v0.42.0
)
@ -49,6 +49,7 @@ require (
github.com/tidwall/pretty v1.2.0 // indirect
github.com/tidwall/rtree v1.3.1 // indirect
github.com/tidwall/sjson v1.2.4 // indirect
github.com/uber/h3-go/v3 v3.7.1 // indirect
github.com/wasilibs/wazero-helpers v0.0.0-20240620070341-3dff1577cd52 // indirect
github.com/x448/float16 v0.8.4 // indirect
go.uber.org/multierr v1.11.0 // indirect

2
go.sum
View file

@ -204,6 +204,8 @@ github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+F
github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY=
github.com/uber/h3-go/v3 v3.7.1 h1:qGAnkRKXHeuaGuLDktcouROiNDE1PgZTgiZGMBwVnSc=
github.com/uber/h3-go/v3 v3.7.1/go.mod h1:XS+EMzW0EmjL/aioQsvLIYJRtC7/lodai5l8SNmlYIs=
github.com/uber/h3-go/v4 v4.3.0 h1:5y5je8gu6+1pGzGo8soiudmgE3WJzfJRWdy0yhc3+HY=
github.com/uber/h3-go/v4 v4.3.0/go.mod h1:EyZ/EWguHlheIBcshTAMmQPYcaGKVvJ4qlzEHzC0BkU=
github.com/wasilibs/go-pgquery v0.0.0-20250409022910-10ac41983c07 h1:mJdDDPblDfPe7z7go8Dvv1AJQDI3eQ/5xith3q2mFlo=
github.com/wasilibs/go-pgquery v0.0.0-20250409022910-10ac41983c07/go.mod h1:Ak17IJ037caFp4jpCw/iQQ7/W74Sqpb1YuKJU6HTKfM=
github.com/wasilibs/wazero-helpers v0.0.0-20240620070341-3dff1577cd52 h1:OvLBa8SqJnZ6P+mjlzc2K7PM22rRUPE1x32G9DTPrC4=

43
h3.go
View file

@ -5,21 +5,30 @@ import (
"github.com/Gleipnir-Technology/go-geojson2h3"
"github.com/tidwall/geojson"
"github.com/uber/h3-go/v3"
"github.com/uber/h3-go/v4"
)
func h3Indexes() []h3.H3Index {
func h3Indexes() []h3.Cell {
//[] uint64{0x852a134ffffffff})
/*result := make([]h3.H3Index, 0)
for _, v := range values {
result = append(result, v)
}
return result*/
return []h3.H3Index{
0x852a134ffffffff,
return []h3.Cell{
0x8629aab2fffffff,
0x8629a8627ffffff,
0x8629a8607ffffff,
0x8629a8717ffffff,
0x8629a8617ffffff,
0x8629a8407ffffff,
0x8629a871fffffff,
0x8629a845fffffff,
0x8629aab27ffffff,
0x8629a84e7ffffff,
}
}
func h3ToGeoJSON(indexes []h3.H3Index) (string, error) {
func h3ToGeoJSON(indexes []h3.Cell) (string, error) {
featureCollection, err := geojson2h3.ToFeatureCollection(indexes)
if err != nil {
return "", fmt.Errorf("Failed to get feature collection: %w", err)
@ -38,7 +47,7 @@ func main2() {
panic(err)
}
for _, index := range indexes {
fmt.Printf("h3index: %s\n", h3.ToString(index))
fmt.Printf("h3index: %s\n", index.String())
}
featureCollection, err := geojson2h3.ToFeatureCollection(indexes)
@ -48,3 +57,25 @@ func main2() {
fmt.Println("Polyfill:")
fmt.Println(featureCollection.JSON())
}
// Given a cell at a smaller resolution remap it to the larger resolution
func scaleCell(cell h3.Cell, resolution int) (h3.Cell, error) {
r := cell.Resolution()
if r == resolution {
return cell, nil
}
latLong, err := cell.LatLng()
if err != nil {
return 0, fmt.Errorf("Failed to get latlng: %w", err)
}
scaled, err := h3.LatLngToCell(latLong, resolution)
if err != nil {
return 0, fmt.Errorf("Failed to create latlng: %w", err)
}
return scaled, nil
}
func getCell(x, y float64, resolution int) (h3.Cell, error) {
latLng := h3.NewLatLng(y, x)
return h3.LatLngToCell(latLng, resolution)
}

View file

@ -0,0 +1,73 @@
-- +goose Up
ALTER TABLE fs_containerrelate ALTER COLUMN globalid SET NOT NULL;
ALTER TABLE fs_fieldscoutinglog ALTER COLUMN globalid SET NOT NULL;
ALTER TABLE fs_habitatrelate ALTER COLUMN globalid SET NOT NULL;
ALTER TABLE fs_habitatrelate ALTER COLUMN globalid SET NOT NULL;
ALTER TABLE fs_inspectionsample ALTER COLUMN globalid SET NOT NULL;
ALTER TABLE fs_inspectionsample ALTER COLUMN globalid SET NOT NULL;
ALTER TABLE fs_inspectionsampledetail ALTER COLUMN globalid SET NOT NULL;
ALTER TABLE fs_linelocation ALTER COLUMN globalid SET NOT NULL;
ALTER TABLE fs_locationtracking ALTER COLUMN globalid SET NOT NULL;
ALTER TABLE fs_mosquitoinspection ALTER COLUMN globalid SET NOT NULL;
ALTER TABLE fs_mosquitoinspection ALTER COLUMN globalid SET NOT NULL;
ALTER TABLE fs_pointlocation ALTER COLUMN globalid SET NOT NULL;
ALTER TABLE fs_pointlocation ALTER COLUMN geometry_x SET NOT NULL;
ALTER TABLE fs_pointlocation ALTER COLUMN geometry_y SET NOT NULL;
ALTER TABLE fs_polygonlocation ALTER COLUMN globalid SET NOT NULL;
ALTER TABLE fs_polygonlocation ALTER COLUMN globalid SET NOT NULL;
ALTER TABLE fs_pool ALTER COLUMN globalid SET NOT NULL;
ALTER TABLE fs_pooldetail ALTER COLUMN globalid SET NOT NULL;
ALTER TABLE fs_proposedtreatmentarea ALTER COLUMN globalid SET NOT NULL;
ALTER TABLE fs_qamosquitoinspection ALTER COLUMN globalid SET NOT NULL;
ALTER TABLE fs_rodentlocation ALTER COLUMN globalid SET NOT NULL;
ALTER TABLE fs_samplecollection ALTER COLUMN globalid SET NOT NULL;
ALTER TABLE fs_samplelocation ALTER COLUMN globalid SET NOT NULL;
ALTER TABLE fs_servicerequest ALTER COLUMN globalid SET NOT NULL;
ALTER TABLE fs_servicerequest ALTER COLUMN geometry_x SET NOT NULL;
ALTER TABLE fs_servicerequest ALTER COLUMN geometry_y SET NOT NULL;
ALTER TABLE fs_speciesabundance ALTER COLUMN globalid SET NOT NULL;
ALTER TABLE fs_stormdrain ALTER COLUMN globalid SET NOT NULL;
ALTER TABLE fs_timecard ALTER COLUMN globalid SET NOT NULL;
ALTER TABLE fs_trapdata ALTER COLUMN globalid SET NOT NULL;
ALTER TABLE fs_traplocation ALTER COLUMN globalid SET NOT NULL;
ALTER TABLE fs_treatment ALTER COLUMN globalid SET NOT NULL;
ALTER TABLE fs_treatmentarea ALTER COLUMN globalid SET NOT NULL;
ALTER TABLE fs_zones ALTER COLUMN globalid SET NOT NULL;
ALTER TABLE fs_zones2 ALTER COLUMN globalid SET NOT NULL;
-- +goose Down
ALTER TABLE fs_containerrelate ALTER COLUMN globalid DROP NOT NULL;
ALTER TABLE fs_fieldscoutinglog ALTER COLUMN globalid DROP NOT NULL;
ALTER TABLE fs_habitatrelate ALTER COLUMN globalid DROP NOT NULL;
ALTER TABLE fs_habitatrelate ALTER COLUMN globalid DROP NOT NULL;
ALTER TABLE fs_inspectionsample ALTER COLUMN globalid DROP NOT NULL;
ALTER TABLE fs_inspectionsample ALTER COLUMN globalid DROP NOT NULL;
ALTER TABLE fs_inspectionsampledetail ALTER COLUMN globalid DROP NOT NULL;
ALTER TABLE fs_linelocation ALTER COLUMN globalid DROP NOT NULL;
ALTER TABLE fs_locationtracking ALTER COLUMN globalid DROP NOT NULL;
ALTER TABLE fs_mosquitoinspection ALTER COLUMN globalid DROP NOT NULL;
ALTER TABLE fs_mosquitoinspection ALTER COLUMN globalid DROP NOT NULL;
ALTER TABLE fs_pointlocation ALTER COLUMN geometry_y DROP NOT NULL;
ALTER TABLE fs_pointlocation ALTER COLUMN geometry_x DROP NOT NULL;
ALTER TABLE fs_pointlocation ALTER COLUMN globalid DROP NOT NULL;
ALTER TABLE fs_polygonlocation ALTER COLUMN globalid DROP NOT NULL;
ALTER TABLE fs_polygonlocation ALTER COLUMN globalid DROP NOT NULL;
ALTER TABLE fs_pool ALTER COLUMN globalid DROP NOT NULL;
ALTER TABLE fs_pooldetail ALTER COLUMN globalid DROP NOT NULL;
ALTER TABLE fs_proposedtreatmentarea ALTER COLUMN globalid DROP NOT NULL;
ALTER TABLE fs_qamosquitoinspection ALTER COLUMN globalid DROP NOT NULL;
ALTER TABLE fs_rodentlocation ALTER COLUMN globalid DROP NOT NULL;
ALTER TABLE fs_samplecollection ALTER COLUMN globalid DROP NOT NULL;
ALTER TABLE fs_samplelocation ALTER COLUMN globalid DROP NOT NULL;
ALTER TABLE fs_servicerequest ALTER COLUMN geometry_y DROP NOT NULL;
ALTER TABLE fs_servicerequest ALTER COLUMN geometry_x DROP NOT NULL;
ALTER TABLE fs_servicerequest ALTER COLUMN globalid DROP NOT NULL;
ALTER TABLE fs_speciesabundance ALTER COLUMN globalid DROP NOT NULL;
ALTER TABLE fs_stormdrain ALTER COLUMN globalid DROP NOT NULL;
ALTER TABLE fs_timecard ALTER COLUMN globalid DROP NOT NULL;
ALTER TABLE fs_trapdata ALTER COLUMN globalid DROP NOT NULL;
ALTER TABLE fs_traplocation ALTER COLUMN globalid DROP NOT NULL;
ALTER TABLE fs_treatment ALTER COLUMN globalid DROP NOT NULL;
ALTER TABLE fs_treatmentarea ALTER COLUMN globalid DROP NOT NULL;
ALTER TABLE fs_zones ALTER COLUMN globalid DROP NOT NULL;
ALTER TABLE fs_zones2 ALTER COLUMN globalid DROP NOT NULL;

View file

@ -0,0 +1,20 @@
-- +goose Up
-- CREATE EXTENSION h3;
-- CREATE EXTENSION h3_postgis CASCADE;
CREATE TYPE H3AggregationType AS ENUM (
'MosquitoSource',
'ServiceRequest');
CREATE TABLE h3_aggregation (
id SERIAL PRIMARY KEY,
cell h3index NOT NULL,
resolution INT NOT NULL,
count_ INTEGER NOT NULL,
type_ H3AggregationType NOT NULL,
organization_id INTEGER REFERENCES organization (id) NOT NULL,
UNIQUE(cell, organization_id, type_));
-- +goose Down
DROP TABLE h3_aggregation;
DROP TYPE H3AggregationType;
-- DROP EXTENSION h3;

View file

@ -60,6 +60,7 @@ type joins[Q dialect.Joinable] struct {
FSTreatmentareas joinSet[fsTreatmentareaJoins[Q]]
FSZones joinSet[fsZoneJoins[Q]]
FSZones2s joinSet[fsZones2Joins[Q]]
H3Aggregations joinSet[h3AggregationJoins[Q]]
HistoryContainerrelates joinSet[historyContainerrelateJoins[Q]]
HistoryFieldscoutinglogs joinSet[historyFieldscoutinglogJoins[Q]]
HistoryHabitatrelates joinSet[historyHabitatrelateJoins[Q]]
@ -131,6 +132,7 @@ func getJoins[Q dialect.Joinable]() joins[Q] {
FSTreatmentareas: buildJoinSet[fsTreatmentareaJoins[Q]](FSTreatmentareas.Columns, buildFSTreatmentareaJoins),
FSZones: buildJoinSet[fsZoneJoins[Q]](FSZones.Columns, buildFSZoneJoins),
FSZones2s: buildJoinSet[fsZones2Joins[Q]](FSZones2s.Columns, buildFSZones2Joins),
H3Aggregations: buildJoinSet[h3AggregationJoins[Q]](H3Aggregations.Columns, buildH3AggregationJoins),
HistoryContainerrelates: buildJoinSet[historyContainerrelateJoins[Q]](HistoryContainerrelates.Columns, buildHistoryContainerrelateJoins),
HistoryFieldscoutinglogs: buildJoinSet[historyFieldscoutinglogJoins[Q]](HistoryFieldscoutinglogs.Columns, buildHistoryFieldscoutinglogJoins),
HistoryHabitatrelates: buildJoinSet[historyHabitatrelateJoins[Q]](HistoryHabitatrelates.Columns, buildHistoryHabitatrelateJoins),

View file

@ -45,6 +45,7 @@ type preloaders struct {
FSTreatmentarea fsTreatmentareaPreloader
FSZone fsZonePreloader
FSZones2 fsZones2Preloader
H3Aggregation h3AggregationPreloader
HistoryContainerrelate historyContainerrelatePreloader
HistoryFieldscoutinglog historyFieldscoutinglogPreloader
HistoryHabitatrelate historyHabitatrelatePreloader
@ -108,6 +109,7 @@ func getPreloaders() preloaders {
FSTreatmentarea: buildFSTreatmentareaPreloader(),
FSZone: buildFSZonePreloader(),
FSZones2: buildFSZones2Preloader(),
H3Aggregation: buildH3AggregationPreloader(),
HistoryContainerrelate: buildHistoryContainerrelatePreloader(),
HistoryFieldscoutinglog: buildHistoryFieldscoutinglogPreloader(),
HistoryHabitatrelate: buildHistoryHabitatrelatePreloader(),
@ -177,6 +179,7 @@ type thenLoaders[Q orm.Loadable] struct {
FSTreatmentarea fsTreatmentareaThenLoader[Q]
FSZone fsZoneThenLoader[Q]
FSZones2 fsZones2ThenLoader[Q]
H3Aggregation h3AggregationThenLoader[Q]
HistoryContainerrelate historyContainerrelateThenLoader[Q]
HistoryFieldscoutinglog historyFieldscoutinglogThenLoader[Q]
HistoryHabitatrelate historyHabitatrelateThenLoader[Q]
@ -240,6 +243,7 @@ func getThenLoaders[Q orm.Loadable]() thenLoaders[Q] {
FSTreatmentarea: buildFSTreatmentareaThenLoader[Q](),
FSZone: buildFSZoneThenLoader[Q](),
FSZones2: buildFSZones2ThenLoader[Q](),
H3Aggregation: buildH3AggregationThenLoader[Q](),
HistoryContainerrelate: buildHistoryContainerrelateThenLoader[Q](),
HistoryFieldscoutinglog: buildHistoryFieldscoutinglogThenLoader[Q](),
HistoryHabitatrelate: buildHistoryHabitatrelateThenLoader[Q](),

View file

@ -8,6 +8,7 @@ import (
"database/sql/driver"
enums "github.com/Gleipnir-Technology/nidus-sync/enums"
"github.com/lib/pq"
"github.com/stephenafamo/bob"
)
@ -98,9 +99,18 @@ var _ bob.HookableType = &FSZone{}
// Make sure the type FSZones2 runs hooks after queries
var _ bob.HookableType = &FSZones2{}
// Make sure the type GeographyColumn runs hooks after queries
var _ bob.HookableType = &GeographyColumn{}
// Make sure the type GeometryColumn runs hooks after queries
var _ bob.HookableType = &GeometryColumn{}
// Make sure the type GooseDBVersion runs hooks after queries
var _ bob.HookableType = &GooseDBVersion{}
// Make sure the type H3Aggregation runs hooks after queries
var _ bob.HookableType = &H3Aggregation{}
// Make sure the type HistoryContainerrelate runs hooks after queries
var _ bob.HookableType = &HistoryContainerrelate{}
@ -191,18 +201,51 @@ var _ bob.HookableType = &OauthToken{}
// Make sure the type Organization runs hooks after queries
var _ bob.HookableType = &Organization{}
// Make sure the type RasterColumn runs hooks after queries
var _ bob.HookableType = &RasterColumn{}
// Make sure the type RasterOverview runs hooks after queries
var _ bob.HookableType = &RasterOverview{}
// Make sure the type Session runs hooks after queries
var _ bob.HookableType = &Session{}
// Make sure the type SpatialRefSy runs hooks after queries
var _ bob.HookableType = &SpatialRefSy{}
// Make sure the type User runs hooks after queries
var _ bob.HookableType = &User{}
// Make sure the type enums.H3aggregationtype satisfies database/sql.Scanner
var _ sql.Scanner = (*enums.H3aggregationtype)(nil)
// Make sure the type enums.H3aggregationtype satisfies database/sql/driver.Valuer
var _ driver.Valuer = *new(enums.H3aggregationtype)
// Make sure the type enums.Notificationtype satisfies database/sql.Scanner
var _ sql.Scanner = (*enums.Notificationtype)(nil)
// Make sure the type enums.Notificationtype satisfies database/sql/driver.Valuer
var _ driver.Valuer = *new(enums.Notificationtype)
// Make sure the type pq.StringArray satisfies database/sql.Scanner
var _ sql.Scanner = (*pq.StringArray)(nil)
// Make sure the type pq.StringArray satisfies database/sql/driver.Valuer
var _ driver.Valuer = *new(pq.StringArray)
// Make sure the type pq.Float64Array satisfies database/sql.Scanner
var _ sql.Scanner = (*pq.Float64Array)(nil)
// Make sure the type pq.Float64Array satisfies database/sql/driver.Valuer
var _ driver.Valuer = *new(pq.Float64Array)
// Make sure the type pq.BoolArray satisfies database/sql.Scanner
var _ sql.Scanner = (*pq.BoolArray)(nil)
// Make sure the type pq.BoolArray satisfies database/sql/driver.Valuer
var _ driver.Valuer = *new(pq.BoolArray)
// Make sure the type enums.Arcgislicensetype satisfies database/sql.Scanner
var _ sql.Scanner = (*enums.Arcgislicensetype)(nil)

View file

@ -45,7 +45,10 @@ func Where[Q psql.Filterable]() struct {
FSTreatmentareas fsTreatmentareaWhere[Q]
FSZones fsZoneWhere[Q]
FSZones2s fsZones2Where[Q]
GeographyColumns geographyColumnWhere[Q]
GeometryColumns geometryColumnWhere[Q]
GooseDBVersions gooseDBVersionWhere[Q]
H3Aggregations h3AggregationWhere[Q]
HistoryContainerrelates historyContainerrelateWhere[Q]
HistoryFieldscoutinglogs historyFieldscoutinglogWhere[Q]
HistoryHabitatrelates historyHabitatrelateWhere[Q]
@ -76,7 +79,10 @@ func Where[Q psql.Filterable]() struct {
Notifications notificationWhere[Q]
OauthTokens oauthTokenWhere[Q]
Organizations organizationWhere[Q]
RasterColumns rasterColumnWhere[Q]
RasterOverviews rasterOverviewWhere[Q]
Sessions sessionWhere[Q]
SpatialRefSys spatialRefSyWhere[Q]
Users userWhere[Q]
} {
return struct {
@ -108,7 +114,10 @@ func Where[Q psql.Filterable]() struct {
FSTreatmentareas fsTreatmentareaWhere[Q]
FSZones fsZoneWhere[Q]
FSZones2s fsZones2Where[Q]
GeographyColumns geographyColumnWhere[Q]
GeometryColumns geometryColumnWhere[Q]
GooseDBVersions gooseDBVersionWhere[Q]
H3Aggregations h3AggregationWhere[Q]
HistoryContainerrelates historyContainerrelateWhere[Q]
HistoryFieldscoutinglogs historyFieldscoutinglogWhere[Q]
HistoryHabitatrelates historyHabitatrelateWhere[Q]
@ -139,7 +148,10 @@ func Where[Q psql.Filterable]() struct {
Notifications notificationWhere[Q]
OauthTokens oauthTokenWhere[Q]
Organizations organizationWhere[Q]
RasterColumns rasterColumnWhere[Q]
RasterOverviews rasterOverviewWhere[Q]
Sessions sessionWhere[Q]
SpatialRefSys spatialRefSyWhere[Q]
Users userWhere[Q]
}{
FieldseekerSyncs: buildFieldseekerSyncWhere[Q](FieldseekerSyncs.Columns),
@ -170,7 +182,10 @@ func Where[Q psql.Filterable]() struct {
FSTreatmentareas: buildFSTreatmentareaWhere[Q](FSTreatmentareas.Columns),
FSZones: buildFSZoneWhere[Q](FSZones.Columns),
FSZones2s: buildFSZones2Where[Q](FSZones2s.Columns),
GeographyColumns: buildGeographyColumnWhere[Q](GeographyColumns.Columns),
GeometryColumns: buildGeometryColumnWhere[Q](GeometryColumns.Columns),
GooseDBVersions: buildGooseDBVersionWhere[Q](GooseDBVersions.Columns),
H3Aggregations: buildH3AggregationWhere[Q](H3Aggregations.Columns),
HistoryContainerrelates: buildHistoryContainerrelateWhere[Q](HistoryContainerrelates.Columns),
HistoryFieldscoutinglogs: buildHistoryFieldscoutinglogWhere[Q](HistoryFieldscoutinglogs.Columns),
HistoryHabitatrelates: buildHistoryHabitatrelateWhere[Q](HistoryHabitatrelates.Columns),
@ -201,7 +216,10 @@ func Where[Q psql.Filterable]() struct {
Notifications: buildNotificationWhere[Q](Notifications.Columns),
OauthTokens: buildOauthTokenWhere[Q](OauthTokens.Columns),
Organizations: buildOrganizationWhere[Q](Organizations.Columns),
RasterColumns: buildRasterColumnWhere[Q](RasterColumns.Columns),
RasterOverviews: buildRasterOverviewWhere[Q](RasterOverviews.Columns),
Sessions: buildSessionWhere[Q](Sessions.Columns),
SpatialRefSys: buildSpatialRefSyWhere[Q](SpatialRefSys.Columns),
Users: buildUserWhere[Q](Users.Columns),
}
}

View file

@ -32,7 +32,7 @@ type FSContainerrelate struct {
Creator null.Val[string] `db:"creator" `
Editdate null.Val[int64] `db:"editdate" `
Editor null.Val[string] `db:"editor" `
Globalid null.Val[string] `db:"globalid" `
Globalid string `db:"globalid" `
Inspsampleid null.Val[string] `db:"inspsampleid" `
Mosquitoinspid null.Val[string] `db:"mosquitoinspid" `
Objectid int32 `db:"objectid,pk" `
@ -131,7 +131,7 @@ type FSContainerrelateSetter struct {
Creator omitnull.Val[string] `db:"creator" `
Editdate omitnull.Val[int64] `db:"editdate" `
Editor omitnull.Val[string] `db:"editor" `
Globalid omitnull.Val[string] `db:"globalid" `
Globalid omit.Val[string] `db:"globalid" `
Inspsampleid omitnull.Val[string] `db:"inspsampleid" `
Mosquitoinspid omitnull.Val[string] `db:"mosquitoinspid" `
Objectid omit.Val[int32] `db:"objectid,pk" `
@ -165,7 +165,7 @@ func (s FSContainerrelateSetter) SetColumns() []string {
if !s.Editor.IsUnset() {
vals = append(vals, "editor")
}
if !s.Globalid.IsUnset() {
if s.Globalid.IsValue() {
vals = append(vals, "globalid")
}
if !s.Inspsampleid.IsUnset() {
@ -223,8 +223,8 @@ func (s FSContainerrelateSetter) Overwrite(t *FSContainerrelate) {
if !s.Editor.IsUnset() {
t.Editor = s.Editor.MustGetNull()
}
if !s.Globalid.IsUnset() {
t.Globalid = s.Globalid.MustGetNull()
if s.Globalid.IsValue() {
t.Globalid = s.Globalid.MustGet()
}
if !s.Inspsampleid.IsUnset() {
t.Inspsampleid = s.Inspsampleid.MustGetNull()
@ -304,8 +304,8 @@ func (s *FSContainerrelateSetter) Apply(q *dialect.InsertQuery) {
vals[5] = psql.Raw("DEFAULT")
}
if !s.Globalid.IsUnset() {
vals[6] = psql.Arg(s.Globalid.MustGetNull())
if s.Globalid.IsValue() {
vals[6] = psql.Arg(s.Globalid.MustGet())
} else {
vals[6] = psql.Raw("DEFAULT")
}
@ -429,7 +429,7 @@ func (s FSContainerrelateSetter) Expressions(prefix ...string) []bob.Expression
}})
}
if !s.Globalid.IsUnset() {
if s.Globalid.IsValue() {
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
psql.Quote(append(prefix, "globalid")...),
psql.Arg(s.Globalid),
@ -818,7 +818,7 @@ type fsContainerrelateWhere[Q psql.Filterable] struct {
Creator psql.WhereNullMod[Q, string]
Editdate psql.WhereNullMod[Q, int64]
Editor psql.WhereNullMod[Q, string]
Globalid psql.WhereNullMod[Q, string]
Globalid psql.WhereMod[Q, string]
Inspsampleid psql.WhereNullMod[Q, string]
Mosquitoinspid psql.WhereNullMod[Q, string]
Objectid psql.WhereMod[Q, int32]
@ -844,7 +844,7 @@ func buildFSContainerrelateWhere[Q psql.Filterable](cols fsContainerrelateColumn
Creator: psql.WhereNull[Q, string](cols.Creator),
Editdate: psql.WhereNull[Q, int64](cols.Editdate),
Editor: psql.WhereNull[Q, string](cols.Editor),
Globalid: psql.WhereNull[Q, string](cols.Globalid),
Globalid: psql.Where[Q, string](cols.Globalid),
Inspsampleid: psql.WhereNull[Q, string](cols.Inspsampleid),
Mosquitoinspid: psql.WhereNull[Q, string](cols.Mosquitoinspid),
Objectid: psql.Where[Q, int32](cols.Objectid),

View file

@ -31,7 +31,7 @@ type FSFieldscoutinglog struct {
Creator null.Val[string] `db:"creator" `
Editdate null.Val[int64] `db:"editdate" `
Editor null.Val[string] `db:"editor" `
Globalid null.Val[string] `db:"globalid" `
Globalid string `db:"globalid" `
Objectid int32 `db:"objectid,pk" `
Status null.Val[int16] `db:"status" `
CreatedDate null.Val[int64] `db:"created_date" `
@ -121,7 +121,7 @@ type FSFieldscoutinglogSetter struct {
Creator omitnull.Val[string] `db:"creator" `
Editdate omitnull.Val[int64] `db:"editdate" `
Editor omitnull.Val[string] `db:"editor" `
Globalid omitnull.Val[string] `db:"globalid" `
Globalid omit.Val[string] `db:"globalid" `
Objectid omit.Val[int32] `db:"objectid,pk" `
Status omitnull.Val[int16] `db:"status" `
CreatedDate omitnull.Val[int64] `db:"created_date" `
@ -150,7 +150,7 @@ func (s FSFieldscoutinglogSetter) SetColumns() []string {
if !s.Editor.IsUnset() {
vals = append(vals, "editor")
}
if !s.Globalid.IsUnset() {
if s.Globalid.IsValue() {
vals = append(vals, "globalid")
}
if s.Objectid.IsValue() {
@ -199,8 +199,8 @@ func (s FSFieldscoutinglogSetter) Overwrite(t *FSFieldscoutinglog) {
if !s.Editor.IsUnset() {
t.Editor = s.Editor.MustGetNull()
}
if !s.Globalid.IsUnset() {
t.Globalid = s.Globalid.MustGetNull()
if s.Globalid.IsValue() {
t.Globalid = s.Globalid.MustGet()
}
if s.Objectid.IsValue() {
t.Objectid = s.Objectid.MustGet()
@ -268,8 +268,8 @@ func (s *FSFieldscoutinglogSetter) Apply(q *dialect.InsertQuery) {
vals[4] = psql.Raw("DEFAULT")
}
if !s.Globalid.IsUnset() {
vals[5] = psql.Arg(s.Globalid.MustGetNull())
if s.Globalid.IsValue() {
vals[5] = psql.Arg(s.Globalid.MustGet())
} else {
vals[5] = psql.Raw("DEFAULT")
}
@ -374,7 +374,7 @@ func (s FSFieldscoutinglogSetter) Expressions(prefix ...string) []bob.Expression
}})
}
if !s.Globalid.IsUnset() {
if s.Globalid.IsValue() {
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
psql.Quote(append(prefix, "globalid")...),
psql.Arg(s.Globalid),
@ -748,7 +748,7 @@ type fsFieldscoutinglogWhere[Q psql.Filterable] struct {
Creator psql.WhereNullMod[Q, string]
Editdate psql.WhereNullMod[Q, int64]
Editor psql.WhereNullMod[Q, string]
Globalid psql.WhereNullMod[Q, string]
Globalid psql.WhereMod[Q, string]
Objectid psql.WhereMod[Q, int32]
Status psql.WhereNullMod[Q, int16]
CreatedDate psql.WhereNullMod[Q, int64]
@ -771,7 +771,7 @@ func buildFSFieldscoutinglogWhere[Q psql.Filterable](cols fsFieldscoutinglogColu
Creator: psql.WhereNull[Q, string](cols.Creator),
Editdate: psql.WhereNull[Q, int64](cols.Editdate),
Editor: psql.WhereNull[Q, string](cols.Editor),
Globalid: psql.WhereNull[Q, string](cols.Globalid),
Globalid: psql.Where[Q, string](cols.Globalid),
Objectid: psql.Where[Q, int32](cols.Objectid),
Status: psql.WhereNull[Q, int16](cols.Status),
CreatedDate: psql.WhereNull[Q, int64](cols.CreatedDate),

View file

@ -32,7 +32,7 @@ type FSHabitatrelate struct {
Editdate null.Val[int64] `db:"editdate" `
Editor null.Val[string] `db:"editor" `
ForeignID null.Val[string] `db:"foreign_id" `
Globalid null.Val[string] `db:"globalid" `
Globalid string `db:"globalid" `
Habitattype null.Val[string] `db:"habitattype" `
Objectid int32 `db:"objectid,pk" `
CreatedDate null.Val[int64] `db:"created_date" `
@ -125,7 +125,7 @@ type FSHabitatrelateSetter struct {
Editdate omitnull.Val[int64] `db:"editdate" `
Editor omitnull.Val[string] `db:"editor" `
ForeignID omitnull.Val[string] `db:"foreign_id" `
Globalid omitnull.Val[string] `db:"globalid" `
Globalid omit.Val[string] `db:"globalid" `
Habitattype omitnull.Val[string] `db:"habitattype" `
Objectid omit.Val[int32] `db:"objectid,pk" `
CreatedDate omitnull.Val[int64] `db:"created_date" `
@ -157,7 +157,7 @@ func (s FSHabitatrelateSetter) SetColumns() []string {
if !s.ForeignID.IsUnset() {
vals = append(vals, "foreign_id")
}
if !s.Globalid.IsUnset() {
if s.Globalid.IsValue() {
vals = append(vals, "globalid")
}
if !s.Habitattype.IsUnset() {
@ -209,8 +209,8 @@ func (s FSHabitatrelateSetter) Overwrite(t *FSHabitatrelate) {
if !s.ForeignID.IsUnset() {
t.ForeignID = s.ForeignID.MustGetNull()
}
if !s.Globalid.IsUnset() {
t.Globalid = s.Globalid.MustGetNull()
if s.Globalid.IsValue() {
t.Globalid = s.Globalid.MustGet()
}
if !s.Habitattype.IsUnset() {
t.Habitattype = s.Habitattype.MustGetNull()
@ -284,8 +284,8 @@ func (s *FSHabitatrelateSetter) Apply(q *dialect.InsertQuery) {
vals[5] = psql.Raw("DEFAULT")
}
if !s.Globalid.IsUnset() {
vals[6] = psql.Arg(s.Globalid.MustGetNull())
if s.Globalid.IsValue() {
vals[6] = psql.Arg(s.Globalid.MustGet())
} else {
vals[6] = psql.Raw("DEFAULT")
}
@ -397,7 +397,7 @@ func (s FSHabitatrelateSetter) Expressions(prefix ...string) []bob.Expression {
}})
}
if !s.Globalid.IsUnset() {
if s.Globalid.IsValue() {
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
psql.Quote(append(prefix, "globalid")...),
psql.Arg(s.Globalid),
@ -772,7 +772,7 @@ type fsHabitatrelateWhere[Q psql.Filterable] struct {
Editdate psql.WhereNullMod[Q, int64]
Editor psql.WhereNullMod[Q, string]
ForeignID psql.WhereNullMod[Q, string]
Globalid psql.WhereNullMod[Q, string]
Globalid psql.WhereMod[Q, string]
Habitattype psql.WhereNullMod[Q, string]
Objectid psql.WhereMod[Q, int32]
CreatedDate psql.WhereNullMod[Q, int64]
@ -796,7 +796,7 @@ func buildFSHabitatrelateWhere[Q psql.Filterable](cols fsHabitatrelateColumns) f
Editdate: psql.WhereNull[Q, int64](cols.Editdate),
Editor: psql.WhereNull[Q, string](cols.Editor),
ForeignID: psql.WhereNull[Q, string](cols.ForeignID),
Globalid: psql.WhereNull[Q, string](cols.Globalid),
Globalid: psql.Where[Q, string](cols.Globalid),
Habitattype: psql.WhereNull[Q, string](cols.Habitattype),
Objectid: psql.Where[Q, int32](cols.Objectid),
CreatedDate: psql.WhereNull[Q, int64](cols.CreatedDate),

View file

@ -31,7 +31,7 @@ type FSInspectionsample struct {
Creator null.Val[string] `db:"creator" `
Editdate null.Val[int64] `db:"editdate" `
Editor null.Val[string] `db:"editor" `
Globalid null.Val[string] `db:"globalid" `
Globalid string `db:"globalid" `
Idbytech null.Val[string] `db:"idbytech" `
InspID null.Val[string] `db:"insp_id" `
Objectid int32 `db:"objectid,pk" `
@ -130,7 +130,7 @@ type FSInspectionsampleSetter struct {
Creator omitnull.Val[string] `db:"creator" `
Editdate omitnull.Val[int64] `db:"editdate" `
Editor omitnull.Val[string] `db:"editor" `
Globalid omitnull.Val[string] `db:"globalid" `
Globalid omit.Val[string] `db:"globalid" `
Idbytech omitnull.Val[string] `db:"idbytech" `
InspID omitnull.Val[string] `db:"insp_id" `
Objectid omit.Val[int32] `db:"objectid,pk" `
@ -162,7 +162,7 @@ func (s FSInspectionsampleSetter) SetColumns() []string {
if !s.Editor.IsUnset() {
vals = append(vals, "editor")
}
if !s.Globalid.IsUnset() {
if s.Globalid.IsValue() {
vals = append(vals, "globalid")
}
if !s.Idbytech.IsUnset() {
@ -220,8 +220,8 @@ func (s FSInspectionsampleSetter) Overwrite(t *FSInspectionsample) {
if !s.Editor.IsUnset() {
t.Editor = s.Editor.MustGetNull()
}
if !s.Globalid.IsUnset() {
t.Globalid = s.Globalid.MustGetNull()
if s.Globalid.IsValue() {
t.Globalid = s.Globalid.MustGet()
}
if !s.Idbytech.IsUnset() {
t.Idbytech = s.Idbytech.MustGetNull()
@ -298,8 +298,8 @@ func (s *FSInspectionsampleSetter) Apply(q *dialect.InsertQuery) {
vals[4] = psql.Raw("DEFAULT")
}
if !s.Globalid.IsUnset() {
vals[5] = psql.Arg(s.Globalid.MustGetNull())
if s.Globalid.IsValue() {
vals[5] = psql.Arg(s.Globalid.MustGet())
} else {
vals[5] = psql.Raw("DEFAULT")
}
@ -422,7 +422,7 @@ func (s FSInspectionsampleSetter) Expressions(prefix ...string) []bob.Expression
}})
}
if !s.Globalid.IsUnset() {
if s.Globalid.IsValue() {
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
psql.Quote(append(prefix, "globalid")...),
psql.Arg(s.Globalid),
@ -817,7 +817,7 @@ type fsInspectionsampleWhere[Q psql.Filterable] struct {
Creator psql.WhereNullMod[Q, string]
Editdate psql.WhereNullMod[Q, int64]
Editor psql.WhereNullMod[Q, string]
Globalid psql.WhereNullMod[Q, string]
Globalid psql.WhereMod[Q, string]
Idbytech psql.WhereNullMod[Q, string]
InspID psql.WhereNullMod[Q, string]
Objectid psql.WhereMod[Q, int32]
@ -843,7 +843,7 @@ func buildFSInspectionsampleWhere[Q psql.Filterable](cols fsInspectionsampleColu
Creator: psql.WhereNull[Q, string](cols.Creator),
Editdate: psql.WhereNull[Q, int64](cols.Editdate),
Editor: psql.WhereNull[Q, string](cols.Editor),
Globalid: psql.WhereNull[Q, string](cols.Globalid),
Globalid: psql.Where[Q, string](cols.Globalid),
Idbytech: psql.WhereNull[Q, string](cols.Idbytech),
InspID: psql.WhereNull[Q, string](cols.InspID),
Objectid: psql.Where[Q, int32](cols.Objectid),

View file

@ -39,7 +39,7 @@ type FSInspectionsampledetail struct {
Flarvcount null.Val[int16] `db:"flarvcount" `
Flstages null.Val[string] `db:"flstages" `
Fpupcount null.Val[int16] `db:"fpupcount" `
Globalid null.Val[string] `db:"globalid" `
Globalid string `db:"globalid" `
InspsampleID null.Val[string] `db:"inspsample_id" `
Labspecies null.Val[string] `db:"labspecies" `
Ldomstage null.Val[string] `db:"ldomstage" `
@ -171,7 +171,7 @@ type FSInspectionsampledetailSetter struct {
Flarvcount omitnull.Val[int16] `db:"flarvcount" `
Flstages omitnull.Val[string] `db:"flstages" `
Fpupcount omitnull.Val[int16] `db:"fpupcount" `
Globalid omitnull.Val[string] `db:"globalid" `
Globalid omit.Val[string] `db:"globalid" `
InspsampleID omitnull.Val[string] `db:"inspsample_id" `
Labspecies omitnull.Val[string] `db:"labspecies" `
Ldomstage omitnull.Val[string] `db:"ldomstage" `
@ -230,7 +230,7 @@ func (s FSInspectionsampledetailSetter) SetColumns() []string {
if !s.Fpupcount.IsUnset() {
vals = append(vals, "fpupcount")
}
if !s.Globalid.IsUnset() {
if s.Globalid.IsValue() {
vals = append(vals, "globalid")
}
if !s.InspsampleID.IsUnset() {
@ -321,8 +321,8 @@ func (s FSInspectionsampledetailSetter) Overwrite(t *FSInspectionsampledetail) {
if !s.Fpupcount.IsUnset() {
t.Fpupcount = s.Fpupcount.MustGetNull()
}
if !s.Globalid.IsUnset() {
t.Globalid = s.Globalid.MustGetNull()
if s.Globalid.IsValue() {
t.Globalid = s.Globalid.MustGet()
}
if !s.InspsampleID.IsUnset() {
t.InspsampleID = s.InspsampleID.MustGetNull()
@ -456,8 +456,8 @@ func (s *FSInspectionsampledetailSetter) Apply(q *dialect.InsertQuery) {
vals[12] = psql.Raw("DEFAULT")
}
if !s.Globalid.IsUnset() {
vals[13] = psql.Arg(s.Globalid.MustGetNull())
if s.Globalid.IsValue() {
vals[13] = psql.Arg(s.Globalid.MustGet())
} else {
vals[13] = psql.Raw("DEFAULT")
}
@ -654,7 +654,7 @@ func (s FSInspectionsampledetailSetter) Expressions(prefix ...string) []bob.Expr
}})
}
if !s.Globalid.IsUnset() {
if s.Globalid.IsValue() {
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
psql.Quote(append(prefix, "globalid")...),
psql.Arg(s.Globalid),
@ -1078,7 +1078,7 @@ type fsInspectionsampledetailWhere[Q psql.Filterable] struct {
Flarvcount psql.WhereNullMod[Q, int16]
Flstages psql.WhereNullMod[Q, string]
Fpupcount psql.WhereNullMod[Q, int16]
Globalid psql.WhereNullMod[Q, string]
Globalid psql.WhereMod[Q, string]
InspsampleID psql.WhereNullMod[Q, string]
Labspecies psql.WhereNullMod[Q, string]
Ldomstage psql.WhereNullMod[Q, string]
@ -1115,7 +1115,7 @@ func buildFSInspectionsampledetailWhere[Q psql.Filterable](cols fsInspectionsamp
Flarvcount: psql.WhereNull[Q, int16](cols.Flarvcount),
Flstages: psql.WhereNull[Q, string](cols.Flstages),
Fpupcount: psql.WhereNull[Q, int16](cols.Fpupcount),
Globalid: psql.WhereNull[Q, string](cols.Globalid),
Globalid: psql.Where[Q, string](cols.Globalid),
InspsampleID: psql.WhereNull[Q, string](cols.InspsampleID),
Labspecies: psql.WhereNull[Q, string](cols.Labspecies),
Ldomstage: psql.WhereNull[Q, string](cols.Ldomstage),

View file

@ -37,7 +37,7 @@ type FSLinelocation struct {
Externalid null.Val[string] `db:"externalid" `
Editdate null.Val[int64] `db:"editdate" `
Editor null.Val[string] `db:"editor" `
Globalid null.Val[string] `db:"globalid" `
Globalid string `db:"globalid" `
Habitat null.Val[string] `db:"habitat" `
Hectares null.Val[float64] `db:"hectares" `
Jurisdiction null.Val[string] `db:"jurisdiction" `
@ -238,7 +238,7 @@ type FSLinelocationSetter struct {
Externalid omitnull.Val[string] `db:"externalid" `
Editdate omitnull.Val[int64] `db:"editdate" `
Editor omitnull.Val[string] `db:"editor" `
Globalid omitnull.Val[string] `db:"globalid" `
Globalid omit.Val[string] `db:"globalid" `
Habitat omitnull.Val[string] `db:"habitat" `
Hectares omitnull.Val[float64] `db:"hectares" `
Jurisdiction omitnull.Val[string] `db:"jurisdiction" `
@ -316,7 +316,7 @@ func (s FSLinelocationSetter) SetColumns() []string {
if !s.Editor.IsUnset() {
vals = append(vals, "editor")
}
if !s.Globalid.IsUnset() {
if s.Globalid.IsValue() {
vals = append(vals, "globalid")
}
if !s.Habitat.IsUnset() {
@ -476,8 +476,8 @@ func (s FSLinelocationSetter) Overwrite(t *FSLinelocation) {
if !s.Editor.IsUnset() {
t.Editor = s.Editor.MustGetNull()
}
if !s.Globalid.IsUnset() {
t.Globalid = s.Globalid.MustGetNull()
if s.Globalid.IsValue() {
t.Globalid = s.Globalid.MustGet()
}
if !s.Habitat.IsUnset() {
t.Habitat = s.Habitat.MustGetNull()
@ -674,8 +674,8 @@ func (s *FSLinelocationSetter) Apply(q *dialect.InsertQuery) {
vals[10] = psql.Raw("DEFAULT")
}
if !s.Globalid.IsUnset() {
vals[11] = psql.Arg(s.Globalid.MustGetNull())
if s.Globalid.IsValue() {
vals[11] = psql.Arg(s.Globalid.MustGet())
} else {
vals[11] = psql.Raw("DEFAULT")
}
@ -1008,7 +1008,7 @@ func (s FSLinelocationSetter) Expressions(prefix ...string) []bob.Expression {
}})
}
if !s.Globalid.IsUnset() {
if s.Globalid.IsValue() {
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
psql.Quote(append(prefix, "globalid")...),
psql.Arg(s.Globalid),
@ -1605,7 +1605,7 @@ type fsLinelocationWhere[Q psql.Filterable] struct {
Externalid psql.WhereNullMod[Q, string]
Editdate psql.WhereNullMod[Q, int64]
Editor psql.WhereNullMod[Q, string]
Globalid psql.WhereNullMod[Q, string]
Globalid psql.WhereMod[Q, string]
Habitat psql.WhereNullMod[Q, string]
Hectares psql.WhereNullMod[Q, float64]
Jurisdiction psql.WhereNullMod[Q, string]
@ -1665,7 +1665,7 @@ func buildFSLinelocationWhere[Q psql.Filterable](cols fsLinelocationColumns) fsL
Externalid: psql.WhereNull[Q, string](cols.Externalid),
Editdate: psql.WhereNull[Q, int64](cols.Editdate),
Editor: psql.WhereNull[Q, string](cols.Editor),
Globalid: psql.WhereNull[Q, string](cols.Globalid),
Globalid: psql.Where[Q, string](cols.Globalid),
Habitat: psql.WhereNull[Q, string](cols.Habitat),
Hectares: psql.WhereNull[Q, float64](cols.Hectares),
Jurisdiction: psql.WhereNull[Q, string](cols.Jurisdiction),

View file

@ -33,7 +33,7 @@ type FSLocationtracking struct {
Editdate null.Val[int64] `db:"editdate" `
Editor null.Val[string] `db:"editor" `
Fieldtech null.Val[string] `db:"fieldtech" `
Globalid null.Val[string] `db:"globalid" `
Globalid string `db:"globalid" `
Objectid int32 `db:"objectid,pk" `
CreatedDate null.Val[int64] `db:"created_date" `
CreatedUser null.Val[string] `db:"created_user" `
@ -126,7 +126,7 @@ type FSLocationtrackingSetter struct {
Editdate omitnull.Val[int64] `db:"editdate" `
Editor omitnull.Val[string] `db:"editor" `
Fieldtech omitnull.Val[string] `db:"fieldtech" `
Globalid omitnull.Val[string] `db:"globalid" `
Globalid omit.Val[string] `db:"globalid" `
Objectid omit.Val[int32] `db:"objectid,pk" `
CreatedDate omitnull.Val[int64] `db:"created_date" `
CreatedUser omitnull.Val[string] `db:"created_user" `
@ -160,7 +160,7 @@ func (s FSLocationtrackingSetter) SetColumns() []string {
if !s.Fieldtech.IsUnset() {
vals = append(vals, "fieldtech")
}
if !s.Globalid.IsUnset() {
if s.Globalid.IsValue() {
vals = append(vals, "globalid")
}
if s.Objectid.IsValue() {
@ -212,8 +212,8 @@ func (s FSLocationtrackingSetter) Overwrite(t *FSLocationtracking) {
if !s.Fieldtech.IsUnset() {
t.Fieldtech = s.Fieldtech.MustGetNull()
}
if !s.Globalid.IsUnset() {
t.Globalid = s.Globalid.MustGetNull()
if s.Globalid.IsValue() {
t.Globalid = s.Globalid.MustGet()
}
if s.Objectid.IsValue() {
t.Objectid = s.Objectid.MustGet()
@ -290,8 +290,8 @@ func (s *FSLocationtrackingSetter) Apply(q *dialect.InsertQuery) {
vals[6] = psql.Raw("DEFAULT")
}
if !s.Globalid.IsUnset() {
vals[7] = psql.Arg(s.Globalid.MustGetNull())
if s.Globalid.IsValue() {
vals[7] = psql.Arg(s.Globalid.MustGet())
} else {
vals[7] = psql.Raw("DEFAULT")
}
@ -404,7 +404,7 @@ func (s FSLocationtrackingSetter) Expressions(prefix ...string) []bob.Expression
}})
}
if !s.Globalid.IsUnset() {
if s.Globalid.IsValue() {
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
psql.Quote(append(prefix, "globalid")...),
psql.Arg(s.Globalid),
@ -773,7 +773,7 @@ type fsLocationtrackingWhere[Q psql.Filterable] struct {
Editdate psql.WhereNullMod[Q, int64]
Editor psql.WhereNullMod[Q, string]
Fieldtech psql.WhereNullMod[Q, string]
Globalid psql.WhereNullMod[Q, string]
Globalid psql.WhereMod[Q, string]
Objectid psql.WhereMod[Q, int32]
CreatedDate psql.WhereNullMod[Q, int64]
CreatedUser psql.WhereNullMod[Q, string]
@ -797,7 +797,7 @@ func buildFSLocationtrackingWhere[Q psql.Filterable](cols fsLocationtrackingColu
Editdate: psql.WhereNull[Q, int64](cols.Editdate),
Editor: psql.WhereNull[Q, string](cols.Editor),
Fieldtech: psql.WhereNull[Q, string](cols.Fieldtech),
Globalid: psql.WhereNull[Q, string](cols.Globalid),
Globalid: psql.Where[Q, string](cols.Globalid),
Objectid: psql.Where[Q, int32](cols.Objectid),
CreatedDate: psql.WhereNull[Q, int64](cols.CreatedDate),
CreatedUser: psql.WhereNull[Q, string](cols.CreatedUser),

View file

@ -46,7 +46,7 @@ type FSMosquitoinspection struct {
Editor null.Val[string] `db:"editor" `
Fieldspecies null.Val[string] `db:"fieldspecies" `
Fieldtech null.Val[string] `db:"fieldtech" `
Globalid null.Val[string] `db:"globalid" `
Globalid string `db:"globalid" `
Jurisdiction null.Val[string] `db:"jurisdiction" `
Larvaepresent null.Val[int16] `db:"larvaepresent" `
Linelocid null.Val[string] `db:"linelocid" `
@ -274,7 +274,7 @@ type FSMosquitoinspectionSetter struct {
Editor omitnull.Val[string] `db:"editor" `
Fieldspecies omitnull.Val[string] `db:"fieldspecies" `
Fieldtech omitnull.Val[string] `db:"fieldtech" `
Globalid omitnull.Val[string] `db:"globalid" `
Globalid omit.Val[string] `db:"globalid" `
Jurisdiction omitnull.Val[string] `db:"jurisdiction" `
Larvaepresent omitnull.Val[int16] `db:"larvaepresent" `
Linelocid omitnull.Val[string] `db:"linelocid" `
@ -379,7 +379,7 @@ func (s FSMosquitoinspectionSetter) SetColumns() []string {
if !s.Fieldtech.IsUnset() {
vals = append(vals, "fieldtech")
}
if !s.Globalid.IsUnset() {
if s.Globalid.IsValue() {
vals = append(vals, "globalid")
}
if !s.Jurisdiction.IsUnset() {
@ -566,8 +566,8 @@ func (s FSMosquitoinspectionSetter) Overwrite(t *FSMosquitoinspection) {
if !s.Fieldtech.IsUnset() {
t.Fieldtech = s.Fieldtech.MustGetNull()
}
if !s.Globalid.IsUnset() {
t.Globalid = s.Globalid.MustGetNull()
if s.Globalid.IsValue() {
t.Globalid = s.Globalid.MustGet()
}
if !s.Jurisdiction.IsUnset() {
t.Jurisdiction = s.Jurisdiction.MustGetNull()
@ -818,8 +818,8 @@ func (s *FSMosquitoinspectionSetter) Apply(q *dialect.InsertQuery) {
vals[19] = psql.Raw("DEFAULT")
}
if !s.Globalid.IsUnset() {
vals[20] = psql.Arg(s.Globalid.MustGetNull())
if s.Globalid.IsValue() {
vals[20] = psql.Arg(s.Globalid.MustGet())
} else {
vals[20] = psql.Raw("DEFAULT")
}
@ -1215,7 +1215,7 @@ func (s FSMosquitoinspectionSetter) Expressions(prefix ...string) []bob.Expressi
}})
}
if !s.Globalid.IsUnset() {
if s.Globalid.IsValue() {
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
psql.Quote(append(prefix, "globalid")...),
psql.Arg(s.Globalid),
@ -1821,7 +1821,7 @@ type fsMosquitoinspectionWhere[Q psql.Filterable] struct {
Editor psql.WhereNullMod[Q, string]
Fieldspecies psql.WhereNullMod[Q, string]
Fieldtech psql.WhereNullMod[Q, string]
Globalid psql.WhereNullMod[Q, string]
Globalid psql.WhereMod[Q, string]
Jurisdiction psql.WhereNullMod[Q, string]
Larvaepresent psql.WhereNullMod[Q, int16]
Linelocid psql.WhereNullMod[Q, string]
@ -1890,7 +1890,7 @@ func buildFSMosquitoinspectionWhere[Q psql.Filterable](cols fsMosquitoinspection
Editor: psql.WhereNull[Q, string](cols.Editor),
Fieldspecies: psql.WhereNull[Q, string](cols.Fieldspecies),
Fieldtech: psql.WhereNull[Q, string](cols.Fieldtech),
Globalid: psql.WhereNull[Q, string](cols.Globalid),
Globalid: psql.Where[Q, string](cols.Globalid),
Jurisdiction: psql.WhereNull[Q, string](cols.Jurisdiction),
Larvaepresent: psql.WhereNull[Q, int16](cols.Larvaepresent),
Linelocid: psql.WhereNull[Q, string](cols.Linelocid),

View file

@ -36,7 +36,7 @@ type FSPointlocation struct {
Externalid null.Val[string] `db:"externalid" `
Editdate null.Val[int64] `db:"editdate" `
Editor null.Val[string] `db:"editor" `
Globalid null.Val[string] `db:"globalid" `
Globalid string `db:"globalid" `
Habitat null.Val[string] `db:"habitat" `
Jurisdiction null.Val[string] `db:"jurisdiction" `
Larvinspectinterval null.Val[int16] `db:"larvinspectinterval" `
@ -67,8 +67,8 @@ type FSPointlocation struct {
Y null.Val[float64] `db:"y" `
Zone null.Val[string] `db:"zone" `
Zone2 null.Val[string] `db:"zone2" `
GeometryX null.Val[float64] `db:"geometry_x" `
GeometryY null.Val[float64] `db:"geometry_y" `
GeometryX float64 `db:"geometry_x" `
GeometryY float64 `db:"geometry_y" `
Assignedtech null.Val[string] `db:"assignedtech" `
DeactivateReason null.Val[string] `db:"deactivate_reason" `
Scalarpriority null.Val[int64] `db:"scalarpriority" `
@ -225,7 +225,7 @@ type FSPointlocationSetter struct {
Externalid omitnull.Val[string] `db:"externalid" `
Editdate omitnull.Val[int64] `db:"editdate" `
Editor omitnull.Val[string] `db:"editor" `
Globalid omitnull.Val[string] `db:"globalid" `
Globalid omit.Val[string] `db:"globalid" `
Habitat omitnull.Val[string] `db:"habitat" `
Jurisdiction omitnull.Val[string] `db:"jurisdiction" `
Larvinspectinterval omitnull.Val[int16] `db:"larvinspectinterval" `
@ -256,8 +256,8 @@ type FSPointlocationSetter struct {
Y omitnull.Val[float64] `db:"y" `
Zone omitnull.Val[string] `db:"zone" `
Zone2 omitnull.Val[string] `db:"zone2" `
GeometryX omitnull.Val[float64] `db:"geometry_x" `
GeometryY omitnull.Val[float64] `db:"geometry_y" `
GeometryX omit.Val[float64] `db:"geometry_x" `
GeometryY omit.Val[float64] `db:"geometry_y" `
Assignedtech omitnull.Val[string] `db:"assignedtech" `
DeactivateReason omitnull.Val[string] `db:"deactivate_reason" `
Scalarpriority omitnull.Val[int64] `db:"scalarpriority" `
@ -297,7 +297,7 @@ func (s FSPointlocationSetter) SetColumns() []string {
if !s.Editor.IsUnset() {
vals = append(vals, "editor")
}
if !s.Globalid.IsUnset() {
if s.Globalid.IsValue() {
vals = append(vals, "globalid")
}
if !s.Habitat.IsUnset() {
@ -390,10 +390,10 @@ func (s FSPointlocationSetter) SetColumns() []string {
if !s.Zone2.IsUnset() {
vals = append(vals, "zone2")
}
if !s.GeometryX.IsUnset() {
if s.GeometryX.IsValue() {
vals = append(vals, "geometry_x")
}
if !s.GeometryY.IsUnset() {
if s.GeometryY.IsValue() {
vals = append(vals, "geometry_y")
}
if !s.Assignedtech.IsUnset() {
@ -445,8 +445,8 @@ func (s FSPointlocationSetter) Overwrite(t *FSPointlocation) {
if !s.Editor.IsUnset() {
t.Editor = s.Editor.MustGetNull()
}
if !s.Globalid.IsUnset() {
t.Globalid = s.Globalid.MustGetNull()
if s.Globalid.IsValue() {
t.Globalid = s.Globalid.MustGet()
}
if !s.Habitat.IsUnset() {
t.Habitat = s.Habitat.MustGetNull()
@ -538,11 +538,11 @@ func (s FSPointlocationSetter) Overwrite(t *FSPointlocation) {
if !s.Zone2.IsUnset() {
t.Zone2 = s.Zone2.MustGetNull()
}
if !s.GeometryX.IsUnset() {
t.GeometryX = s.GeometryX.MustGetNull()
if s.GeometryX.IsValue() {
t.GeometryX = s.GeometryX.MustGet()
}
if !s.GeometryY.IsUnset() {
t.GeometryY = s.GeometryY.MustGetNull()
if s.GeometryY.IsValue() {
t.GeometryY = s.GeometryY.MustGet()
}
if !s.Assignedtech.IsUnset() {
t.Assignedtech = s.Assignedtech.MustGetNull()
@ -628,8 +628,8 @@ func (s *FSPointlocationSetter) Apply(q *dialect.InsertQuery) {
vals[9] = psql.Raw("DEFAULT")
}
if !s.Globalid.IsUnset() {
vals[10] = psql.Arg(s.Globalid.MustGetNull())
if s.Globalid.IsValue() {
vals[10] = psql.Arg(s.Globalid.MustGet())
} else {
vals[10] = psql.Raw("DEFAULT")
}
@ -814,14 +814,14 @@ func (s *FSPointlocationSetter) Apply(q *dialect.InsertQuery) {
vals[40] = psql.Raw("DEFAULT")
}
if !s.GeometryX.IsUnset() {
vals[41] = psql.Arg(s.GeometryX.MustGetNull())
if s.GeometryX.IsValue() {
vals[41] = psql.Arg(s.GeometryX.MustGet())
} else {
vals[41] = psql.Raw("DEFAULT")
}
if !s.GeometryY.IsUnset() {
vals[42] = psql.Arg(s.GeometryY.MustGetNull())
if s.GeometryY.IsValue() {
vals[42] = psql.Arg(s.GeometryY.MustGet())
} else {
vals[42] = psql.Raw("DEFAULT")
}
@ -937,7 +937,7 @@ func (s FSPointlocationSetter) Expressions(prefix ...string) []bob.Expression {
}})
}
if !s.Globalid.IsUnset() {
if s.Globalid.IsValue() {
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
psql.Quote(append(prefix, "globalid")...),
psql.Arg(s.Globalid),
@ -1154,14 +1154,14 @@ func (s FSPointlocationSetter) Expressions(prefix ...string) []bob.Expression {
}})
}
if !s.GeometryX.IsUnset() {
if s.GeometryX.IsValue() {
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
psql.Quote(append(prefix, "geometry_x")...),
psql.Arg(s.GeometryX),
}})
}
if !s.GeometryY.IsUnset() {
if s.GeometryY.IsValue() {
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
psql.Quote(append(prefix, "geometry_y")...),
psql.Arg(s.GeometryY),
@ -1512,7 +1512,7 @@ type fsPointlocationWhere[Q psql.Filterable] struct {
Externalid psql.WhereNullMod[Q, string]
Editdate psql.WhereNullMod[Q, int64]
Editor psql.WhereNullMod[Q, string]
Globalid psql.WhereNullMod[Q, string]
Globalid psql.WhereMod[Q, string]
Habitat psql.WhereNullMod[Q, string]
Jurisdiction psql.WhereNullMod[Q, string]
Larvinspectinterval psql.WhereNullMod[Q, int16]
@ -1543,8 +1543,8 @@ type fsPointlocationWhere[Q psql.Filterable] struct {
Y psql.WhereNullMod[Q, float64]
Zone psql.WhereNullMod[Q, string]
Zone2 psql.WhereNullMod[Q, string]
GeometryX psql.WhereNullMod[Q, float64]
GeometryY psql.WhereNullMod[Q, float64]
GeometryX psql.WhereMod[Q, float64]
GeometryY psql.WhereMod[Q, float64]
Assignedtech psql.WhereNullMod[Q, string]
DeactivateReason psql.WhereNullMod[Q, string]
Scalarpriority psql.WhereNullMod[Q, int64]
@ -1568,7 +1568,7 @@ func buildFSPointlocationWhere[Q psql.Filterable](cols fsPointlocationColumns) f
Externalid: psql.WhereNull[Q, string](cols.Externalid),
Editdate: psql.WhereNull[Q, int64](cols.Editdate),
Editor: psql.WhereNull[Q, string](cols.Editor),
Globalid: psql.WhereNull[Q, string](cols.Globalid),
Globalid: psql.Where[Q, string](cols.Globalid),
Habitat: psql.WhereNull[Q, string](cols.Habitat),
Jurisdiction: psql.WhereNull[Q, string](cols.Jurisdiction),
Larvinspectinterval: psql.WhereNull[Q, int16](cols.Larvinspectinterval),
@ -1599,8 +1599,8 @@ func buildFSPointlocationWhere[Q psql.Filterable](cols fsPointlocationColumns) f
Y: psql.WhereNull[Q, float64](cols.Y),
Zone: psql.WhereNull[Q, string](cols.Zone),
Zone2: psql.WhereNull[Q, string](cols.Zone2),
GeometryX: psql.WhereNull[Q, float64](cols.GeometryX),
GeometryY: psql.WhereNull[Q, float64](cols.GeometryY),
GeometryX: psql.Where[Q, float64](cols.GeometryX),
GeometryY: psql.Where[Q, float64](cols.GeometryY),
Assignedtech: psql.WhereNull[Q, string](cols.Assignedtech),
DeactivateReason: psql.WhereNull[Q, string](cols.DeactivateReason),
Scalarpriority: psql.WhereNull[Q, int64](cols.Scalarpriority),

View file

@ -38,7 +38,7 @@ type FSPolygonlocation struct {
Editdate null.Val[int64] `db:"editdate" `
Editor null.Val[string] `db:"editor" `
Filter null.Val[string] `db:"filter" `
Globalid null.Val[string] `db:"globalid" `
Globalid string `db:"globalid" `
Habitat null.Val[string] `db:"habitat" `
Hectares null.Val[float64] `db:"hectares" `
Jurisdiction null.Val[string] `db:"jurisdiction" `
@ -221,7 +221,7 @@ type FSPolygonlocationSetter struct {
Editdate omitnull.Val[int64] `db:"editdate" `
Editor omitnull.Val[string] `db:"editor" `
Filter omitnull.Val[string] `db:"filter" `
Globalid omitnull.Val[string] `db:"globalid" `
Globalid omit.Val[string] `db:"globalid" `
Habitat omitnull.Val[string] `db:"habitat" `
Hectares omitnull.Val[float64] `db:"hectares" `
Jurisdiction omitnull.Val[string] `db:"jurisdiction" `
@ -295,7 +295,7 @@ func (s FSPolygonlocationSetter) SetColumns() []string {
if !s.Filter.IsUnset() {
vals = append(vals, "filter")
}
if !s.Globalid.IsUnset() {
if s.Globalid.IsValue() {
vals = append(vals, "globalid")
}
if !s.Habitat.IsUnset() {
@ -437,8 +437,8 @@ func (s FSPolygonlocationSetter) Overwrite(t *FSPolygonlocation) {
if !s.Filter.IsUnset() {
t.Filter = s.Filter.MustGetNull()
}
if !s.Globalid.IsUnset() {
t.Globalid = s.Globalid.MustGetNull()
if s.Globalid.IsValue() {
t.Globalid = s.Globalid.MustGet()
}
if !s.Habitat.IsUnset() {
t.Habitat = s.Habitat.MustGetNull()
@ -620,8 +620,8 @@ func (s *FSPolygonlocationSetter) Apply(q *dialect.InsertQuery) {
vals[11] = psql.Raw("DEFAULT")
}
if !s.Globalid.IsUnset() {
vals[12] = psql.Arg(s.Globalid.MustGetNull())
if s.Globalid.IsValue() {
vals[12] = psql.Arg(s.Globalid.MustGet())
} else {
vals[12] = psql.Raw("DEFAULT")
}
@ -919,7 +919,7 @@ func (s FSPolygonlocationSetter) Expressions(prefix ...string) []bob.Expression
}})
}
if !s.Globalid.IsUnset() {
if s.Globalid.IsValue() {
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
psql.Quote(append(prefix, "globalid")...),
psql.Arg(s.Globalid),
@ -1468,7 +1468,7 @@ type fsPolygonlocationWhere[Q psql.Filterable] struct {
Editdate psql.WhereNullMod[Q, int64]
Editor psql.WhereNullMod[Q, string]
Filter psql.WhereNullMod[Q, string]
Globalid psql.WhereNullMod[Q, string]
Globalid psql.WhereMod[Q, string]
Habitat psql.WhereNullMod[Q, string]
Hectares psql.WhereNullMod[Q, float64]
Jurisdiction psql.WhereNullMod[Q, string]
@ -1522,7 +1522,7 @@ func buildFSPolygonlocationWhere[Q psql.Filterable](cols fsPolygonlocationColumn
Editdate: psql.WhereNull[Q, int64](cols.Editdate),
Editor: psql.WhereNull[Q, string](cols.Editor),
Filter: psql.WhereNull[Q, string](cols.Filter),
Globalid: psql.WhereNull[Q, string](cols.Globalid),
Globalid: psql.Where[Q, string](cols.Globalid),
Habitat: psql.WhereNull[Q, string](cols.Habitat),
Hectares: psql.WhereNull[Q, float64](cols.Hectares),
Jurisdiction: psql.WhereNull[Q, string](cols.Jurisdiction),

View file

@ -37,7 +37,7 @@ type FSPool struct {
Editdate null.Val[int64] `db:"editdate" `
Editor null.Val[string] `db:"editor" `
Gatewaysync null.Val[int16] `db:"gatewaysync" `
Globalid null.Val[string] `db:"globalid" `
Globalid string `db:"globalid" `
Lab null.Val[string] `db:"lab" `
LabID null.Val[string] `db:"lab_id" `
Objectid int32 `db:"objectid,pk" `
@ -178,7 +178,7 @@ type FSPoolSetter struct {
Editdate omitnull.Val[int64] `db:"editdate" `
Editor omitnull.Val[string] `db:"editor" `
Gatewaysync omitnull.Val[int16] `db:"gatewaysync" `
Globalid omitnull.Val[string] `db:"globalid" `
Globalid omit.Val[string] `db:"globalid" `
Lab omitnull.Val[string] `db:"lab" `
LabID omitnull.Val[string] `db:"lab_id" `
Objectid omit.Val[int32] `db:"objectid,pk" `
@ -236,7 +236,7 @@ func (s FSPoolSetter) SetColumns() []string {
if !s.Gatewaysync.IsUnset() {
vals = append(vals, "gatewaysync")
}
if !s.Globalid.IsUnset() {
if s.Globalid.IsValue() {
vals = append(vals, "globalid")
}
if !s.Lab.IsUnset() {
@ -336,8 +336,8 @@ func (s FSPoolSetter) Overwrite(t *FSPool) {
if !s.Gatewaysync.IsUnset() {
t.Gatewaysync = s.Gatewaysync.MustGetNull()
}
if !s.Globalid.IsUnset() {
t.Globalid = s.Globalid.MustGetNull()
if s.Globalid.IsValue() {
t.Globalid = s.Globalid.MustGet()
}
if !s.Lab.IsUnset() {
t.Lab = s.Lab.MustGetNull()
@ -474,8 +474,8 @@ func (s *FSPoolSetter) Apply(q *dialect.InsertQuery) {
vals[10] = psql.Raw("DEFAULT")
}
if !s.Globalid.IsUnset() {
vals[11] = psql.Arg(s.Globalid.MustGetNull())
if s.Globalid.IsValue() {
vals[11] = psql.Arg(s.Globalid.MustGet())
} else {
vals[11] = psql.Raw("DEFAULT")
}
@ -688,7 +688,7 @@ func (s FSPoolSetter) Expressions(prefix ...string) []bob.Expression {
}})
}
if !s.Globalid.IsUnset() {
if s.Globalid.IsValue() {
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
psql.Quote(append(prefix, "globalid")...),
psql.Arg(s.Globalid),
@ -1145,7 +1145,7 @@ type fsPoolWhere[Q psql.Filterable] struct {
Editdate psql.WhereNullMod[Q, int64]
Editor psql.WhereNullMod[Q, string]
Gatewaysync psql.WhereNullMod[Q, int16]
Globalid psql.WhereNullMod[Q, string]
Globalid psql.WhereMod[Q, string]
Lab psql.WhereNullMod[Q, string]
LabID psql.WhereNullMod[Q, string]
Objectid psql.WhereMod[Q, int32]
@ -1185,7 +1185,7 @@ func buildFSPoolWhere[Q psql.Filterable](cols fsPoolColumns) fsPoolWhere[Q] {
Editdate: psql.WhereNull[Q, int64](cols.Editdate),
Editor: psql.WhereNull[Q, string](cols.Editor),
Gatewaysync: psql.WhereNull[Q, int16](cols.Gatewaysync),
Globalid: psql.WhereNull[Q, string](cols.Globalid),
Globalid: psql.Where[Q, string](cols.Globalid),
Lab: psql.WhereNull[Q, string](cols.Lab),
LabID: psql.WhereNull[Q, string](cols.LabID),
Objectid: psql.Where[Q, int32](cols.Objectid),

View file

@ -32,7 +32,7 @@ type FSPooldetail struct {
Editdate null.Val[int64] `db:"editdate" `
Editor null.Val[string] `db:"editor" `
Females null.Val[int16] `db:"females" `
Globalid null.Val[string] `db:"globalid" `
Globalid string `db:"globalid" `
Objectid int32 `db:"objectid,pk" `
PoolID null.Val[string] `db:"pool_id" `
Species null.Val[string] `db:"species" `
@ -131,7 +131,7 @@ type FSPooldetailSetter struct {
Editdate omitnull.Val[int64] `db:"editdate" `
Editor omitnull.Val[string] `db:"editor" `
Females omitnull.Val[int16] `db:"females" `
Globalid omitnull.Val[string] `db:"globalid" `
Globalid omit.Val[string] `db:"globalid" `
Objectid omit.Val[int32] `db:"objectid,pk" `
PoolID omitnull.Val[string] `db:"pool_id" `
Species omitnull.Val[string] `db:"species" `
@ -165,7 +165,7 @@ func (s FSPooldetailSetter) SetColumns() []string {
if !s.Females.IsUnset() {
vals = append(vals, "females")
}
if !s.Globalid.IsUnset() {
if s.Globalid.IsValue() {
vals = append(vals, "globalid")
}
if s.Objectid.IsValue() {
@ -223,8 +223,8 @@ func (s FSPooldetailSetter) Overwrite(t *FSPooldetail) {
if !s.Females.IsUnset() {
t.Females = s.Females.MustGetNull()
}
if !s.Globalid.IsUnset() {
t.Globalid = s.Globalid.MustGetNull()
if s.Globalid.IsValue() {
t.Globalid = s.Globalid.MustGet()
}
if s.Objectid.IsValue() {
t.Objectid = s.Objectid.MustGet()
@ -304,8 +304,8 @@ func (s *FSPooldetailSetter) Apply(q *dialect.InsertQuery) {
vals[5] = psql.Raw("DEFAULT")
}
if !s.Globalid.IsUnset() {
vals[6] = psql.Arg(s.Globalid.MustGetNull())
if s.Globalid.IsValue() {
vals[6] = psql.Arg(s.Globalid.MustGet())
} else {
vals[6] = psql.Raw("DEFAULT")
}
@ -429,7 +429,7 @@ func (s FSPooldetailSetter) Expressions(prefix ...string) []bob.Expression {
}})
}
if !s.Globalid.IsUnset() {
if s.Globalid.IsValue() {
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
psql.Quote(append(prefix, "globalid")...),
psql.Arg(s.Globalid),
@ -818,7 +818,7 @@ type fsPooldetailWhere[Q psql.Filterable] struct {
Editdate psql.WhereNullMod[Q, int64]
Editor psql.WhereNullMod[Q, string]
Females psql.WhereNullMod[Q, int16]
Globalid psql.WhereNullMod[Q, string]
Globalid psql.WhereMod[Q, string]
Objectid psql.WhereMod[Q, int32]
PoolID psql.WhereNullMod[Q, string]
Species psql.WhereNullMod[Q, string]
@ -844,7 +844,7 @@ func buildFSPooldetailWhere[Q psql.Filterable](cols fsPooldetailColumns) fsPoold
Editdate: psql.WhereNull[Q, int64](cols.Editdate),
Editor: psql.WhereNull[Q, string](cols.Editor),
Females: psql.WhereNull[Q, int16](cols.Females),
Globalid: psql.WhereNull[Q, string](cols.Globalid),
Globalid: psql.Where[Q, string](cols.Globalid),
Objectid: psql.Where[Q, int32](cols.Objectid),
PoolID: psql.WhereNull[Q, string](cols.PoolID),
Species: psql.WhereNull[Q, string](cols.Species),

View file

@ -38,7 +38,7 @@ type FSProposedtreatmentarea struct {
Exported null.Val[int16] `db:"exported" `
Editdate null.Val[int64] `db:"editdate" `
Editor null.Val[string] `db:"editor" `
Globalid null.Val[string] `db:"globalid" `
Globalid string `db:"globalid" `
Hectares null.Val[float64] `db:"hectares" `
Issprayroute null.Val[int16] `db:"issprayroute" `
Lasttreatactivity null.Val[string] `db:"lasttreatactivity" `
@ -194,7 +194,7 @@ type FSProposedtreatmentareaSetter struct {
Exported omitnull.Val[int16] `db:"exported" `
Editdate omitnull.Val[int64] `db:"editdate" `
Editor omitnull.Val[string] `db:"editor" `
Globalid omitnull.Val[string] `db:"globalid" `
Globalid omit.Val[string] `db:"globalid" `
Hectares omitnull.Val[float64] `db:"hectares" `
Issprayroute omitnull.Val[int16] `db:"issprayroute" `
Lasttreatactivity omitnull.Val[string] `db:"lasttreatactivity" `
@ -259,7 +259,7 @@ func (s FSProposedtreatmentareaSetter) SetColumns() []string {
if !s.Editor.IsUnset() {
vals = append(vals, "editor")
}
if !s.Globalid.IsUnset() {
if s.Globalid.IsValue() {
vals = append(vals, "globalid")
}
if !s.Hectares.IsUnset() {
@ -374,8 +374,8 @@ func (s FSProposedtreatmentareaSetter) Overwrite(t *FSProposedtreatmentarea) {
if !s.Editor.IsUnset() {
t.Editor = s.Editor.MustGetNull()
}
if !s.Globalid.IsUnset() {
t.Globalid = s.Globalid.MustGetNull()
if s.Globalid.IsValue() {
t.Globalid = s.Globalid.MustGet()
}
if !s.Hectares.IsUnset() {
t.Hectares = s.Hectares.MustGetNull()
@ -530,8 +530,8 @@ func (s *FSProposedtreatmentareaSetter) Apply(q *dialect.InsertQuery) {
vals[11] = psql.Raw("DEFAULT")
}
if !s.Globalid.IsUnset() {
vals[12] = psql.Arg(s.Globalid.MustGetNull())
if s.Globalid.IsValue() {
vals[12] = psql.Arg(s.Globalid.MustGet())
} else {
vals[12] = psql.Raw("DEFAULT")
}
@ -775,7 +775,7 @@ func (s FSProposedtreatmentareaSetter) Expressions(prefix ...string) []bob.Expre
}})
}
if !s.Globalid.IsUnset() {
if s.Globalid.IsValue() {
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
psql.Quote(append(prefix, "globalid")...),
psql.Arg(s.Globalid),
@ -1261,7 +1261,7 @@ type fsProposedtreatmentareaWhere[Q psql.Filterable] struct {
Exported psql.WhereNullMod[Q, int16]
Editdate psql.WhereNullMod[Q, int64]
Editor psql.WhereNullMod[Q, string]
Globalid psql.WhereNullMod[Q, string]
Globalid psql.WhereMod[Q, string]
Hectares psql.WhereNullMod[Q, float64]
Issprayroute psql.WhereNullMod[Q, int16]
Lasttreatactivity psql.WhereNullMod[Q, string]
@ -1306,7 +1306,7 @@ func buildFSProposedtreatmentareaWhere[Q psql.Filterable](cols fsProposedtreatme
Exported: psql.WhereNull[Q, int16](cols.Exported),
Editdate: psql.WhereNull[Q, int64](cols.Editdate),
Editor: psql.WhereNull[Q, string](cols.Editor),
Globalid: psql.WhereNull[Q, string](cols.Globalid),
Globalid: psql.Where[Q, string](cols.Globalid),
Hectares: psql.WhereNull[Q, float64](cols.Hectares),
Issprayroute: psql.WhereNull[Q, int16](cols.Issprayroute),
Lasttreatactivity: psql.WhereNull[Q, string](cols.Lasttreatactivity),

View file

@ -41,7 +41,7 @@ type FSQamosquitoinspection struct {
Editor null.Val[string] `db:"editor" `
Fieldtech null.Val[string] `db:"fieldtech" `
Fish null.Val[int16] `db:"fish" `
Globalid null.Val[string] `db:"globalid" `
Globalid string `db:"globalid" `
Habvalue1 null.Val[int16] `db:"habvalue1" `
Habvalue1percent null.Val[int16] `db:"habvalue1percent" `
Habvalue2 null.Val[int16] `db:"habvalue2" `
@ -284,7 +284,7 @@ type FSQamosquitoinspectionSetter struct {
Editor omitnull.Val[string] `db:"editor" `
Fieldtech omitnull.Val[string] `db:"fieldtech" `
Fish omitnull.Val[int16] `db:"fish" `
Globalid omitnull.Val[string] `db:"globalid" `
Globalid omit.Val[string] `db:"globalid" `
Habvalue1 omitnull.Val[int16] `db:"habvalue1" `
Habvalue1percent omitnull.Val[int16] `db:"habvalue1percent" `
Habvalue2 omitnull.Val[int16] `db:"habvalue2" `
@ -384,7 +384,7 @@ func (s FSQamosquitoinspectionSetter) SetColumns() []string {
if !s.Fish.IsUnset() {
vals = append(vals, "fish")
}
if !s.Globalid.IsUnset() {
if s.Globalid.IsValue() {
vals = append(vals, "globalid")
}
if !s.Habvalue1.IsUnset() {
@ -586,8 +586,8 @@ func (s FSQamosquitoinspectionSetter) Overwrite(t *FSQamosquitoinspection) {
if !s.Fish.IsUnset() {
t.Fish = s.Fish.MustGetNull()
}
if !s.Globalid.IsUnset() {
t.Globalid = s.Globalid.MustGetNull()
if s.Globalid.IsValue() {
t.Globalid = s.Globalid.MustGet()
}
if !s.Habvalue1.IsUnset() {
t.Habvalue1 = s.Habvalue1.MustGetNull()
@ -838,8 +838,8 @@ func (s *FSQamosquitoinspectionSetter) Apply(q *dialect.InsertQuery) {
vals[14] = psql.Raw("DEFAULT")
}
if !s.Globalid.IsUnset() {
vals[15] = psql.Arg(s.Globalid.MustGetNull())
if s.Globalid.IsValue() {
vals[15] = psql.Arg(s.Globalid.MustGet())
} else {
vals[15] = psql.Raw("DEFAULT")
}
@ -1260,7 +1260,7 @@ func (s FSQamosquitoinspectionSetter) Expressions(prefix ...string) []bob.Expres
}})
}
if !s.Globalid.IsUnset() {
if s.Globalid.IsValue() {
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
psql.Quote(append(prefix, "globalid")...),
psql.Arg(s.Globalid),
@ -1931,7 +1931,7 @@ type fsQamosquitoinspectionWhere[Q psql.Filterable] struct {
Editor psql.WhereNullMod[Q, string]
Fieldtech psql.WhereNullMod[Q, string]
Fish psql.WhereNullMod[Q, int16]
Globalid psql.WhereNullMod[Q, string]
Globalid psql.WhereMod[Q, string]
Habvalue1 psql.WhereNullMod[Q, int16]
Habvalue1percent psql.WhereNullMod[Q, int16]
Habvalue2 psql.WhereNullMod[Q, int16]
@ -2005,7 +2005,7 @@ func buildFSQamosquitoinspectionWhere[Q psql.Filterable](cols fsQamosquitoinspec
Editor: psql.WhereNull[Q, string](cols.Editor),
Fieldtech: psql.WhereNull[Q, string](cols.Fieldtech),
Fish: psql.WhereNull[Q, int16](cols.Fish),
Globalid: psql.WhereNull[Q, string](cols.Globalid),
Globalid: psql.Where[Q, string](cols.Globalid),
Habvalue1: psql.WhereNull[Q, int16](cols.Habvalue1),
Habvalue1percent: psql.WhereNull[Q, int16](cols.Habvalue1percent),
Habvalue2: psql.WhereNull[Q, int16](cols.Habvalue2),

Some files were not shown because too many files have changed in this diff Show more