Add statistics on the sync and save org ID with fieldseeker tables
We need the org ID so that we can avoid bleedover between different organizations.
This commit is contained in:
parent
bf6e40d877
commit
b0432f3243
178 changed files with 9075 additions and 6223 deletions
|
|
@ -32,6 +32,7 @@ func (j joinSet[Q]) AliasedAs(alias string) joinSet[Q] {
|
|||
}
|
||||
|
||||
type joins[Q dialect.Joinable] struct {
|
||||
FieldseekerSyncs joinSet[fieldseekerSyncJoins[Q]]
|
||||
FSContainerrelates joinSet[fsContainerrelateJoins[Q]]
|
||||
FSFieldscoutinglogs joinSet[fsFieldscoutinglogJoins[Q]]
|
||||
FSHabitatrelates joinSet[fsHabitatrelateJoins[Q]]
|
||||
|
|
@ -101,6 +102,7 @@ func buildJoinSet[Q interface{ aliasedAs(string) Q }, C any, F func(C, string) Q
|
|||
|
||||
func getJoins[Q dialect.Joinable]() joins[Q] {
|
||||
return joins[Q]{
|
||||
FieldseekerSyncs: buildJoinSet[fieldseekerSyncJoins[Q]](FieldseekerSyncs.Columns, buildFieldseekerSyncJoins),
|
||||
FSContainerrelates: buildJoinSet[fsContainerrelateJoins[Q]](FSContainerrelates.Columns, buildFSContainerrelateJoins),
|
||||
FSFieldscoutinglogs: buildJoinSet[fsFieldscoutinglogJoins[Q]](FSFieldscoutinglogs.Columns, buildFSFieldscoutinglogJoins),
|
||||
FSHabitatrelates: buildJoinSet[fsHabitatrelateJoins[Q]](FSHabitatrelates.Columns, buildFSHabitatrelateJoins),
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ import (
|
|||
var Preload = getPreloaders()
|
||||
|
||||
type preloaders struct {
|
||||
FieldseekerSync fieldseekerSyncPreloader
|
||||
FSContainerrelate fsContainerrelatePreloader
|
||||
FSFieldscoutinglog fsFieldscoutinglogPreloader
|
||||
FSHabitatrelate fsHabitatrelatePreloader
|
||||
|
|
@ -78,6 +79,7 @@ type preloaders struct {
|
|||
|
||||
func getPreloaders() preloaders {
|
||||
return preloaders{
|
||||
FieldseekerSync: buildFieldseekerSyncPreloader(),
|
||||
FSContainerrelate: buildFSContainerrelatePreloader(),
|
||||
FSFieldscoutinglog: buildFSFieldscoutinglogPreloader(),
|
||||
FSHabitatrelate: buildFSHabitatrelatePreloader(),
|
||||
|
|
@ -145,6 +147,7 @@ var (
|
|||
)
|
||||
|
||||
type thenLoaders[Q orm.Loadable] struct {
|
||||
FieldseekerSync fieldseekerSyncThenLoader[Q]
|
||||
FSContainerrelate fsContainerrelateThenLoader[Q]
|
||||
FSFieldscoutinglog fsFieldscoutinglogThenLoader[Q]
|
||||
FSHabitatrelate fsHabitatrelateThenLoader[Q]
|
||||
|
|
@ -206,6 +209,7 @@ type thenLoaders[Q orm.Loadable] struct {
|
|||
|
||||
func getThenLoaders[Q orm.Loadable]() thenLoaders[Q] {
|
||||
return thenLoaders[Q]{
|
||||
FieldseekerSync: buildFieldseekerSyncThenLoader[Q](),
|
||||
FSContainerrelate: buildFSContainerrelateThenLoader[Q](),
|
||||
FSFieldscoutinglog: buildFSFieldscoutinglogThenLoader[Q](),
|
||||
FSHabitatrelate: buildFSHabitatrelateThenLoader[Q](),
|
||||
|
|
|
|||
|
|
@ -14,6 +14,9 @@ import (
|
|||
// Set the testDB to enable tests that use the database
|
||||
var testDB bob.Transactor[bob.Tx]
|
||||
|
||||
// Make sure the type FieldseekerSync runs hooks after queries
|
||||
var _ bob.HookableType = &FieldseekerSync{}
|
||||
|
||||
// Make sure the type FSContainerrelate runs hooks after queries
|
||||
var _ bob.HookableType = &FSContainerrelate{}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ var (
|
|||
)
|
||||
|
||||
func Where[Q psql.Filterable]() struct {
|
||||
FieldseekerSyncs fieldseekerSyncWhere[Q]
|
||||
FSContainerrelates fsContainerrelateWhere[Q]
|
||||
FSFieldscoutinglogs fsFieldscoutinglogWhere[Q]
|
||||
FSHabitatrelates fsHabitatrelateWhere[Q]
|
||||
|
|
@ -78,6 +79,7 @@ func Where[Q psql.Filterable]() struct {
|
|||
Users userWhere[Q]
|
||||
} {
|
||||
return struct {
|
||||
FieldseekerSyncs fieldseekerSyncWhere[Q]
|
||||
FSContainerrelates fsContainerrelateWhere[Q]
|
||||
FSFieldscoutinglogs fsFieldscoutinglogWhere[Q]
|
||||
FSHabitatrelates fsHabitatrelateWhere[Q]
|
||||
|
|
@ -138,6 +140,7 @@ func Where[Q psql.Filterable]() struct {
|
|||
Sessions sessionWhere[Q]
|
||||
Users userWhere[Q]
|
||||
}{
|
||||
FieldseekerSyncs: buildFieldseekerSyncWhere[Q](FieldseekerSyncs.Columns),
|
||||
FSContainerrelates: buildFSContainerrelateWhere[Q](FSContainerrelates.Columns),
|
||||
FSFieldscoutinglogs: buildFSFieldscoutinglogWhere[Q](FSFieldscoutinglogs.Columns),
|
||||
FSHabitatrelates: buildFSHabitatrelateWhere[Q](FSHabitatrelates.Columns),
|
||||
|
|
|
|||
703
models/fieldseeker_sync.bob.go
Normal file
703
models/fieldseeker_sync.bob.go
Normal file
|
|
@ -0,0 +1,703 @@
|
|||
// 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 models
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"time"
|
||||
|
||||
"github.com/aarondl/opt/omit"
|
||||
"github.com/stephenafamo/bob"
|
||||
"github.com/stephenafamo/bob/dialect/psql"
|
||||
"github.com/stephenafamo/bob/dialect/psql/dialect"
|
||||
"github.com/stephenafamo/bob/dialect/psql/dm"
|
||||
"github.com/stephenafamo/bob/dialect/psql/sm"
|
||||
"github.com/stephenafamo/bob/dialect/psql/um"
|
||||
"github.com/stephenafamo/bob/expr"
|
||||
"github.com/stephenafamo/bob/mods"
|
||||
"github.com/stephenafamo/bob/orm"
|
||||
"github.com/stephenafamo/bob/types/pgtypes"
|
||||
)
|
||||
|
||||
// FieldseekerSync is an object representing the database table.
|
||||
type FieldseekerSync struct {
|
||||
ID int32 `db:"id,pk" `
|
||||
Created time.Time `db:"created" `
|
||||
RecordsCreated int32 `db:"records_created" `
|
||||
RecordsUpdated int32 `db:"records_updated" `
|
||||
RecordsUnchanged int32 `db:"records_unchanged" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
|
||||
R fieldseekerSyncR `db:"-" `
|
||||
}
|
||||
|
||||
// FieldseekerSyncSlice is an alias for a slice of pointers to FieldseekerSync.
|
||||
// This should almost always be used instead of []*FieldseekerSync.
|
||||
type FieldseekerSyncSlice []*FieldseekerSync
|
||||
|
||||
// FieldseekerSyncs contains methods to work with the fieldseeker_sync table
|
||||
var FieldseekerSyncs = psql.NewTablex[*FieldseekerSync, FieldseekerSyncSlice, *FieldseekerSyncSetter]("", "fieldseeker_sync", buildFieldseekerSyncColumns("fieldseeker_sync"))
|
||||
|
||||
// FieldseekerSyncsQuery is a query on the fieldseeker_sync table
|
||||
type FieldseekerSyncsQuery = *psql.ViewQuery[*FieldseekerSync, FieldseekerSyncSlice]
|
||||
|
||||
// fieldseekerSyncR is where relationships are stored.
|
||||
type fieldseekerSyncR struct {
|
||||
Organization *Organization // fieldseeker_sync.fieldseeker_sync_organization_id_fkey
|
||||
}
|
||||
|
||||
func buildFieldseekerSyncColumns(alias string) fieldseekerSyncColumns {
|
||||
return fieldseekerSyncColumns{
|
||||
ColumnsExpr: expr.NewColumnsExpr(
|
||||
"id", "created", "records_created", "records_updated", "records_unchanged", "organization_id",
|
||||
).WithParent("fieldseeker_sync"),
|
||||
tableAlias: alias,
|
||||
ID: psql.Quote(alias, "id"),
|
||||
Created: psql.Quote(alias, "created"),
|
||||
RecordsCreated: psql.Quote(alias, "records_created"),
|
||||
RecordsUpdated: psql.Quote(alias, "records_updated"),
|
||||
RecordsUnchanged: psql.Quote(alias, "records_unchanged"),
|
||||
OrganizationID: psql.Quote(alias, "organization_id"),
|
||||
}
|
||||
}
|
||||
|
||||
type fieldseekerSyncColumns struct {
|
||||
expr.ColumnsExpr
|
||||
tableAlias string
|
||||
ID psql.Expression
|
||||
Created psql.Expression
|
||||
RecordsCreated psql.Expression
|
||||
RecordsUpdated psql.Expression
|
||||
RecordsUnchanged psql.Expression
|
||||
OrganizationID psql.Expression
|
||||
}
|
||||
|
||||
func (c fieldseekerSyncColumns) Alias() string {
|
||||
return c.tableAlias
|
||||
}
|
||||
|
||||
func (fieldseekerSyncColumns) AliasedAs(alias string) fieldseekerSyncColumns {
|
||||
return buildFieldseekerSyncColumns(alias)
|
||||
}
|
||||
|
||||
// FieldseekerSyncSetter is used for insert/upsert/update operations
|
||||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type FieldseekerSyncSetter struct {
|
||||
ID omit.Val[int32] `db:"id,pk" `
|
||||
Created omit.Val[time.Time] `db:"created" `
|
||||
RecordsCreated omit.Val[int32] `db:"records_created" `
|
||||
RecordsUpdated omit.Val[int32] `db:"records_updated" `
|
||||
RecordsUnchanged omit.Val[int32] `db:"records_unchanged" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
}
|
||||
|
||||
func (s FieldseekerSyncSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 6)
|
||||
if s.ID.IsValue() {
|
||||
vals = append(vals, "id")
|
||||
}
|
||||
if s.Created.IsValue() {
|
||||
vals = append(vals, "created")
|
||||
}
|
||||
if s.RecordsCreated.IsValue() {
|
||||
vals = append(vals, "records_created")
|
||||
}
|
||||
if s.RecordsUpdated.IsValue() {
|
||||
vals = append(vals, "records_updated")
|
||||
}
|
||||
if s.RecordsUnchanged.IsValue() {
|
||||
vals = append(vals, "records_unchanged")
|
||||
}
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
return vals
|
||||
}
|
||||
|
||||
func (s FieldseekerSyncSetter) Overwrite(t *FieldseekerSync) {
|
||||
if s.ID.IsValue() {
|
||||
t.ID = s.ID.MustGet()
|
||||
}
|
||||
if s.Created.IsValue() {
|
||||
t.Created = s.Created.MustGet()
|
||||
}
|
||||
if s.RecordsCreated.IsValue() {
|
||||
t.RecordsCreated = s.RecordsCreated.MustGet()
|
||||
}
|
||||
if s.RecordsUpdated.IsValue() {
|
||||
t.RecordsUpdated = s.RecordsUpdated.MustGet()
|
||||
}
|
||||
if s.RecordsUnchanged.IsValue() {
|
||||
t.RecordsUnchanged = s.RecordsUnchanged.MustGet()
|
||||
}
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
}
|
||||
|
||||
func (s *FieldseekerSyncSetter) Apply(q *dialect.InsertQuery) {
|
||||
q.AppendHooks(func(ctx context.Context, exec bob.Executor) (context.Context, error) {
|
||||
return FieldseekerSyncs.BeforeInsertHooks.RunHooks(ctx, exec, s)
|
||||
})
|
||||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 6)
|
||||
if s.ID.IsValue() {
|
||||
vals[0] = psql.Arg(s.ID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Created.IsValue() {
|
||||
vals[1] = psql.Arg(s.Created.MustGet())
|
||||
} else {
|
||||
vals[1] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.RecordsCreated.IsValue() {
|
||||
vals[2] = psql.Arg(s.RecordsCreated.MustGet())
|
||||
} else {
|
||||
vals[2] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.RecordsUpdated.IsValue() {
|
||||
vals[3] = psql.Arg(s.RecordsUpdated.MustGet())
|
||||
} else {
|
||||
vals[3] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.RecordsUnchanged.IsValue() {
|
||||
vals[4] = psql.Arg(s.RecordsUnchanged.MustGet())
|
||||
} else {
|
||||
vals[4] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[5] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[5] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
return bob.ExpressSlice(ctx, w, d, start, vals, "", ", ", "")
|
||||
}))
|
||||
}
|
||||
|
||||
func (s FieldseekerSyncSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery] {
|
||||
return um.Set(s.Expressions()...)
|
||||
}
|
||||
|
||||
func (s FieldseekerSyncSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 6)
|
||||
|
||||
if s.ID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "id")...),
|
||||
psql.Arg(s.ID),
|
||||
}})
|
||||
}
|
||||
|
||||
if s.Created.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created")...),
|
||||
psql.Arg(s.Created),
|
||||
}})
|
||||
}
|
||||
|
||||
if s.RecordsCreated.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "records_created")...),
|
||||
psql.Arg(s.RecordsCreated),
|
||||
}})
|
||||
}
|
||||
|
||||
if s.RecordsUpdated.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "records_updated")...),
|
||||
psql.Arg(s.RecordsUpdated),
|
||||
}})
|
||||
}
|
||||
|
||||
if s.RecordsUnchanged.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "records_unchanged")...),
|
||||
psql.Arg(s.RecordsUnchanged),
|
||||
}})
|
||||
}
|
||||
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
}})
|
||||
}
|
||||
|
||||
return exprs
|
||||
}
|
||||
|
||||
// FindFieldseekerSync retrieves a single record by primary key
|
||||
// If cols is empty Find will return all columns.
|
||||
func FindFieldseekerSync(ctx context.Context, exec bob.Executor, IDPK int32, cols ...string) (*FieldseekerSync, error) {
|
||||
if len(cols) == 0 {
|
||||
return FieldseekerSyncs.Query(
|
||||
sm.Where(FieldseekerSyncs.Columns.ID.EQ(psql.Arg(IDPK))),
|
||||
).One(ctx, exec)
|
||||
}
|
||||
|
||||
return FieldseekerSyncs.Query(
|
||||
sm.Where(FieldseekerSyncs.Columns.ID.EQ(psql.Arg(IDPK))),
|
||||
sm.Columns(FieldseekerSyncs.Columns.Only(cols...)),
|
||||
).One(ctx, exec)
|
||||
}
|
||||
|
||||
// FieldseekerSyncExists checks the presence of a single record by primary key
|
||||
func FieldseekerSyncExists(ctx context.Context, exec bob.Executor, IDPK int32) (bool, error) {
|
||||
return FieldseekerSyncs.Query(
|
||||
sm.Where(FieldseekerSyncs.Columns.ID.EQ(psql.Arg(IDPK))),
|
||||
).Exists(ctx, exec)
|
||||
}
|
||||
|
||||
// AfterQueryHook is called after FieldseekerSync is retrieved from the database
|
||||
func (o *FieldseekerSync) AfterQueryHook(ctx context.Context, exec bob.Executor, queryType bob.QueryType) error {
|
||||
var err error
|
||||
|
||||
switch queryType {
|
||||
case bob.QueryTypeSelect:
|
||||
ctx, err = FieldseekerSyncs.AfterSelectHooks.RunHooks(ctx, exec, FieldseekerSyncSlice{o})
|
||||
case bob.QueryTypeInsert:
|
||||
ctx, err = FieldseekerSyncs.AfterInsertHooks.RunHooks(ctx, exec, FieldseekerSyncSlice{o})
|
||||
case bob.QueryTypeUpdate:
|
||||
ctx, err = FieldseekerSyncs.AfterUpdateHooks.RunHooks(ctx, exec, FieldseekerSyncSlice{o})
|
||||
case bob.QueryTypeDelete:
|
||||
ctx, err = FieldseekerSyncs.AfterDeleteHooks.RunHooks(ctx, exec, FieldseekerSyncSlice{o})
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// primaryKeyVals returns the primary key values of the FieldseekerSync
|
||||
func (o *FieldseekerSync) primaryKeyVals() bob.Expression {
|
||||
return psql.Arg(o.ID)
|
||||
}
|
||||
|
||||
func (o *FieldseekerSync) pkEQ() dialect.Expression {
|
||||
return psql.Quote("fieldseeker_sync", "id").EQ(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
return o.primaryKeyVals().WriteSQL(ctx, w, d, start)
|
||||
}))
|
||||
}
|
||||
|
||||
// Update uses an executor to update the FieldseekerSync
|
||||
func (o *FieldseekerSync) Update(ctx context.Context, exec bob.Executor, s *FieldseekerSyncSetter) error {
|
||||
v, err := FieldseekerSyncs.Update(s.UpdateMod(), um.Where(o.pkEQ())).One(ctx, exec)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
o.R = v.R
|
||||
*o = *v
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Delete deletes a single FieldseekerSync record with an executor
|
||||
func (o *FieldseekerSync) Delete(ctx context.Context, exec bob.Executor) error {
|
||||
_, err := FieldseekerSyncs.Delete(dm.Where(o.pkEQ())).Exec(ctx, exec)
|
||||
return err
|
||||
}
|
||||
|
||||
// Reload refreshes the FieldseekerSync using the executor
|
||||
func (o *FieldseekerSync) Reload(ctx context.Context, exec bob.Executor) error {
|
||||
o2, err := FieldseekerSyncs.Query(
|
||||
sm.Where(FieldseekerSyncs.Columns.ID.EQ(psql.Arg(o.ID))),
|
||||
).One(ctx, exec)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
o2.R = o.R
|
||||
*o = *o2
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// AfterQueryHook is called after FieldseekerSyncSlice is retrieved from the database
|
||||
func (o FieldseekerSyncSlice) AfterQueryHook(ctx context.Context, exec bob.Executor, queryType bob.QueryType) error {
|
||||
var err error
|
||||
|
||||
switch queryType {
|
||||
case bob.QueryTypeSelect:
|
||||
ctx, err = FieldseekerSyncs.AfterSelectHooks.RunHooks(ctx, exec, o)
|
||||
case bob.QueryTypeInsert:
|
||||
ctx, err = FieldseekerSyncs.AfterInsertHooks.RunHooks(ctx, exec, o)
|
||||
case bob.QueryTypeUpdate:
|
||||
ctx, err = FieldseekerSyncs.AfterUpdateHooks.RunHooks(ctx, exec, o)
|
||||
case bob.QueryTypeDelete:
|
||||
ctx, err = FieldseekerSyncs.AfterDeleteHooks.RunHooks(ctx, exec, o)
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
func (o FieldseekerSyncSlice) pkIN() dialect.Expression {
|
||||
if len(o) == 0 {
|
||||
return psql.Raw("NULL")
|
||||
}
|
||||
|
||||
return psql.Quote("fieldseeker_sync", "id").In(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
pkPairs := make([]bob.Expression, len(o))
|
||||
for i, row := range o {
|
||||
pkPairs[i] = row.primaryKeyVals()
|
||||
}
|
||||
return bob.ExpressSlice(ctx, w, d, start, pkPairs, "", ", ", "")
|
||||
}))
|
||||
}
|
||||
|
||||
// copyMatchingRows finds models in the given slice that have the same primary key
|
||||
// then it first copies the existing relationships from the old model to the new model
|
||||
// and then replaces the old model in the slice with the new model
|
||||
func (o FieldseekerSyncSlice) copyMatchingRows(from ...*FieldseekerSync) {
|
||||
for i, old := range o {
|
||||
for _, new := range from {
|
||||
if new.ID != old.ID {
|
||||
continue
|
||||
}
|
||||
new.R = old.R
|
||||
o[i] = new
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// UpdateMod modifies an update query with "WHERE primary_key IN (o...)"
|
||||
func (o FieldseekerSyncSlice) UpdateMod() bob.Mod[*dialect.UpdateQuery] {
|
||||
return bob.ModFunc[*dialect.UpdateQuery](func(q *dialect.UpdateQuery) {
|
||||
q.AppendHooks(func(ctx context.Context, exec bob.Executor) (context.Context, error) {
|
||||
return FieldseekerSyncs.BeforeUpdateHooks.RunHooks(ctx, exec, o)
|
||||
})
|
||||
|
||||
q.AppendLoader(bob.LoaderFunc(func(ctx context.Context, exec bob.Executor, retrieved any) error {
|
||||
var err error
|
||||
switch retrieved := retrieved.(type) {
|
||||
case *FieldseekerSync:
|
||||
o.copyMatchingRows(retrieved)
|
||||
case []*FieldseekerSync:
|
||||
o.copyMatchingRows(retrieved...)
|
||||
case FieldseekerSyncSlice:
|
||||
o.copyMatchingRows(retrieved...)
|
||||
default:
|
||||
// If the retrieved value is not a FieldseekerSync or a slice of FieldseekerSync
|
||||
// then run the AfterUpdateHooks on the slice
|
||||
_, err = FieldseekerSyncs.AfterUpdateHooks.RunHooks(ctx, exec, o)
|
||||
}
|
||||
|
||||
return err
|
||||
}))
|
||||
|
||||
q.AppendWhere(o.pkIN())
|
||||
})
|
||||
}
|
||||
|
||||
// DeleteMod modifies an delete query with "WHERE primary_key IN (o...)"
|
||||
func (o FieldseekerSyncSlice) DeleteMod() bob.Mod[*dialect.DeleteQuery] {
|
||||
return bob.ModFunc[*dialect.DeleteQuery](func(q *dialect.DeleteQuery) {
|
||||
q.AppendHooks(func(ctx context.Context, exec bob.Executor) (context.Context, error) {
|
||||
return FieldseekerSyncs.BeforeDeleteHooks.RunHooks(ctx, exec, o)
|
||||
})
|
||||
|
||||
q.AppendLoader(bob.LoaderFunc(func(ctx context.Context, exec bob.Executor, retrieved any) error {
|
||||
var err error
|
||||
switch retrieved := retrieved.(type) {
|
||||
case *FieldseekerSync:
|
||||
o.copyMatchingRows(retrieved)
|
||||
case []*FieldseekerSync:
|
||||
o.copyMatchingRows(retrieved...)
|
||||
case FieldseekerSyncSlice:
|
||||
o.copyMatchingRows(retrieved...)
|
||||
default:
|
||||
// If the retrieved value is not a FieldseekerSync or a slice of FieldseekerSync
|
||||
// then run the AfterDeleteHooks on the slice
|
||||
_, err = FieldseekerSyncs.AfterDeleteHooks.RunHooks(ctx, exec, o)
|
||||
}
|
||||
|
||||
return err
|
||||
}))
|
||||
|
||||
q.AppendWhere(o.pkIN())
|
||||
})
|
||||
}
|
||||
|
||||
func (o FieldseekerSyncSlice) UpdateAll(ctx context.Context, exec bob.Executor, vals FieldseekerSyncSetter) error {
|
||||
if len(o) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
_, err := FieldseekerSyncs.Update(vals.UpdateMod(), o.UpdateMod()).All(ctx, exec)
|
||||
return err
|
||||
}
|
||||
|
||||
func (o FieldseekerSyncSlice) DeleteAll(ctx context.Context, exec bob.Executor) error {
|
||||
if len(o) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
_, err := FieldseekerSyncs.Delete(o.DeleteMod()).Exec(ctx, exec)
|
||||
return err
|
||||
}
|
||||
|
||||
func (o FieldseekerSyncSlice) ReloadAll(ctx context.Context, exec bob.Executor) error {
|
||||
if len(o) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
o2, err := FieldseekerSyncs.Query(sm.Where(o.pkIN())).All(ctx, exec)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
o.copyMatchingRows(o2...)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Organization starts a query for related objects on organization
|
||||
func (o *FieldseekerSync) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
return Organizations.Query(append(mods,
|
||||
sm.Where(Organizations.Columns.ID.EQ(psql.Arg(o.OrganizationID))),
|
||||
)...)
|
||||
}
|
||||
|
||||
func (os FieldseekerSyncSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
}
|
||||
pkOrganizationID = append(pkOrganizationID, o.OrganizationID)
|
||||
}
|
||||
PKArgExpr := psql.Select(sm.Columns(
|
||||
psql.F("unnest", psql.Cast(psql.Arg(pkOrganizationID), "integer[]")),
|
||||
))
|
||||
|
||||
return Organizations.Query(append(mods,
|
||||
sm.Where(psql.Group(Organizations.Columns.ID).OP("IN", PKArgExpr)),
|
||||
)...)
|
||||
}
|
||||
|
||||
func attachFieldseekerSyncOrganization0(ctx context.Context, exec bob.Executor, count int, fieldseekerSync0 *FieldseekerSync, organization1 *Organization) (*FieldseekerSync, error) {
|
||||
setter := &FieldseekerSyncSetter{
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := fieldseekerSync0.Update(ctx, exec, setter)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("attachFieldseekerSyncOrganization0: %w", err)
|
||||
}
|
||||
|
||||
return fieldseekerSync0, nil
|
||||
}
|
||||
|
||||
func (fieldseekerSync0 *FieldseekerSync) InsertOrganization(ctx context.Context, exec bob.Executor, related *OrganizationSetter) error {
|
||||
var err error
|
||||
|
||||
organization1, err := Organizations.Insert(related).One(ctx, exec)
|
||||
if err != nil {
|
||||
return fmt.Errorf("inserting related objects: %w", err)
|
||||
}
|
||||
|
||||
_, err = attachFieldseekerSyncOrganization0(ctx, exec, 1, fieldseekerSync0, organization1)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
fieldseekerSync0.R.Organization = organization1
|
||||
|
||||
organization1.R.FieldseekerSyncs = append(organization1.R.FieldseekerSyncs, fieldseekerSync0)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (fieldseekerSync0 *FieldseekerSync) AttachOrganization(ctx context.Context, exec bob.Executor, organization1 *Organization) error {
|
||||
var err error
|
||||
|
||||
_, err = attachFieldseekerSyncOrganization0(ctx, exec, 1, fieldseekerSync0, organization1)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
fieldseekerSync0.R.Organization = organization1
|
||||
|
||||
organization1.R.FieldseekerSyncs = append(organization1.R.FieldseekerSyncs, fieldseekerSync0)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
type fieldseekerSyncWhere[Q psql.Filterable] struct {
|
||||
ID psql.WhereMod[Q, int32]
|
||||
Created psql.WhereMod[Q, time.Time]
|
||||
RecordsCreated psql.WhereMod[Q, int32]
|
||||
RecordsUpdated psql.WhereMod[Q, int32]
|
||||
RecordsUnchanged psql.WhereMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
}
|
||||
|
||||
func (fieldseekerSyncWhere[Q]) AliasedAs(alias string) fieldseekerSyncWhere[Q] {
|
||||
return buildFieldseekerSyncWhere[Q](buildFieldseekerSyncColumns(alias))
|
||||
}
|
||||
|
||||
func buildFieldseekerSyncWhere[Q psql.Filterable](cols fieldseekerSyncColumns) fieldseekerSyncWhere[Q] {
|
||||
return fieldseekerSyncWhere[Q]{
|
||||
ID: psql.Where[Q, int32](cols.ID),
|
||||
Created: psql.Where[Q, time.Time](cols.Created),
|
||||
RecordsCreated: psql.Where[Q, int32](cols.RecordsCreated),
|
||||
RecordsUpdated: psql.Where[Q, int32](cols.RecordsUpdated),
|
||||
RecordsUnchanged: psql.Where[Q, int32](cols.RecordsUnchanged),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
}
|
||||
}
|
||||
|
||||
func (o *FieldseekerSync) Preload(name string, retrieved any) error {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
switch name {
|
||||
case "Organization":
|
||||
rel, ok := retrieved.(*Organization)
|
||||
if !ok {
|
||||
return fmt.Errorf("fieldseekerSync cannot load %T as %q", retrieved, name)
|
||||
}
|
||||
|
||||
o.R.Organization = rel
|
||||
|
||||
if rel != nil {
|
||||
rel.R.FieldseekerSyncs = FieldseekerSyncSlice{o}
|
||||
}
|
||||
return nil
|
||||
default:
|
||||
return fmt.Errorf("fieldseekerSync has no relationship %q", name)
|
||||
}
|
||||
}
|
||||
|
||||
type fieldseekerSyncPreloader struct {
|
||||
Organization func(...psql.PreloadOption) psql.Preloader
|
||||
}
|
||||
|
||||
func buildFieldseekerSyncPreloader() fieldseekerSyncPreloader {
|
||||
return fieldseekerSyncPreloader{
|
||||
Organization: func(opts ...psql.PreloadOption) psql.Preloader {
|
||||
return psql.Preload[*Organization, OrganizationSlice](psql.PreloadRel{
|
||||
Name: "Organization",
|
||||
Sides: []psql.PreloadSide{
|
||||
{
|
||||
From: FieldseekerSyncs,
|
||||
To: Organizations,
|
||||
FromColumns: []string{"organization_id"},
|
||||
ToColumns: []string{"id"},
|
||||
},
|
||||
},
|
||||
}, Organizations.Columns.Names(), opts...)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
type fieldseekerSyncThenLoader[Q orm.Loadable] struct {
|
||||
Organization func(...bob.Mod[*dialect.SelectQuery]) orm.Loader[Q]
|
||||
}
|
||||
|
||||
func buildFieldseekerSyncThenLoader[Q orm.Loadable]() fieldseekerSyncThenLoader[Q] {
|
||||
type OrganizationLoadInterface interface {
|
||||
LoadOrganization(context.Context, bob.Executor, ...bob.Mod[*dialect.SelectQuery]) error
|
||||
}
|
||||
|
||||
return fieldseekerSyncThenLoader[Q]{
|
||||
Organization: thenLoadBuilder[Q](
|
||||
"Organization",
|
||||
func(ctx context.Context, exec bob.Executor, retrieved OrganizationLoadInterface, mods ...bob.Mod[*dialect.SelectQuery]) error {
|
||||
return retrieved.LoadOrganization(ctx, exec, mods...)
|
||||
},
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
// LoadOrganization loads the fieldseekerSync's Organization into the .R struct
|
||||
func (o *FieldseekerSync) LoadOrganization(ctx context.Context, exec bob.Executor, mods ...bob.Mod[*dialect.SelectQuery]) error {
|
||||
if o == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Reset the relationship
|
||||
o.R.Organization = nil
|
||||
|
||||
related, err := o.Organization(mods...).One(ctx, exec)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
related.R.FieldseekerSyncs = FieldseekerSyncSlice{o}
|
||||
|
||||
o.R.Organization = related
|
||||
return nil
|
||||
}
|
||||
|
||||
// LoadOrganization loads the fieldseekerSync's Organization into the .R struct
|
||||
func (os FieldseekerSyncSlice) LoadOrganization(ctx context.Context, exec bob.Executor, mods ...bob.Mod[*dialect.SelectQuery]) error {
|
||||
if len(os) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
organizations, err := os.Organization(mods...).All(ctx, exec)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
rel.R.FieldseekerSyncs = append(rel.R.FieldseekerSyncs, o)
|
||||
|
||||
o.R.Organization = rel
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
type fieldseekerSyncJoins[Q dialect.Joinable] struct {
|
||||
typ string
|
||||
Organization modAs[Q, organizationColumns]
|
||||
}
|
||||
|
||||
func (j fieldseekerSyncJoins[Q]) aliasedAs(alias string) fieldseekerSyncJoins[Q] {
|
||||
return buildFieldseekerSyncJoins[Q](buildFieldseekerSyncColumns(alias), j.typ)
|
||||
}
|
||||
|
||||
func buildFieldseekerSyncJoins[Q dialect.Joinable](cols fieldseekerSyncColumns, typ string) fieldseekerSyncJoins[Q] {
|
||||
return fieldseekerSyncJoins[Q]{
|
||||
typ: typ,
|
||||
Organization: modAs[Q, organizationColumns]{
|
||||
c: Organizations.Columns,
|
||||
f: func(to organizationColumns) bob.Mod[Q] {
|
||||
mods := make(mods.QueryMods[Q], 0, 1)
|
||||
|
||||
{
|
||||
mods = append(mods, dialect.Join[Q](typ, Organizations.Name().As(to.Alias())).On(
|
||||
to.ID.EQ(cols.OrganizationID),
|
||||
))
|
||||
}
|
||||
|
||||
return mods
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
@ -26,7 +26,7 @@ import (
|
|||
|
||||
// FSContainerrelate is an object representing the database table.
|
||||
type FSContainerrelate struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Containertype null.Val[string] `db:"containertype" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
|
|
@ -125,7 +125,7 @@ func (fsContainerrelateColumns) AliasedAs(alias string) fsContainerrelateColumns
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type FSContainerrelateSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Containertype omitnull.Val[string] `db:"containertype" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
|
|
@ -147,7 +147,7 @@ type FSContainerrelateSetter struct {
|
|||
|
||||
func (s FSContainerrelateSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 18)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Containertype.IsUnset() {
|
||||
|
|
@ -205,8 +205,8 @@ func (s FSContainerrelateSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s FSContainerrelateSetter) Overwrite(t *FSContainerrelate) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Containertype.IsUnset() {
|
||||
t.Containertype = s.Containertype.MustGetNull()
|
||||
|
|
@ -268,8 +268,8 @@ func (s *FSContainerrelateSetter) Apply(q *dialect.InsertQuery) {
|
|||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 18)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -387,7 +387,7 @@ func (s FSContainerrelateSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery] {
|
|||
func (s FSContainerrelateSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 18)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -747,7 +747,7 @@ func (o *FSContainerrelate) Organization(mods ...bob.Mod[*dialect.SelectQuery])
|
|||
}
|
||||
|
||||
func (os FSContainerrelateSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -765,7 +765,7 @@ func (os FSContainerrelateSlice) Organization(mods ...bob.Mod[*dialect.SelectQue
|
|||
|
||||
func attachFSContainerrelateOrganization0(ctx context.Context, exec bob.Executor, count int, fsContainerrelate0 *FSContainerrelate, organization1 *Organization) (*FSContainerrelate, error) {
|
||||
setter := &FSContainerrelateSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := fsContainerrelate0.Update(ctx, exec, setter)
|
||||
|
|
@ -812,7 +812,7 @@ func (fsContainerrelate0 *FSContainerrelate) AttachOrganization(ctx context.Cont
|
|||
}
|
||||
|
||||
type fsContainerrelateWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Containertype psql.WhereNullMod[Q, string]
|
||||
Creationdate psql.WhereNullMod[Q, int64]
|
||||
Creator psql.WhereNullMod[Q, string]
|
||||
|
|
@ -838,7 +838,7 @@ func (fsContainerrelateWhere[Q]) AliasedAs(alias string) fsContainerrelateWhere[
|
|||
|
||||
func buildFSContainerrelateWhere[Q psql.Filterable](cols fsContainerrelateColumns) fsContainerrelateWhere[Q] {
|
||||
return fsContainerrelateWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Containertype: psql.WhereNull[Q, string](cols.Containertype),
|
||||
Creationdate: psql.WhereNull[Q, int64](cols.Creationdate),
|
||||
Creator: psql.WhereNull[Q, string](cols.Creator),
|
||||
|
|
@ -960,11 +960,8 @@ func (os FSContainerrelateSlice) LoadOrganization(ctx context.Context, exec bob.
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import (
|
|||
|
||||
// FSFieldscoutinglog is an object representing the database table.
|
||||
type FSFieldscoutinglog struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
|
|
@ -116,7 +116,7 @@ func (fsFieldscoutinglogColumns) AliasedAs(alias string) fsFieldscoutinglogColum
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type FSFieldscoutinglogSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
|
|
@ -135,7 +135,7 @@ type FSFieldscoutinglogSetter struct {
|
|||
|
||||
func (s FSFieldscoutinglogSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 15)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Creationdate.IsUnset() {
|
||||
|
|
@ -184,8 +184,8 @@ func (s FSFieldscoutinglogSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s FSFieldscoutinglogSetter) Overwrite(t *FSFieldscoutinglog) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Creationdate.IsUnset() {
|
||||
t.Creationdate = s.Creationdate.MustGetNull()
|
||||
|
|
@ -238,8 +238,8 @@ func (s *FSFieldscoutinglogSetter) Apply(q *dialect.InsertQuery) {
|
|||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 15)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -339,7 +339,7 @@ func (s FSFieldscoutinglogSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery] {
|
|||
func (s FSFieldscoutinglogSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 15)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -678,7 +678,7 @@ func (o *FSFieldscoutinglog) Organization(mods ...bob.Mod[*dialect.SelectQuery])
|
|||
}
|
||||
|
||||
func (os FSFieldscoutinglogSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -696,7 +696,7 @@ func (os FSFieldscoutinglogSlice) Organization(mods ...bob.Mod[*dialect.SelectQu
|
|||
|
||||
func attachFSFieldscoutinglogOrganization0(ctx context.Context, exec bob.Executor, count int, fsFieldscoutinglog0 *FSFieldscoutinglog, organization1 *Organization) (*FSFieldscoutinglog, error) {
|
||||
setter := &FSFieldscoutinglogSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := fsFieldscoutinglog0.Update(ctx, exec, setter)
|
||||
|
|
@ -743,7 +743,7 @@ func (fsFieldscoutinglog0 *FSFieldscoutinglog) AttachOrganization(ctx context.Co
|
|||
}
|
||||
|
||||
type fsFieldscoutinglogWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Creationdate psql.WhereNullMod[Q, int64]
|
||||
Creator psql.WhereNullMod[Q, string]
|
||||
Editdate psql.WhereNullMod[Q, int64]
|
||||
|
|
@ -766,7 +766,7 @@ func (fsFieldscoutinglogWhere[Q]) AliasedAs(alias string) fsFieldscoutinglogWher
|
|||
|
||||
func buildFSFieldscoutinglogWhere[Q psql.Filterable](cols fsFieldscoutinglogColumns) fsFieldscoutinglogWhere[Q] {
|
||||
return fsFieldscoutinglogWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Creationdate: psql.WhereNull[Q, int64](cols.Creationdate),
|
||||
Creator: psql.WhereNull[Q, string](cols.Creator),
|
||||
Editdate: psql.WhereNull[Q, int64](cols.Editdate),
|
||||
|
|
@ -885,11 +885,8 @@ func (os FSFieldscoutinglogSlice) LoadOrganization(ctx context.Context, exec bob
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import (
|
|||
|
||||
// FSHabitatrelate is an object representing the database table.
|
||||
type FSHabitatrelate struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
|
|
@ -119,7 +119,7 @@ func (fsHabitatrelateColumns) AliasedAs(alias string) fsHabitatrelateColumns {
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type FSHabitatrelateSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
|
|
@ -139,7 +139,7 @@ type FSHabitatrelateSetter struct {
|
|||
|
||||
func (s FSHabitatrelateSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 16)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Creationdate.IsUnset() {
|
||||
|
|
@ -191,8 +191,8 @@ func (s FSHabitatrelateSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s FSHabitatrelateSetter) Overwrite(t *FSHabitatrelate) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Creationdate.IsUnset() {
|
||||
t.Creationdate = s.Creationdate.MustGetNull()
|
||||
|
|
@ -248,8 +248,8 @@ func (s *FSHabitatrelateSetter) Apply(q *dialect.InsertQuery) {
|
|||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 16)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -355,7 +355,7 @@ func (s FSHabitatrelateSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery] {
|
|||
func (s FSHabitatrelateSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 16)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -701,7 +701,7 @@ func (o *FSHabitatrelate) Organization(mods ...bob.Mod[*dialect.SelectQuery]) Or
|
|||
}
|
||||
|
||||
func (os FSHabitatrelateSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -719,7 +719,7 @@ func (os FSHabitatrelateSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery
|
|||
|
||||
func attachFSHabitatrelateOrganization0(ctx context.Context, exec bob.Executor, count int, fsHabitatrelate0 *FSHabitatrelate, organization1 *Organization) (*FSHabitatrelate, error) {
|
||||
setter := &FSHabitatrelateSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := fsHabitatrelate0.Update(ctx, exec, setter)
|
||||
|
|
@ -766,7 +766,7 @@ func (fsHabitatrelate0 *FSHabitatrelate) AttachOrganization(ctx context.Context,
|
|||
}
|
||||
|
||||
type fsHabitatrelateWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Creationdate psql.WhereNullMod[Q, int64]
|
||||
Creator psql.WhereNullMod[Q, string]
|
||||
Editdate psql.WhereNullMod[Q, int64]
|
||||
|
|
@ -790,7 +790,7 @@ func (fsHabitatrelateWhere[Q]) AliasedAs(alias string) fsHabitatrelateWhere[Q] {
|
|||
|
||||
func buildFSHabitatrelateWhere[Q psql.Filterable](cols fsHabitatrelateColumns) fsHabitatrelateWhere[Q] {
|
||||
return fsHabitatrelateWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Creationdate: psql.WhereNull[Q, int64](cols.Creationdate),
|
||||
Creator: psql.WhereNull[Q, string](cols.Creator),
|
||||
Editdate: psql.WhereNull[Q, int64](cols.Editdate),
|
||||
|
|
@ -910,11 +910,8 @@ func (os FSHabitatrelateSlice) LoadOrganization(ctx context.Context, exec bob.Ex
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import (
|
|||
|
||||
// FSInspectionsample is an object representing the database table.
|
||||
type FSInspectionsample struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
|
|
@ -125,7 +125,7 @@ func (fsInspectionsampleColumns) AliasedAs(alias string) fsInspectionsampleColum
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type FSInspectionsampleSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
|
|
@ -147,7 +147,7 @@ type FSInspectionsampleSetter struct {
|
|||
|
||||
func (s FSInspectionsampleSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 18)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Creationdate.IsUnset() {
|
||||
|
|
@ -205,8 +205,8 @@ func (s FSInspectionsampleSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s FSInspectionsampleSetter) Overwrite(t *FSInspectionsample) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Creationdate.IsUnset() {
|
||||
t.Creationdate = s.Creationdate.MustGetNull()
|
||||
|
|
@ -268,8 +268,8 @@ func (s *FSInspectionsampleSetter) Apply(q *dialect.InsertQuery) {
|
|||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 18)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -387,7 +387,7 @@ func (s FSInspectionsampleSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery] {
|
|||
func (s FSInspectionsampleSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 18)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -747,7 +747,7 @@ func (o *FSInspectionsample) Organization(mods ...bob.Mod[*dialect.SelectQuery])
|
|||
}
|
||||
|
||||
func (os FSInspectionsampleSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -765,7 +765,7 @@ func (os FSInspectionsampleSlice) Organization(mods ...bob.Mod[*dialect.SelectQu
|
|||
|
||||
func attachFSInspectionsampleOrganization0(ctx context.Context, exec bob.Executor, count int, fsInspectionsample0 *FSInspectionsample, organization1 *Organization) (*FSInspectionsample, error) {
|
||||
setter := &FSInspectionsampleSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := fsInspectionsample0.Update(ctx, exec, setter)
|
||||
|
|
@ -812,7 +812,7 @@ func (fsInspectionsample0 *FSInspectionsample) AttachOrganization(ctx context.Co
|
|||
}
|
||||
|
||||
type fsInspectionsampleWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Creationdate psql.WhereNullMod[Q, int64]
|
||||
Creator psql.WhereNullMod[Q, string]
|
||||
Editdate psql.WhereNullMod[Q, int64]
|
||||
|
|
@ -838,7 +838,7 @@ func (fsInspectionsampleWhere[Q]) AliasedAs(alias string) fsInspectionsampleWher
|
|||
|
||||
func buildFSInspectionsampleWhere[Q psql.Filterable](cols fsInspectionsampleColumns) fsInspectionsampleWhere[Q] {
|
||||
return fsInspectionsampleWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Creationdate: psql.WhereNull[Q, int64](cols.Creationdate),
|
||||
Creator: psql.WhereNull[Q, string](cols.Creator),
|
||||
Editdate: psql.WhereNull[Q, int64](cols.Editdate),
|
||||
|
|
@ -960,11 +960,8 @@ func (os FSInspectionsampleSlice) LoadOrganization(ctx context.Context, exec bob
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import (
|
|||
|
||||
// FSInspectionsampledetail is an object representing the database table.
|
||||
type FSInspectionsampledetail struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Comments null.Val[string] `db:"comments" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
|
|
@ -158,7 +158,7 @@ func (fsInspectionsampledetailColumns) AliasedAs(alias string) fsInspectionsampl
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type FSInspectionsampledetailSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Comments omitnull.Val[string] `db:"comments" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
|
|
@ -191,7 +191,7 @@ type FSInspectionsampledetailSetter struct {
|
|||
|
||||
func (s FSInspectionsampledetailSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 29)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Comments.IsUnset() {
|
||||
|
|
@ -282,8 +282,8 @@ func (s FSInspectionsampledetailSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s FSInspectionsampledetailSetter) Overwrite(t *FSInspectionsampledetail) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Comments.IsUnset() {
|
||||
t.Comments = s.Comments.MustGetNull()
|
||||
|
|
@ -378,8 +378,8 @@ func (s *FSInspectionsampledetailSetter) Apply(q *dialect.InsertQuery) {
|
|||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 29)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -563,7 +563,7 @@ func (s FSInspectionsampledetailSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery
|
|||
func (s FSInspectionsampledetailSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 29)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -1000,7 +1000,7 @@ func (o *FSInspectionsampledetail) Organization(mods ...bob.Mod[*dialect.SelectQ
|
|||
}
|
||||
|
||||
func (os FSInspectionsampledetailSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -1018,7 +1018,7 @@ func (os FSInspectionsampledetailSlice) Organization(mods ...bob.Mod[*dialect.Se
|
|||
|
||||
func attachFSInspectionsampledetailOrganization0(ctx context.Context, exec bob.Executor, count int, fsInspectionsampledetail0 *FSInspectionsampledetail, organization1 *Organization) (*FSInspectionsampledetail, error) {
|
||||
setter := &FSInspectionsampledetailSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := fsInspectionsampledetail0.Update(ctx, exec, setter)
|
||||
|
|
@ -1065,7 +1065,7 @@ func (fsInspectionsampledetail0 *FSInspectionsampledetail) AttachOrganization(ct
|
|||
}
|
||||
|
||||
type fsInspectionsampledetailWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Comments psql.WhereNullMod[Q, string]
|
||||
Creationdate psql.WhereNullMod[Q, int64]
|
||||
Creator psql.WhereNullMod[Q, string]
|
||||
|
|
@ -1102,7 +1102,7 @@ func (fsInspectionsampledetailWhere[Q]) AliasedAs(alias string) fsInspectionsamp
|
|||
|
||||
func buildFSInspectionsampledetailWhere[Q psql.Filterable](cols fsInspectionsampledetailColumns) fsInspectionsampledetailWhere[Q] {
|
||||
return fsInspectionsampledetailWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Comments: psql.WhereNull[Q, string](cols.Comments),
|
||||
Creationdate: psql.WhereNull[Q, int64](cols.Creationdate),
|
||||
Creator: psql.WhereNull[Q, string](cols.Creator),
|
||||
|
|
@ -1235,11 +1235,8 @@ func (os FSInspectionsampledetailSlice) LoadOrganization(ctx context.Context, ex
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import (
|
|||
|
||||
// FSLinelocation is an object representing the database table.
|
||||
type FSLinelocation struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Accessdesc null.Val[string] `db:"accessdesc" `
|
||||
Acres null.Val[float64] `db:"acres" `
|
||||
Active null.Val[int16] `db:"active" `
|
||||
|
|
@ -227,7 +227,7 @@ func (fsLinelocationColumns) AliasedAs(alias string) fsLinelocationColumns {
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type FSLinelocationSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Accessdesc omitnull.Val[string] `db:"accessdesc" `
|
||||
Acres omitnull.Val[float64] `db:"acres" `
|
||||
Active omitnull.Val[int16] `db:"active" `
|
||||
|
|
@ -283,7 +283,7 @@ type FSLinelocationSetter struct {
|
|||
|
||||
func (s FSLinelocationSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 52)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Accessdesc.IsUnset() {
|
||||
|
|
@ -443,8 +443,8 @@ func (s FSLinelocationSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s FSLinelocationSetter) Overwrite(t *FSLinelocation) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Accessdesc.IsUnset() {
|
||||
t.Accessdesc = s.Accessdesc.MustGetNull()
|
||||
|
|
@ -608,8 +608,8 @@ func (s *FSLinelocationSetter) Apply(q *dialect.InsertQuery) {
|
|||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 52)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -931,7 +931,7 @@ func (s FSLinelocationSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery] {
|
|||
func (s FSLinelocationSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 52)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -1529,7 +1529,7 @@ func (o *FSLinelocation) Organization(mods ...bob.Mod[*dialect.SelectQuery]) Org
|
|||
}
|
||||
|
||||
func (os FSLinelocationSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -1547,7 +1547,7 @@ func (os FSLinelocationSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]
|
|||
|
||||
func attachFSLinelocationOrganization0(ctx context.Context, exec bob.Executor, count int, fsLinelocation0 *FSLinelocation, organization1 *Organization) (*FSLinelocation, error) {
|
||||
setter := &FSLinelocationSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := fsLinelocation0.Update(ctx, exec, setter)
|
||||
|
|
@ -1594,7 +1594,7 @@ func (fsLinelocation0 *FSLinelocation) AttachOrganization(ctx context.Context, e
|
|||
}
|
||||
|
||||
type fsLinelocationWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Accessdesc psql.WhereNullMod[Q, string]
|
||||
Acres psql.WhereNullMod[Q, float64]
|
||||
Active psql.WhereNullMod[Q, int16]
|
||||
|
|
@ -1654,7 +1654,7 @@ func (fsLinelocationWhere[Q]) AliasedAs(alias string) fsLinelocationWhere[Q] {
|
|||
|
||||
func buildFSLinelocationWhere[Q psql.Filterable](cols fsLinelocationColumns) fsLinelocationWhere[Q] {
|
||||
return fsLinelocationWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Accessdesc: psql.WhereNull[Q, string](cols.Accessdesc),
|
||||
Acres: psql.WhereNull[Q, float64](cols.Acres),
|
||||
Active: psql.WhereNull[Q, int16](cols.Active),
|
||||
|
|
@ -1810,11 +1810,8 @@ func (os FSLinelocationSlice) LoadOrganization(ctx context.Context, exec bob.Exe
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import (
|
|||
|
||||
// FSLocationtracking is an object representing the database table.
|
||||
type FSLocationtracking struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Accuracy null.Val[float64] `db:"accuracy" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
|
|
@ -119,7 +119,7 @@ func (fsLocationtrackingColumns) AliasedAs(alias string) fsLocationtrackingColum
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type FSLocationtrackingSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Accuracy omitnull.Val[float64] `db:"accuracy" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
|
|
@ -139,7 +139,7 @@ type FSLocationtrackingSetter struct {
|
|||
|
||||
func (s FSLocationtrackingSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 16)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Accuracy.IsUnset() {
|
||||
|
|
@ -191,8 +191,8 @@ func (s FSLocationtrackingSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s FSLocationtrackingSetter) Overwrite(t *FSLocationtracking) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Accuracy.IsUnset() {
|
||||
t.Accuracy = s.Accuracy.MustGetNull()
|
||||
|
|
@ -248,8 +248,8 @@ func (s *FSLocationtrackingSetter) Apply(q *dialect.InsertQuery) {
|
|||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 16)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -355,7 +355,7 @@ func (s FSLocationtrackingSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery] {
|
|||
func (s FSLocationtrackingSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 16)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -701,7 +701,7 @@ func (o *FSLocationtracking) Organization(mods ...bob.Mod[*dialect.SelectQuery])
|
|||
}
|
||||
|
||||
func (os FSLocationtrackingSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -719,7 +719,7 @@ func (os FSLocationtrackingSlice) Organization(mods ...bob.Mod[*dialect.SelectQu
|
|||
|
||||
func attachFSLocationtrackingOrganization0(ctx context.Context, exec bob.Executor, count int, fsLocationtracking0 *FSLocationtracking, organization1 *Organization) (*FSLocationtracking, error) {
|
||||
setter := &FSLocationtrackingSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := fsLocationtracking0.Update(ctx, exec, setter)
|
||||
|
|
@ -766,7 +766,7 @@ func (fsLocationtracking0 *FSLocationtracking) AttachOrganization(ctx context.Co
|
|||
}
|
||||
|
||||
type fsLocationtrackingWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Accuracy psql.WhereNullMod[Q, float64]
|
||||
Creationdate psql.WhereNullMod[Q, int64]
|
||||
Creator psql.WhereNullMod[Q, string]
|
||||
|
|
@ -790,7 +790,7 @@ func (fsLocationtrackingWhere[Q]) AliasedAs(alias string) fsLocationtrackingWher
|
|||
|
||||
func buildFSLocationtrackingWhere[Q psql.Filterable](cols fsLocationtrackingColumns) fsLocationtrackingWhere[Q] {
|
||||
return fsLocationtrackingWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Accuracy: psql.WhereNull[Q, float64](cols.Accuracy),
|
||||
Creationdate: psql.WhereNull[Q, int64](cols.Creationdate),
|
||||
Creator: psql.WhereNull[Q, string](cols.Creator),
|
||||
|
|
@ -910,11 +910,8 @@ func (os FSLocationtrackingSlice) LoadOrganization(ctx context.Context, exec bob
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import (
|
|||
|
||||
// FSMosquitoinspection is an object representing the database table.
|
||||
type FSMosquitoinspection struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Actiontaken null.Val[string] `db:"actiontaken" `
|
||||
Activity null.Val[string] `db:"activity" `
|
||||
Adultact null.Val[string] `db:"adultact" `
|
||||
|
|
@ -254,7 +254,7 @@ func (fsMosquitoinspectionColumns) AliasedAs(alias string) fsMosquitoinspectionC
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type FSMosquitoinspectionSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Actiontaken omitnull.Val[string] `db:"actiontaken" `
|
||||
Activity omitnull.Val[string] `db:"activity" `
|
||||
Adultact omitnull.Val[string] `db:"adultact" `
|
||||
|
|
@ -319,7 +319,7 @@ type FSMosquitoinspectionSetter struct {
|
|||
|
||||
func (s FSMosquitoinspectionSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 61)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Actiontaken.IsUnset() {
|
||||
|
|
@ -506,8 +506,8 @@ func (s FSMosquitoinspectionSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s FSMosquitoinspectionSetter) Overwrite(t *FSMosquitoinspection) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Actiontaken.IsUnset() {
|
||||
t.Actiontaken = s.Actiontaken.MustGetNull()
|
||||
|
|
@ -698,8 +698,8 @@ func (s *FSMosquitoinspectionSetter) Apply(q *dialect.InsertQuery) {
|
|||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 61)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -1075,7 +1075,7 @@ func (s FSMosquitoinspectionSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery] {
|
|||
func (s FSMosquitoinspectionSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 61)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -1736,7 +1736,7 @@ func (o *FSMosquitoinspection) Organization(mods ...bob.Mod[*dialect.SelectQuery
|
|||
}
|
||||
|
||||
func (os FSMosquitoinspectionSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -1754,7 +1754,7 @@ func (os FSMosquitoinspectionSlice) Organization(mods ...bob.Mod[*dialect.Select
|
|||
|
||||
func attachFSMosquitoinspectionOrganization0(ctx context.Context, exec bob.Executor, count int, fsMosquitoinspection0 *FSMosquitoinspection, organization1 *Organization) (*FSMosquitoinspection, error) {
|
||||
setter := &FSMosquitoinspectionSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := fsMosquitoinspection0.Update(ctx, exec, setter)
|
||||
|
|
@ -1801,7 +1801,7 @@ func (fsMosquitoinspection0 *FSMosquitoinspection) AttachOrganization(ctx contex
|
|||
}
|
||||
|
||||
type fsMosquitoinspectionWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Actiontaken psql.WhereNullMod[Q, string]
|
||||
Activity psql.WhereNullMod[Q, string]
|
||||
Adultact psql.WhereNullMod[Q, string]
|
||||
|
|
@ -1870,7 +1870,7 @@ func (fsMosquitoinspectionWhere[Q]) AliasedAs(alias string) fsMosquitoinspection
|
|||
|
||||
func buildFSMosquitoinspectionWhere[Q psql.Filterable](cols fsMosquitoinspectionColumns) fsMosquitoinspectionWhere[Q] {
|
||||
return fsMosquitoinspectionWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Actiontaken: psql.WhereNull[Q, string](cols.Actiontaken),
|
||||
Activity: psql.WhereNull[Q, string](cols.Activity),
|
||||
Adultact: psql.WhereNull[Q, string](cols.Adultact),
|
||||
|
|
@ -2035,11 +2035,8 @@ func (os FSMosquitoinspectionSlice) LoadOrganization(ctx context.Context, exec b
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import (
|
|||
|
||||
// FSPointlocation is an object representing the database table.
|
||||
type FSPointlocation struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Accessdesc null.Val[string] `db:"accessdesc" `
|
||||
Active null.Val[int16] `db:"active" `
|
||||
Comments null.Val[string] `db:"comments" `
|
||||
|
|
@ -215,7 +215,7 @@ func (fsPointlocationColumns) AliasedAs(alias string) fsPointlocationColumns {
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type FSPointlocationSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Accessdesc omitnull.Val[string] `db:"accessdesc" `
|
||||
Active omitnull.Val[int16] `db:"active" `
|
||||
Comments omitnull.Val[string] `db:"comments" `
|
||||
|
|
@ -267,7 +267,7 @@ type FSPointlocationSetter struct {
|
|||
|
||||
func (s FSPointlocationSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 48)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Accessdesc.IsUnset() {
|
||||
|
|
@ -415,8 +415,8 @@ func (s FSPointlocationSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s FSPointlocationSetter) Overwrite(t *FSPointlocation) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Accessdesc.IsUnset() {
|
||||
t.Accessdesc = s.Accessdesc.MustGetNull()
|
||||
|
|
@ -568,8 +568,8 @@ func (s *FSPointlocationSetter) Apply(q *dialect.InsertQuery) {
|
|||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 48)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -867,7 +867,7 @@ func (s FSPointlocationSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery] {
|
|||
func (s FSPointlocationSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 48)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -1437,7 +1437,7 @@ func (o *FSPointlocation) Organization(mods ...bob.Mod[*dialect.SelectQuery]) Or
|
|||
}
|
||||
|
||||
func (os FSPointlocationSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -1455,7 +1455,7 @@ func (os FSPointlocationSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery
|
|||
|
||||
func attachFSPointlocationOrganization0(ctx context.Context, exec bob.Executor, count int, fsPointlocation0 *FSPointlocation, organization1 *Organization) (*FSPointlocation, error) {
|
||||
setter := &FSPointlocationSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := fsPointlocation0.Update(ctx, exec, setter)
|
||||
|
|
@ -1502,7 +1502,7 @@ func (fsPointlocation0 *FSPointlocation) AttachOrganization(ctx context.Context,
|
|||
}
|
||||
|
||||
type fsPointlocationWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Accessdesc psql.WhereNullMod[Q, string]
|
||||
Active psql.WhereNullMod[Q, int16]
|
||||
Comments psql.WhereNullMod[Q, string]
|
||||
|
|
@ -1558,7 +1558,7 @@ func (fsPointlocationWhere[Q]) AliasedAs(alias string) fsPointlocationWhere[Q] {
|
|||
|
||||
func buildFSPointlocationWhere[Q psql.Filterable](cols fsPointlocationColumns) fsPointlocationWhere[Q] {
|
||||
return fsPointlocationWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Accessdesc: psql.WhereNull[Q, string](cols.Accessdesc),
|
||||
Active: psql.WhereNull[Q, int16](cols.Active),
|
||||
Comments: psql.WhereNull[Q, string](cols.Comments),
|
||||
|
|
@ -1710,11 +1710,8 @@ func (os FSPointlocationSlice) LoadOrganization(ctx context.Context, exec bob.Ex
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import (
|
|||
|
||||
// FSPolygonlocation is an object representing the database table.
|
||||
type FSPolygonlocation struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Accessdesc null.Val[string] `db:"accessdesc" `
|
||||
Acres null.Val[float64] `db:"acres" `
|
||||
Active null.Val[int16] `db:"active" `
|
||||
|
|
@ -209,7 +209,7 @@ func (fsPolygonlocationColumns) AliasedAs(alias string) fsPolygonlocationColumns
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type FSPolygonlocationSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Accessdesc omitnull.Val[string] `db:"accessdesc" `
|
||||
Acres omitnull.Val[float64] `db:"acres" `
|
||||
Active omitnull.Val[int16] `db:"active" `
|
||||
|
|
@ -259,7 +259,7 @@ type FSPolygonlocationSetter struct {
|
|||
|
||||
func (s FSPolygonlocationSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 46)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Accessdesc.IsUnset() {
|
||||
|
|
@ -401,8 +401,8 @@ func (s FSPolygonlocationSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s FSPolygonlocationSetter) Overwrite(t *FSPolygonlocation) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Accessdesc.IsUnset() {
|
||||
t.Accessdesc = s.Accessdesc.MustGetNull()
|
||||
|
|
@ -548,8 +548,8 @@ func (s *FSPolygonlocationSetter) Apply(q *dialect.InsertQuery) {
|
|||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 46)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -835,7 +835,7 @@ func (s FSPolygonlocationSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery] {
|
|||
func (s FSPolygonlocationSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 46)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -1391,7 +1391,7 @@ func (o *FSPolygonlocation) Organization(mods ...bob.Mod[*dialect.SelectQuery])
|
|||
}
|
||||
|
||||
func (os FSPolygonlocationSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -1409,7 +1409,7 @@ func (os FSPolygonlocationSlice) Organization(mods ...bob.Mod[*dialect.SelectQue
|
|||
|
||||
func attachFSPolygonlocationOrganization0(ctx context.Context, exec bob.Executor, count int, fsPolygonlocation0 *FSPolygonlocation, organization1 *Organization) (*FSPolygonlocation, error) {
|
||||
setter := &FSPolygonlocationSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := fsPolygonlocation0.Update(ctx, exec, setter)
|
||||
|
|
@ -1456,7 +1456,7 @@ func (fsPolygonlocation0 *FSPolygonlocation) AttachOrganization(ctx context.Cont
|
|||
}
|
||||
|
||||
type fsPolygonlocationWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Accessdesc psql.WhereNullMod[Q, string]
|
||||
Acres psql.WhereNullMod[Q, float64]
|
||||
Active psql.WhereNullMod[Q, int16]
|
||||
|
|
@ -1510,7 +1510,7 @@ func (fsPolygonlocationWhere[Q]) AliasedAs(alias string) fsPolygonlocationWhere[
|
|||
|
||||
func buildFSPolygonlocationWhere[Q psql.Filterable](cols fsPolygonlocationColumns) fsPolygonlocationWhere[Q] {
|
||||
return fsPolygonlocationWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Accessdesc: psql.WhereNull[Q, string](cols.Accessdesc),
|
||||
Acres: psql.WhereNull[Q, float64](cols.Acres),
|
||||
Active: psql.WhereNull[Q, int16](cols.Active),
|
||||
|
|
@ -1660,11 +1660,8 @@ func (os FSPolygonlocationSlice) LoadOrganization(ctx context.Context, exec bob.
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import (
|
|||
|
||||
// FSPool is an object representing the database table.
|
||||
type FSPool struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Comments null.Val[string] `db:"comments" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
|
|
@ -167,7 +167,7 @@ func (fsPoolColumns) AliasedAs(alias string) fsPoolColumns {
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type FSPoolSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Comments omitnull.Val[string] `db:"comments" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
|
|
@ -203,7 +203,7 @@ type FSPoolSetter struct {
|
|||
|
||||
func (s FSPoolSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 32)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Comments.IsUnset() {
|
||||
|
|
@ -303,8 +303,8 @@ func (s FSPoolSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s FSPoolSetter) Overwrite(t *FSPool) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Comments.IsUnset() {
|
||||
t.Comments = s.Comments.MustGetNull()
|
||||
|
|
@ -408,8 +408,8 @@ func (s *FSPoolSetter) Apply(q *dialect.InsertQuery) {
|
|||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 32)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -611,7 +611,7 @@ func (s FSPoolSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery] {
|
|||
func (s FSPoolSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 32)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -1069,7 +1069,7 @@ func (o *FSPool) Organization(mods ...bob.Mod[*dialect.SelectQuery]) Organizatio
|
|||
}
|
||||
|
||||
func (os FSPoolSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -1087,7 +1087,7 @@ func (os FSPoolSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) Organi
|
|||
|
||||
func attachFSPoolOrganization0(ctx context.Context, exec bob.Executor, count int, fsPool0 *FSPool, organization1 *Organization) (*FSPool, error) {
|
||||
setter := &FSPoolSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := fsPool0.Update(ctx, exec, setter)
|
||||
|
|
@ -1134,7 +1134,7 @@ func (fsPool0 *FSPool) AttachOrganization(ctx context.Context, exec bob.Executor
|
|||
}
|
||||
|
||||
type fsPoolWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Comments psql.WhereNullMod[Q, string]
|
||||
Creationdate psql.WhereNullMod[Q, int64]
|
||||
Creator psql.WhereNullMod[Q, string]
|
||||
|
|
@ -1174,7 +1174,7 @@ func (fsPoolWhere[Q]) AliasedAs(alias string) fsPoolWhere[Q] {
|
|||
|
||||
func buildFSPoolWhere[Q psql.Filterable](cols fsPoolColumns) fsPoolWhere[Q] {
|
||||
return fsPoolWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Comments: psql.WhereNull[Q, string](cols.Comments),
|
||||
Creationdate: psql.WhereNull[Q, int64](cols.Creationdate),
|
||||
Creator: psql.WhereNull[Q, string](cols.Creator),
|
||||
|
|
@ -1310,11 +1310,8 @@ func (os FSPoolSlice) LoadOrganization(ctx context.Context, exec bob.Executor, m
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import (
|
|||
|
||||
// FSPooldetail is an object representing the database table.
|
||||
type FSPooldetail struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
|
|
@ -125,7 +125,7 @@ func (fsPooldetailColumns) AliasedAs(alias string) fsPooldetailColumns {
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type FSPooldetailSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
|
|
@ -147,7 +147,7 @@ type FSPooldetailSetter struct {
|
|||
|
||||
func (s FSPooldetailSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 18)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Creationdate.IsUnset() {
|
||||
|
|
@ -205,8 +205,8 @@ func (s FSPooldetailSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s FSPooldetailSetter) Overwrite(t *FSPooldetail) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Creationdate.IsUnset() {
|
||||
t.Creationdate = s.Creationdate.MustGetNull()
|
||||
|
|
@ -268,8 +268,8 @@ func (s *FSPooldetailSetter) Apply(q *dialect.InsertQuery) {
|
|||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 18)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -387,7 +387,7 @@ func (s FSPooldetailSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery] {
|
|||
func (s FSPooldetailSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 18)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -747,7 +747,7 @@ func (o *FSPooldetail) Organization(mods ...bob.Mod[*dialect.SelectQuery]) Organ
|
|||
}
|
||||
|
||||
func (os FSPooldetailSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -765,7 +765,7 @@ func (os FSPooldetailSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery])
|
|||
|
||||
func attachFSPooldetailOrganization0(ctx context.Context, exec bob.Executor, count int, fsPooldetail0 *FSPooldetail, organization1 *Organization) (*FSPooldetail, error) {
|
||||
setter := &FSPooldetailSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := fsPooldetail0.Update(ctx, exec, setter)
|
||||
|
|
@ -812,7 +812,7 @@ func (fsPooldetail0 *FSPooldetail) AttachOrganization(ctx context.Context, exec
|
|||
}
|
||||
|
||||
type fsPooldetailWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Creationdate psql.WhereNullMod[Q, int64]
|
||||
Creator psql.WhereNullMod[Q, string]
|
||||
Editdate psql.WhereNullMod[Q, int64]
|
||||
|
|
@ -838,7 +838,7 @@ func (fsPooldetailWhere[Q]) AliasedAs(alias string) fsPooldetailWhere[Q] {
|
|||
|
||||
func buildFSPooldetailWhere[Q psql.Filterable](cols fsPooldetailColumns) fsPooldetailWhere[Q] {
|
||||
return fsPooldetailWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Creationdate: psql.WhereNull[Q, int64](cols.Creationdate),
|
||||
Creator: psql.WhereNull[Q, string](cols.Creator),
|
||||
Editdate: psql.WhereNull[Q, int64](cols.Editdate),
|
||||
|
|
@ -960,11 +960,8 @@ func (os FSPooldetailSlice) LoadOrganization(ctx context.Context, exec bob.Execu
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import (
|
|||
|
||||
// FSProposedtreatmentarea is an object representing the database table.
|
||||
type FSProposedtreatmentarea struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Acres null.Val[float64] `db:"acres" `
|
||||
Comments null.Val[string] `db:"comments" `
|
||||
Completed null.Val[int16] `db:"completed" `
|
||||
|
|
@ -182,7 +182,7 @@ func (fsProposedtreatmentareaColumns) AliasedAs(alias string) fsProposedtreatmen
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type FSProposedtreatmentareaSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Acres omitnull.Val[float64] `db:"acres" `
|
||||
Comments omitnull.Val[string] `db:"comments" `
|
||||
Completed omitnull.Val[int16] `db:"completed" `
|
||||
|
|
@ -223,7 +223,7 @@ type FSProposedtreatmentareaSetter struct {
|
|||
|
||||
func (s FSProposedtreatmentareaSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 37)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Acres.IsUnset() {
|
||||
|
|
@ -338,8 +338,8 @@ func (s FSProposedtreatmentareaSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s FSProposedtreatmentareaSetter) Overwrite(t *FSProposedtreatmentarea) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Acres.IsUnset() {
|
||||
t.Acres = s.Acres.MustGetNull()
|
||||
|
|
@ -458,8 +458,8 @@ func (s *FSProposedtreatmentareaSetter) Apply(q *dialect.InsertQuery) {
|
|||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 37)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -691,7 +691,7 @@ func (s FSProposedtreatmentareaSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery]
|
|||
func (s FSProposedtreatmentareaSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 37)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -1184,7 +1184,7 @@ func (o *FSProposedtreatmentarea) Organization(mods ...bob.Mod[*dialect.SelectQu
|
|||
}
|
||||
|
||||
func (os FSProposedtreatmentareaSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -1202,7 +1202,7 @@ func (os FSProposedtreatmentareaSlice) Organization(mods ...bob.Mod[*dialect.Sel
|
|||
|
||||
func attachFSProposedtreatmentareaOrganization0(ctx context.Context, exec bob.Executor, count int, fsProposedtreatmentarea0 *FSProposedtreatmentarea, organization1 *Organization) (*FSProposedtreatmentarea, error) {
|
||||
setter := &FSProposedtreatmentareaSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := fsProposedtreatmentarea0.Update(ctx, exec, setter)
|
||||
|
|
@ -1249,7 +1249,7 @@ func (fsProposedtreatmentarea0 *FSProposedtreatmentarea) AttachOrganization(ctx
|
|||
}
|
||||
|
||||
type fsProposedtreatmentareaWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Acres psql.WhereNullMod[Q, float64]
|
||||
Comments psql.WhereNullMod[Q, string]
|
||||
Completed psql.WhereNullMod[Q, int16]
|
||||
|
|
@ -1294,7 +1294,7 @@ func (fsProposedtreatmentareaWhere[Q]) AliasedAs(alias string) fsProposedtreatme
|
|||
|
||||
func buildFSProposedtreatmentareaWhere[Q psql.Filterable](cols fsProposedtreatmentareaColumns) fsProposedtreatmentareaWhere[Q] {
|
||||
return fsProposedtreatmentareaWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Acres: psql.WhereNull[Q, float64](cols.Acres),
|
||||
Comments: psql.WhereNull[Q, string](cols.Comments),
|
||||
Completed: psql.WhereNull[Q, int16](cols.Completed),
|
||||
|
|
@ -1435,11 +1435,8 @@ func (os FSProposedtreatmentareaSlice) LoadOrganization(ctx context.Context, exe
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import (
|
|||
|
||||
// FSQamosquitoinspection is an object representing the database table.
|
||||
type FSQamosquitoinspection struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Acresbreeding null.Val[float64] `db:"acresbreeding" `
|
||||
Actiontaken null.Val[string] `db:"actiontaken" `
|
||||
Adultactivity null.Val[int16] `db:"adultactivity" `
|
||||
|
|
@ -269,7 +269,7 @@ func (fsQamosquitoinspectionColumns) AliasedAs(alias string) fsQamosquitoinspect
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type FSQamosquitoinspectionSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Acresbreeding omitnull.Val[float64] `db:"acresbreeding" `
|
||||
Actiontaken omitnull.Val[string] `db:"actiontaken" `
|
||||
Adultactivity omitnull.Val[int16] `db:"adultactivity" `
|
||||
|
|
@ -339,7 +339,7 @@ type FSQamosquitoinspectionSetter struct {
|
|||
|
||||
func (s FSQamosquitoinspectionSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 66)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Acresbreeding.IsUnset() {
|
||||
|
|
@ -541,8 +541,8 @@ func (s FSQamosquitoinspectionSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s FSQamosquitoinspectionSetter) Overwrite(t *FSQamosquitoinspection) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Acresbreeding.IsUnset() {
|
||||
t.Acresbreeding = s.Acresbreeding.MustGetNull()
|
||||
|
|
@ -748,8 +748,8 @@ func (s *FSQamosquitoinspectionSetter) Apply(q *dialect.InsertQuery) {
|
|||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 66)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -1155,7 +1155,7 @@ func (s FSQamosquitoinspectionSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery]
|
|||
func (s FSQamosquitoinspectionSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 66)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -1851,7 +1851,7 @@ func (o *FSQamosquitoinspection) Organization(mods ...bob.Mod[*dialect.SelectQue
|
|||
}
|
||||
|
||||
func (os FSQamosquitoinspectionSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -1869,7 +1869,7 @@ func (os FSQamosquitoinspectionSlice) Organization(mods ...bob.Mod[*dialect.Sele
|
|||
|
||||
func attachFSQamosquitoinspectionOrganization0(ctx context.Context, exec bob.Executor, count int, fsQamosquitoinspection0 *FSQamosquitoinspection, organization1 *Organization) (*FSQamosquitoinspection, error) {
|
||||
setter := &FSQamosquitoinspectionSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := fsQamosquitoinspection0.Update(ctx, exec, setter)
|
||||
|
|
@ -1916,7 +1916,7 @@ func (fsQamosquitoinspection0 *FSQamosquitoinspection) AttachOrganization(ctx co
|
|||
}
|
||||
|
||||
type fsQamosquitoinspectionWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Acresbreeding psql.WhereNullMod[Q, float64]
|
||||
Actiontaken psql.WhereNullMod[Q, string]
|
||||
Adultactivity psql.WhereNullMod[Q, int16]
|
||||
|
|
@ -1990,7 +1990,7 @@ func (fsQamosquitoinspectionWhere[Q]) AliasedAs(alias string) fsQamosquitoinspec
|
|||
|
||||
func buildFSQamosquitoinspectionWhere[Q psql.Filterable](cols fsQamosquitoinspectionColumns) fsQamosquitoinspectionWhere[Q] {
|
||||
return fsQamosquitoinspectionWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Acresbreeding: psql.WhereNull[Q, float64](cols.Acresbreeding),
|
||||
Actiontaken: psql.WhereNull[Q, string](cols.Actiontaken),
|
||||
Adultactivity: psql.WhereNull[Q, int16](cols.Adultactivity),
|
||||
|
|
@ -2160,11 +2160,8 @@ func (os FSQamosquitoinspectionSlice) LoadOrganization(ctx context.Context, exec
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import (
|
|||
|
||||
// FSRodentlocation is an object representing the database table.
|
||||
type FSRodentlocation struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Accessdesc null.Val[string] `db:"accessdesc" `
|
||||
Active null.Val[int16] `db:"active" `
|
||||
Comments null.Val[string] `db:"comments" `
|
||||
|
|
@ -173,7 +173,7 @@ func (fsRodentlocationColumns) AliasedAs(alias string) fsRodentlocationColumns {
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type FSRodentlocationSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Accessdesc omitnull.Val[string] `db:"accessdesc" `
|
||||
Active omitnull.Val[int16] `db:"active" `
|
||||
Comments omitnull.Val[string] `db:"comments" `
|
||||
|
|
@ -211,7 +211,7 @@ type FSRodentlocationSetter struct {
|
|||
|
||||
func (s FSRodentlocationSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 34)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Accessdesc.IsUnset() {
|
||||
|
|
@ -317,8 +317,8 @@ func (s FSRodentlocationSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s FSRodentlocationSetter) Overwrite(t *FSRodentlocation) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Accessdesc.IsUnset() {
|
||||
t.Accessdesc = s.Accessdesc.MustGetNull()
|
||||
|
|
@ -428,8 +428,8 @@ func (s *FSRodentlocationSetter) Apply(q *dialect.InsertQuery) {
|
|||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 34)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -643,7 +643,7 @@ func (s FSRodentlocationSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery] {
|
|||
func (s FSRodentlocationSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 34)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -1115,7 +1115,7 @@ func (o *FSRodentlocation) Organization(mods ...bob.Mod[*dialect.SelectQuery]) O
|
|||
}
|
||||
|
||||
func (os FSRodentlocationSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -1133,7 +1133,7 @@ func (os FSRodentlocationSlice) Organization(mods ...bob.Mod[*dialect.SelectQuer
|
|||
|
||||
func attachFSRodentlocationOrganization0(ctx context.Context, exec bob.Executor, count int, fsRodentlocation0 *FSRodentlocation, organization1 *Organization) (*FSRodentlocation, error) {
|
||||
setter := &FSRodentlocationSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := fsRodentlocation0.Update(ctx, exec, setter)
|
||||
|
|
@ -1180,7 +1180,7 @@ func (fsRodentlocation0 *FSRodentlocation) AttachOrganization(ctx context.Contex
|
|||
}
|
||||
|
||||
type fsRodentlocationWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Accessdesc psql.WhereNullMod[Q, string]
|
||||
Active psql.WhereNullMod[Q, int16]
|
||||
Comments psql.WhereNullMod[Q, string]
|
||||
|
|
@ -1222,7 +1222,7 @@ func (fsRodentlocationWhere[Q]) AliasedAs(alias string) fsRodentlocationWhere[Q]
|
|||
|
||||
func buildFSRodentlocationWhere[Q psql.Filterable](cols fsRodentlocationColumns) fsRodentlocationWhere[Q] {
|
||||
return fsRodentlocationWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Accessdesc: psql.WhereNull[Q, string](cols.Accessdesc),
|
||||
Active: psql.WhereNull[Q, int16](cols.Active),
|
||||
Comments: psql.WhereNull[Q, string](cols.Comments),
|
||||
|
|
@ -1360,11 +1360,8 @@ func (os FSRodentlocationSlice) LoadOrganization(ctx context.Context, exec bob.E
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import (
|
|||
|
||||
// FSSamplecollection is an object representing the database table.
|
||||
type FSSamplecollection struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Activity null.Val[string] `db:"activity" `
|
||||
Avetemp null.Val[float64] `db:"avetemp" `
|
||||
Chickenid null.Val[string] `db:"chickenid" `
|
||||
|
|
@ -221,7 +221,7 @@ func (fsSamplecollectionColumns) AliasedAs(alias string) fsSamplecollectionColum
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type FSSamplecollectionSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Activity omitnull.Val[string] `db:"activity" `
|
||||
Avetemp omitnull.Val[float64] `db:"avetemp" `
|
||||
Chickenid omitnull.Val[string] `db:"chickenid" `
|
||||
|
|
@ -275,7 +275,7 @@ type FSSamplecollectionSetter struct {
|
|||
|
||||
func (s FSSamplecollectionSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 50)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Activity.IsUnset() {
|
||||
|
|
@ -429,8 +429,8 @@ func (s FSSamplecollectionSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s FSSamplecollectionSetter) Overwrite(t *FSSamplecollection) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Activity.IsUnset() {
|
||||
t.Activity = s.Activity.MustGetNull()
|
||||
|
|
@ -588,8 +588,8 @@ func (s *FSSamplecollectionSetter) Apply(q *dialect.InsertQuery) {
|
|||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 50)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -899,7 +899,7 @@ func (s FSSamplecollectionSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery] {
|
|||
func (s FSSamplecollectionSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 50)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -1483,7 +1483,7 @@ func (o *FSSamplecollection) Organization(mods ...bob.Mod[*dialect.SelectQuery])
|
|||
}
|
||||
|
||||
func (os FSSamplecollectionSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -1501,7 +1501,7 @@ func (os FSSamplecollectionSlice) Organization(mods ...bob.Mod[*dialect.SelectQu
|
|||
|
||||
func attachFSSamplecollectionOrganization0(ctx context.Context, exec bob.Executor, count int, fsSamplecollection0 *FSSamplecollection, organization1 *Organization) (*FSSamplecollection, error) {
|
||||
setter := &FSSamplecollectionSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := fsSamplecollection0.Update(ctx, exec, setter)
|
||||
|
|
@ -1548,7 +1548,7 @@ func (fsSamplecollection0 *FSSamplecollection) AttachOrganization(ctx context.Co
|
|||
}
|
||||
|
||||
type fsSamplecollectionWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Activity psql.WhereNullMod[Q, string]
|
||||
Avetemp psql.WhereNullMod[Q, float64]
|
||||
Chickenid psql.WhereNullMod[Q, string]
|
||||
|
|
@ -1606,7 +1606,7 @@ func (fsSamplecollectionWhere[Q]) AliasedAs(alias string) fsSamplecollectionWher
|
|||
|
||||
func buildFSSamplecollectionWhere[Q psql.Filterable](cols fsSamplecollectionColumns) fsSamplecollectionWhere[Q] {
|
||||
return fsSamplecollectionWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Activity: psql.WhereNull[Q, string](cols.Activity),
|
||||
Avetemp: psql.WhereNull[Q, float64](cols.Avetemp),
|
||||
Chickenid: psql.WhereNull[Q, string](cols.Chickenid),
|
||||
|
|
@ -1760,11 +1760,8 @@ func (os FSSamplecollectionSlice) LoadOrganization(ctx context.Context, exec bob
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import (
|
|||
|
||||
// FSSamplelocation is an object representing the database table.
|
||||
type FSSamplelocation struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Accessdesc null.Val[string] `db:"accessdesc" `
|
||||
Active null.Val[int16] `db:"active" `
|
||||
Comments null.Val[string] `db:"comments" `
|
||||
|
|
@ -155,7 +155,7 @@ func (fsSamplelocationColumns) AliasedAs(alias string) fsSamplelocationColumns {
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type FSSamplelocationSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Accessdesc omitnull.Val[string] `db:"accessdesc" `
|
||||
Active omitnull.Val[int16] `db:"active" `
|
||||
Comments omitnull.Val[string] `db:"comments" `
|
||||
|
|
@ -187,7 +187,7 @@ type FSSamplelocationSetter struct {
|
|||
|
||||
func (s FSSamplelocationSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 28)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Accessdesc.IsUnset() {
|
||||
|
|
@ -275,8 +275,8 @@ func (s FSSamplelocationSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s FSSamplelocationSetter) Overwrite(t *FSSamplelocation) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Accessdesc.IsUnset() {
|
||||
t.Accessdesc = s.Accessdesc.MustGetNull()
|
||||
|
|
@ -368,8 +368,8 @@ func (s *FSSamplelocationSetter) Apply(q *dialect.InsertQuery) {
|
|||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 28)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -547,7 +547,7 @@ func (s FSSamplelocationSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery] {
|
|||
func (s FSSamplelocationSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 28)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -977,7 +977,7 @@ func (o *FSSamplelocation) Organization(mods ...bob.Mod[*dialect.SelectQuery]) O
|
|||
}
|
||||
|
||||
func (os FSSamplelocationSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -995,7 +995,7 @@ func (os FSSamplelocationSlice) Organization(mods ...bob.Mod[*dialect.SelectQuer
|
|||
|
||||
func attachFSSamplelocationOrganization0(ctx context.Context, exec bob.Executor, count int, fsSamplelocation0 *FSSamplelocation, organization1 *Organization) (*FSSamplelocation, error) {
|
||||
setter := &FSSamplelocationSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := fsSamplelocation0.Update(ctx, exec, setter)
|
||||
|
|
@ -1042,7 +1042,7 @@ func (fsSamplelocation0 *FSSamplelocation) AttachOrganization(ctx context.Contex
|
|||
}
|
||||
|
||||
type fsSamplelocationWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Accessdesc psql.WhereNullMod[Q, string]
|
||||
Active psql.WhereNullMod[Q, int16]
|
||||
Comments psql.WhereNullMod[Q, string]
|
||||
|
|
@ -1078,7 +1078,7 @@ func (fsSamplelocationWhere[Q]) AliasedAs(alias string) fsSamplelocationWhere[Q]
|
|||
|
||||
func buildFSSamplelocationWhere[Q psql.Filterable](cols fsSamplelocationColumns) fsSamplelocationWhere[Q] {
|
||||
return fsSamplelocationWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Accessdesc: psql.WhereNull[Q, string](cols.Accessdesc),
|
||||
Active: psql.WhereNull[Q, int16](cols.Active),
|
||||
Comments: psql.WhereNull[Q, string](cols.Comments),
|
||||
|
|
@ -1210,11 +1210,8 @@ func (os FSSamplelocationSlice) LoadOrganization(ctx context.Context, exec bob.E
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import (
|
|||
|
||||
// FSServicerequest is an object representing the database table.
|
||||
type FSServicerequest struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Accepted null.Val[int16] `db:"accepted" `
|
||||
Acceptedby null.Val[string] `db:"acceptedby" `
|
||||
Accepteddate null.Val[int64] `db:"accepteddate" `
|
||||
|
|
@ -341,7 +341,7 @@ func (fsServicerequestColumns) AliasedAs(alias string) fsServicerequestColumns {
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type FSServicerequestSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Accepted omitnull.Val[int16] `db:"accepted" `
|
||||
Acceptedby omitnull.Val[string] `db:"acceptedby" `
|
||||
Accepteddate omitnull.Val[int64] `db:"accepteddate" `
|
||||
|
|
@ -435,7 +435,7 @@ type FSServicerequestSetter struct {
|
|||
|
||||
func (s FSServicerequestSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 90)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Accepted.IsUnset() {
|
||||
|
|
@ -709,8 +709,8 @@ func (s FSServicerequestSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s FSServicerequestSetter) Overwrite(t *FSServicerequest) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Accepted.IsUnset() {
|
||||
t.Accepted = s.Accepted.MustGetNull()
|
||||
|
|
@ -988,8 +988,8 @@ func (s *FSServicerequestSetter) Apply(q *dialect.InsertQuery) {
|
|||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 90)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -1539,7 +1539,7 @@ func (s FSServicerequestSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery] {
|
|||
func (s FSServicerequestSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 90)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -2403,7 +2403,7 @@ func (o *FSServicerequest) Organization(mods ...bob.Mod[*dialect.SelectQuery]) O
|
|||
}
|
||||
|
||||
func (os FSServicerequestSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -2421,7 +2421,7 @@ func (os FSServicerequestSlice) Organization(mods ...bob.Mod[*dialect.SelectQuer
|
|||
|
||||
func attachFSServicerequestOrganization0(ctx context.Context, exec bob.Executor, count int, fsServicerequest0 *FSServicerequest, organization1 *Organization) (*FSServicerequest, error) {
|
||||
setter := &FSServicerequestSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := fsServicerequest0.Update(ctx, exec, setter)
|
||||
|
|
@ -2468,7 +2468,7 @@ func (fsServicerequest0 *FSServicerequest) AttachOrganization(ctx context.Contex
|
|||
}
|
||||
|
||||
type fsServicerequestWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Accepted psql.WhereNullMod[Q, int16]
|
||||
Acceptedby psql.WhereNullMod[Q, string]
|
||||
Accepteddate psql.WhereNullMod[Q, int64]
|
||||
|
|
@ -2566,7 +2566,7 @@ func (fsServicerequestWhere[Q]) AliasedAs(alias string) fsServicerequestWhere[Q]
|
|||
|
||||
func buildFSServicerequestWhere[Q psql.Filterable](cols fsServicerequestColumns) fsServicerequestWhere[Q] {
|
||||
return fsServicerequestWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Accepted: psql.WhereNull[Q, int16](cols.Accepted),
|
||||
Acceptedby: psql.WhereNull[Q, string](cols.Acceptedby),
|
||||
Accepteddate: psql.WhereNull[Q, int64](cols.Accepteddate),
|
||||
|
|
@ -2760,11 +2760,8 @@ func (os FSServicerequestSlice) LoadOrganization(ctx context.Context, exec bob.E
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import (
|
|||
|
||||
// FSSpeciesabundance is an object representing the database table.
|
||||
type FSSpeciesabundance struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Bloodedfem null.Val[int16] `db:"bloodedfem" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
|
|
@ -170,7 +170,7 @@ func (fsSpeciesabundanceColumns) AliasedAs(alias string) fsSpeciesabundanceColum
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type FSSpeciesabundanceSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Bloodedfem omitnull.Val[int16] `db:"bloodedfem" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
|
|
@ -207,7 +207,7 @@ type FSSpeciesabundanceSetter struct {
|
|||
|
||||
func (s FSSpeciesabundanceSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 33)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Bloodedfem.IsUnset() {
|
||||
|
|
@ -310,8 +310,8 @@ func (s FSSpeciesabundanceSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s FSSpeciesabundanceSetter) Overwrite(t *FSSpeciesabundance) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Bloodedfem.IsUnset() {
|
||||
t.Bloodedfem = s.Bloodedfem.MustGetNull()
|
||||
|
|
@ -418,8 +418,8 @@ func (s *FSSpeciesabundanceSetter) Apply(q *dialect.InsertQuery) {
|
|||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 33)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -627,7 +627,7 @@ func (s FSSpeciesabundanceSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery] {
|
|||
func (s FSSpeciesabundanceSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 33)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -1092,7 +1092,7 @@ func (o *FSSpeciesabundance) Organization(mods ...bob.Mod[*dialect.SelectQuery])
|
|||
}
|
||||
|
||||
func (os FSSpeciesabundanceSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -1110,7 +1110,7 @@ func (os FSSpeciesabundanceSlice) Organization(mods ...bob.Mod[*dialect.SelectQu
|
|||
|
||||
func attachFSSpeciesabundanceOrganization0(ctx context.Context, exec bob.Executor, count int, fsSpeciesabundance0 *FSSpeciesabundance, organization1 *Organization) (*FSSpeciesabundance, error) {
|
||||
setter := &FSSpeciesabundanceSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := fsSpeciesabundance0.Update(ctx, exec, setter)
|
||||
|
|
@ -1157,7 +1157,7 @@ func (fsSpeciesabundance0 *FSSpeciesabundance) AttachOrganization(ctx context.Co
|
|||
}
|
||||
|
||||
type fsSpeciesabundanceWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Bloodedfem psql.WhereNullMod[Q, int16]
|
||||
Creationdate psql.WhereNullMod[Q, int64]
|
||||
Creator psql.WhereNullMod[Q, string]
|
||||
|
|
@ -1198,7 +1198,7 @@ func (fsSpeciesabundanceWhere[Q]) AliasedAs(alias string) fsSpeciesabundanceWher
|
|||
|
||||
func buildFSSpeciesabundanceWhere[Q psql.Filterable](cols fsSpeciesabundanceColumns) fsSpeciesabundanceWhere[Q] {
|
||||
return fsSpeciesabundanceWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Bloodedfem: psql.WhereNull[Q, int16](cols.Bloodedfem),
|
||||
Creationdate: psql.WhereNull[Q, int64](cols.Creationdate),
|
||||
Creator: psql.WhereNull[Q, string](cols.Creator),
|
||||
|
|
@ -1335,11 +1335,8 @@ func (os FSSpeciesabundanceSlice) LoadOrganization(ctx context.Context, exec bob
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import (
|
|||
|
||||
// FSStormdrain is an object representing the database table.
|
||||
type FSStormdrain struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
|
|
@ -140,7 +140,7 @@ func (fsStormdrainColumns) AliasedAs(alias string) fsStormdrainColumns {
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type FSStormdrainSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
|
|
@ -167,7 +167,7 @@ type FSStormdrainSetter struct {
|
|||
|
||||
func (s FSStormdrainSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 23)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Creationdate.IsUnset() {
|
||||
|
|
@ -240,8 +240,8 @@ func (s FSStormdrainSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s FSStormdrainSetter) Overwrite(t *FSStormdrain) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Creationdate.IsUnset() {
|
||||
t.Creationdate = s.Creationdate.MustGetNull()
|
||||
|
|
@ -318,8 +318,8 @@ func (s *FSStormdrainSetter) Apply(q *dialect.InsertQuery) {
|
|||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 23)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -467,7 +467,7 @@ func (s FSStormdrainSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery] {
|
|||
func (s FSStormdrainSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 23)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -862,7 +862,7 @@ func (o *FSStormdrain) Organization(mods ...bob.Mod[*dialect.SelectQuery]) Organ
|
|||
}
|
||||
|
||||
func (os FSStormdrainSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -880,7 +880,7 @@ func (os FSStormdrainSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery])
|
|||
|
||||
func attachFSStormdrainOrganization0(ctx context.Context, exec bob.Executor, count int, fsStormdrain0 *FSStormdrain, organization1 *Organization) (*FSStormdrain, error) {
|
||||
setter := &FSStormdrainSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := fsStormdrain0.Update(ctx, exec, setter)
|
||||
|
|
@ -927,7 +927,7 @@ func (fsStormdrain0 *FSStormdrain) AttachOrganization(ctx context.Context, exec
|
|||
}
|
||||
|
||||
type fsStormdrainWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Creationdate psql.WhereNullMod[Q, int64]
|
||||
Creator psql.WhereNullMod[Q, string]
|
||||
Editdate psql.WhereNullMod[Q, int64]
|
||||
|
|
@ -958,7 +958,7 @@ func (fsStormdrainWhere[Q]) AliasedAs(alias string) fsStormdrainWhere[Q] {
|
|||
|
||||
func buildFSStormdrainWhere[Q psql.Filterable](cols fsStormdrainColumns) fsStormdrainWhere[Q] {
|
||||
return fsStormdrainWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Creationdate: psql.WhereNull[Q, int64](cols.Creationdate),
|
||||
Creator: psql.WhereNull[Q, string](cols.Creator),
|
||||
Editdate: psql.WhereNull[Q, int64](cols.Editdate),
|
||||
|
|
@ -1085,11 +1085,8 @@ func (os FSStormdrainSlice) LoadOrganization(ctx context.Context, exec bob.Execu
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import (
|
|||
|
||||
// FSTimecard is an object representing the database table.
|
||||
type FSTimecard struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Activity null.Val[string] `db:"activity" `
|
||||
Comments null.Val[string] `db:"comments" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
|
|
@ -167,7 +167,7 @@ func (fsTimecardColumns) AliasedAs(alias string) fsTimecardColumns {
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type FSTimecardSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Activity omitnull.Val[string] `db:"activity" `
|
||||
Comments omitnull.Val[string] `db:"comments" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
|
|
@ -203,7 +203,7 @@ type FSTimecardSetter struct {
|
|||
|
||||
func (s FSTimecardSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 32)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Activity.IsUnset() {
|
||||
|
|
@ -303,8 +303,8 @@ func (s FSTimecardSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s FSTimecardSetter) Overwrite(t *FSTimecard) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Activity.IsUnset() {
|
||||
t.Activity = s.Activity.MustGetNull()
|
||||
|
|
@ -408,8 +408,8 @@ func (s *FSTimecardSetter) Apply(q *dialect.InsertQuery) {
|
|||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 32)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -611,7 +611,7 @@ func (s FSTimecardSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery] {
|
|||
func (s FSTimecardSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 32)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -1069,7 +1069,7 @@ func (o *FSTimecard) Organization(mods ...bob.Mod[*dialect.SelectQuery]) Organiz
|
|||
}
|
||||
|
||||
func (os FSTimecardSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -1087,7 +1087,7 @@ func (os FSTimecardSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) Or
|
|||
|
||||
func attachFSTimecardOrganization0(ctx context.Context, exec bob.Executor, count int, fsTimecard0 *FSTimecard, organization1 *Organization) (*FSTimecard, error) {
|
||||
setter := &FSTimecardSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := fsTimecard0.Update(ctx, exec, setter)
|
||||
|
|
@ -1134,7 +1134,7 @@ func (fsTimecard0 *FSTimecard) AttachOrganization(ctx context.Context, exec bob.
|
|||
}
|
||||
|
||||
type fsTimecardWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Activity psql.WhereNullMod[Q, string]
|
||||
Comments psql.WhereNullMod[Q, string]
|
||||
Creationdate psql.WhereNullMod[Q, int64]
|
||||
|
|
@ -1174,7 +1174,7 @@ func (fsTimecardWhere[Q]) AliasedAs(alias string) fsTimecardWhere[Q] {
|
|||
|
||||
func buildFSTimecardWhere[Q psql.Filterable](cols fsTimecardColumns) fsTimecardWhere[Q] {
|
||||
return fsTimecardWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Activity: psql.WhereNull[Q, string](cols.Activity),
|
||||
Comments: psql.WhereNull[Q, string](cols.Comments),
|
||||
Creationdate: psql.WhereNull[Q, int64](cols.Creationdate),
|
||||
|
|
@ -1310,11 +1310,8 @@ func (os FSTimecardSlice) LoadOrganization(ctx context.Context, exec bob.Executo
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import (
|
|||
|
||||
// FSTrapdatum is an object representing the database table.
|
||||
type FSTrapdatum struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Avetemp null.Val[float64] `db:"avetemp" `
|
||||
Comments null.Val[string] `db:"comments" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
|
|
@ -209,7 +209,7 @@ func (fsTrapdatumColumns) AliasedAs(alias string) fsTrapdatumColumns {
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type FSTrapdatumSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Avetemp omitnull.Val[float64] `db:"avetemp" `
|
||||
Comments omitnull.Val[string] `db:"comments" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
|
|
@ -259,7 +259,7 @@ type FSTrapdatumSetter struct {
|
|||
|
||||
func (s FSTrapdatumSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 46)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Avetemp.IsUnset() {
|
||||
|
|
@ -401,8 +401,8 @@ func (s FSTrapdatumSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s FSTrapdatumSetter) Overwrite(t *FSTrapdatum) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Avetemp.IsUnset() {
|
||||
t.Avetemp = s.Avetemp.MustGetNull()
|
||||
|
|
@ -548,8 +548,8 @@ func (s *FSTrapdatumSetter) Apply(q *dialect.InsertQuery) {
|
|||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 46)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -835,7 +835,7 @@ func (s FSTrapdatumSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery] {
|
|||
func (s FSTrapdatumSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 46)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -1391,7 +1391,7 @@ func (o *FSTrapdatum) Organization(mods ...bob.Mod[*dialect.SelectQuery]) Organi
|
|||
}
|
||||
|
||||
func (os FSTrapdatumSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -1409,7 +1409,7 @@ func (os FSTrapdatumSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) O
|
|||
|
||||
func attachFSTrapdatumOrganization0(ctx context.Context, exec bob.Executor, count int, fsTrapdatum0 *FSTrapdatum, organization1 *Organization) (*FSTrapdatum, error) {
|
||||
setter := &FSTrapdatumSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := fsTrapdatum0.Update(ctx, exec, setter)
|
||||
|
|
@ -1456,7 +1456,7 @@ func (fsTrapdatum0 *FSTrapdatum) AttachOrganization(ctx context.Context, exec bo
|
|||
}
|
||||
|
||||
type fsTrapdatumWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Avetemp psql.WhereNullMod[Q, float64]
|
||||
Comments psql.WhereNullMod[Q, string]
|
||||
Creationdate psql.WhereNullMod[Q, int64]
|
||||
|
|
@ -1510,7 +1510,7 @@ func (fsTrapdatumWhere[Q]) AliasedAs(alias string) fsTrapdatumWhere[Q] {
|
|||
|
||||
func buildFSTrapdatumWhere[Q psql.Filterable](cols fsTrapdatumColumns) fsTrapdatumWhere[Q] {
|
||||
return fsTrapdatumWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Avetemp: psql.WhereNull[Q, float64](cols.Avetemp),
|
||||
Comments: psql.WhereNull[Q, string](cols.Comments),
|
||||
Creationdate: psql.WhereNull[Q, int64](cols.Creationdate),
|
||||
|
|
@ -1660,11 +1660,8 @@ func (os FSTrapdatumSlice) LoadOrganization(ctx context.Context, exec bob.Execut
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import (
|
|||
|
||||
// FSTraplocation is an object representing the database table.
|
||||
type FSTraplocation struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Accessdesc null.Val[string] `db:"accessdesc" `
|
||||
Active null.Val[int16] `db:"active" `
|
||||
Comments null.Val[string] `db:"comments" `
|
||||
|
|
@ -173,7 +173,7 @@ func (fsTraplocationColumns) AliasedAs(alias string) fsTraplocationColumns {
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type FSTraplocationSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Accessdesc omitnull.Val[string] `db:"accessdesc" `
|
||||
Active omitnull.Val[int16] `db:"active" `
|
||||
Comments omitnull.Val[string] `db:"comments" `
|
||||
|
|
@ -211,7 +211,7 @@ type FSTraplocationSetter struct {
|
|||
|
||||
func (s FSTraplocationSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 34)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Accessdesc.IsUnset() {
|
||||
|
|
@ -317,8 +317,8 @@ func (s FSTraplocationSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s FSTraplocationSetter) Overwrite(t *FSTraplocation) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Accessdesc.IsUnset() {
|
||||
t.Accessdesc = s.Accessdesc.MustGetNull()
|
||||
|
|
@ -428,8 +428,8 @@ func (s *FSTraplocationSetter) Apply(q *dialect.InsertQuery) {
|
|||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 34)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -643,7 +643,7 @@ func (s FSTraplocationSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery] {
|
|||
func (s FSTraplocationSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 34)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -1115,7 +1115,7 @@ func (o *FSTraplocation) Organization(mods ...bob.Mod[*dialect.SelectQuery]) Org
|
|||
}
|
||||
|
||||
func (os FSTraplocationSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -1133,7 +1133,7 @@ func (os FSTraplocationSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]
|
|||
|
||||
func attachFSTraplocationOrganization0(ctx context.Context, exec bob.Executor, count int, fsTraplocation0 *FSTraplocation, organization1 *Organization) (*FSTraplocation, error) {
|
||||
setter := &FSTraplocationSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := fsTraplocation0.Update(ctx, exec, setter)
|
||||
|
|
@ -1180,7 +1180,7 @@ func (fsTraplocation0 *FSTraplocation) AttachOrganization(ctx context.Context, e
|
|||
}
|
||||
|
||||
type fsTraplocationWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Accessdesc psql.WhereNullMod[Q, string]
|
||||
Active psql.WhereNullMod[Q, int16]
|
||||
Comments psql.WhereNullMod[Q, string]
|
||||
|
|
@ -1222,7 +1222,7 @@ func (fsTraplocationWhere[Q]) AliasedAs(alias string) fsTraplocationWhere[Q] {
|
|||
|
||||
func buildFSTraplocationWhere[Q psql.Filterable](cols fsTraplocationColumns) fsTraplocationWhere[Q] {
|
||||
return fsTraplocationWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Accessdesc: psql.WhereNull[Q, string](cols.Accessdesc),
|
||||
Active: psql.WhereNull[Q, int16](cols.Active),
|
||||
Comments: psql.WhereNull[Q, string](cols.Comments),
|
||||
|
|
@ -1360,11 +1360,8 @@ func (os FSTraplocationSlice) LoadOrganization(ctx context.Context, exec bob.Exe
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import (
|
|||
|
||||
// FSTreatment is an object representing the database table.
|
||||
type FSTreatment struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Activity null.Val[string] `db:"activity" `
|
||||
Areaunit null.Val[string] `db:"areaunit" `
|
||||
Avetemp null.Val[float64] `db:"avetemp" `
|
||||
|
|
@ -245,7 +245,7 @@ func (fsTreatmentColumns) AliasedAs(alias string) fsTreatmentColumns {
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type FSTreatmentSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Activity omitnull.Val[string] `db:"activity" `
|
||||
Areaunit omitnull.Val[string] `db:"areaunit" `
|
||||
Avetemp omitnull.Val[float64] `db:"avetemp" `
|
||||
|
|
@ -307,7 +307,7 @@ type FSTreatmentSetter struct {
|
|||
|
||||
func (s FSTreatmentSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 58)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Activity.IsUnset() {
|
||||
|
|
@ -485,8 +485,8 @@ func (s FSTreatmentSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s FSTreatmentSetter) Overwrite(t *FSTreatment) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Activity.IsUnset() {
|
||||
t.Activity = s.Activity.MustGetNull()
|
||||
|
|
@ -668,8 +668,8 @@ func (s *FSTreatmentSetter) Apply(q *dialect.InsertQuery) {
|
|||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 58)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -1027,7 +1027,7 @@ func (s FSTreatmentSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery] {
|
|||
func (s FSTreatmentSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 58)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -1667,7 +1667,7 @@ func (o *FSTreatment) Organization(mods ...bob.Mod[*dialect.SelectQuery]) Organi
|
|||
}
|
||||
|
||||
func (os FSTreatmentSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -1685,7 +1685,7 @@ func (os FSTreatmentSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) O
|
|||
|
||||
func attachFSTreatmentOrganization0(ctx context.Context, exec bob.Executor, count int, fsTreatment0 *FSTreatment, organization1 *Organization) (*FSTreatment, error) {
|
||||
setter := &FSTreatmentSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := fsTreatment0.Update(ctx, exec, setter)
|
||||
|
|
@ -1732,7 +1732,7 @@ func (fsTreatment0 *FSTreatment) AttachOrganization(ctx context.Context, exec bo
|
|||
}
|
||||
|
||||
type fsTreatmentWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Activity psql.WhereNullMod[Q, string]
|
||||
Areaunit psql.WhereNullMod[Q, string]
|
||||
Avetemp psql.WhereNullMod[Q, float64]
|
||||
|
|
@ -1798,7 +1798,7 @@ func (fsTreatmentWhere[Q]) AliasedAs(alias string) fsTreatmentWhere[Q] {
|
|||
|
||||
func buildFSTreatmentWhere[Q psql.Filterable](cols fsTreatmentColumns) fsTreatmentWhere[Q] {
|
||||
return fsTreatmentWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Activity: psql.WhereNull[Q, string](cols.Activity),
|
||||
Areaunit: psql.WhereNull[Q, string](cols.Areaunit),
|
||||
Avetemp: psql.WhereNull[Q, float64](cols.Avetemp),
|
||||
|
|
@ -1960,11 +1960,8 @@ func (os FSTreatmentSlice) LoadOrganization(ctx context.Context, exec bob.Execut
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import (
|
|||
|
||||
// FSTreatmentarea is an object representing the database table.
|
||||
type FSTreatmentarea struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Comments null.Val[string] `db:"comments" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
|
|
@ -137,7 +137,7 @@ func (fsTreatmentareaColumns) AliasedAs(alias string) fsTreatmentareaColumns {
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type FSTreatmentareaSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Comments omitnull.Val[string] `db:"comments" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
|
|
@ -163,7 +163,7 @@ type FSTreatmentareaSetter struct {
|
|||
|
||||
func (s FSTreatmentareaSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 22)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Comments.IsUnset() {
|
||||
|
|
@ -233,8 +233,8 @@ func (s FSTreatmentareaSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s FSTreatmentareaSetter) Overwrite(t *FSTreatmentarea) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Comments.IsUnset() {
|
||||
t.Comments = s.Comments.MustGetNull()
|
||||
|
|
@ -308,8 +308,8 @@ func (s *FSTreatmentareaSetter) Apply(q *dialect.InsertQuery) {
|
|||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 22)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -451,7 +451,7 @@ func (s FSTreatmentareaSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery] {
|
|||
func (s FSTreatmentareaSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 22)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -839,7 +839,7 @@ func (o *FSTreatmentarea) Organization(mods ...bob.Mod[*dialect.SelectQuery]) Or
|
|||
}
|
||||
|
||||
func (os FSTreatmentareaSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -857,7 +857,7 @@ func (os FSTreatmentareaSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery
|
|||
|
||||
func attachFSTreatmentareaOrganization0(ctx context.Context, exec bob.Executor, count int, fsTreatmentarea0 *FSTreatmentarea, organization1 *Organization) (*FSTreatmentarea, error) {
|
||||
setter := &FSTreatmentareaSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := fsTreatmentarea0.Update(ctx, exec, setter)
|
||||
|
|
@ -904,7 +904,7 @@ func (fsTreatmentarea0 *FSTreatmentarea) AttachOrganization(ctx context.Context,
|
|||
}
|
||||
|
||||
type fsTreatmentareaWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Comments psql.WhereNullMod[Q, string]
|
||||
Creationdate psql.WhereNullMod[Q, int64]
|
||||
Creator psql.WhereNullMod[Q, string]
|
||||
|
|
@ -934,7 +934,7 @@ func (fsTreatmentareaWhere[Q]) AliasedAs(alias string) fsTreatmentareaWhere[Q] {
|
|||
|
||||
func buildFSTreatmentareaWhere[Q psql.Filterable](cols fsTreatmentareaColumns) fsTreatmentareaWhere[Q] {
|
||||
return fsTreatmentareaWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Comments: psql.WhereNull[Q, string](cols.Comments),
|
||||
Creationdate: psql.WhereNull[Q, int64](cols.Creationdate),
|
||||
Creator: psql.WhereNull[Q, string](cols.Creator),
|
||||
|
|
@ -1060,11 +1060,8 @@ func (os FSTreatmentareaSlice) LoadOrganization(ctx context.Context, exec bob.Ex
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import (
|
|||
|
||||
// FSZone is an object representing the database table.
|
||||
type FSZone struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Active null.Val[int64] `db:"active" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
|
|
@ -125,7 +125,7 @@ func (fsZoneColumns) AliasedAs(alias string) fsZoneColumns {
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type FSZoneSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Active omitnull.Val[int64] `db:"active" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
|
|
@ -147,7 +147,7 @@ type FSZoneSetter struct {
|
|||
|
||||
func (s FSZoneSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 18)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Active.IsUnset() {
|
||||
|
|
@ -205,8 +205,8 @@ func (s FSZoneSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s FSZoneSetter) Overwrite(t *FSZone) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Active.IsUnset() {
|
||||
t.Active = s.Active.MustGetNull()
|
||||
|
|
@ -268,8 +268,8 @@ func (s *FSZoneSetter) Apply(q *dialect.InsertQuery) {
|
|||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 18)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -387,7 +387,7 @@ func (s FSZoneSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery] {
|
|||
func (s FSZoneSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 18)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -747,7 +747,7 @@ func (o *FSZone) Organization(mods ...bob.Mod[*dialect.SelectQuery]) Organizatio
|
|||
}
|
||||
|
||||
func (os FSZoneSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -765,7 +765,7 @@ func (os FSZoneSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) Organi
|
|||
|
||||
func attachFSZoneOrganization0(ctx context.Context, exec bob.Executor, count int, fsZone0 *FSZone, organization1 *Organization) (*FSZone, error) {
|
||||
setter := &FSZoneSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := fsZone0.Update(ctx, exec, setter)
|
||||
|
|
@ -812,7 +812,7 @@ func (fsZone0 *FSZone) AttachOrganization(ctx context.Context, exec bob.Executor
|
|||
}
|
||||
|
||||
type fsZoneWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Active psql.WhereNullMod[Q, int64]
|
||||
Creationdate psql.WhereNullMod[Q, int64]
|
||||
Creator psql.WhereNullMod[Q, string]
|
||||
|
|
@ -838,7 +838,7 @@ func (fsZoneWhere[Q]) AliasedAs(alias string) fsZoneWhere[Q] {
|
|||
|
||||
func buildFSZoneWhere[Q psql.Filterable](cols fsZoneColumns) fsZoneWhere[Q] {
|
||||
return fsZoneWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Active: psql.WhereNull[Q, int64](cols.Active),
|
||||
Creationdate: psql.WhereNull[Q, int64](cols.Creationdate),
|
||||
Creator: psql.WhereNull[Q, string](cols.Creator),
|
||||
|
|
@ -960,11 +960,8 @@ func (os FSZoneSlice) LoadOrganization(ctx context.Context, exec bob.Executor, m
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import (
|
|||
|
||||
// FSZones2 is an object representing the database table.
|
||||
type FSZones2 struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
|
|
@ -122,7 +122,7 @@ func (fsZones2Columns) AliasedAs(alias string) fsZones2Columns {
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type FSZones2Setter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
|
|
@ -143,7 +143,7 @@ type FSZones2Setter struct {
|
|||
|
||||
func (s FSZones2Setter) SetColumns() []string {
|
||||
vals := make([]string, 0, 17)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Creationdate.IsUnset() {
|
||||
|
|
@ -198,8 +198,8 @@ func (s FSZones2Setter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s FSZones2Setter) Overwrite(t *FSZones2) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Creationdate.IsUnset() {
|
||||
t.Creationdate = s.Creationdate.MustGetNull()
|
||||
|
|
@ -258,8 +258,8 @@ func (s *FSZones2Setter) Apply(q *dialect.InsertQuery) {
|
|||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 17)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -371,7 +371,7 @@ func (s FSZones2Setter) UpdateMod() bob.Mod[*dialect.UpdateQuery] {
|
|||
func (s FSZones2Setter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 17)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -724,7 +724,7 @@ func (o *FSZones2) Organization(mods ...bob.Mod[*dialect.SelectQuery]) Organizat
|
|||
}
|
||||
|
||||
func (os FSZones2Slice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -742,7 +742,7 @@ func (os FSZones2Slice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) Orga
|
|||
|
||||
func attachFSZones2Organization0(ctx context.Context, exec bob.Executor, count int, fsZones20 *FSZones2, organization1 *Organization) (*FSZones2, error) {
|
||||
setter := &FSZones2Setter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := fsZones20.Update(ctx, exec, setter)
|
||||
|
|
@ -789,7 +789,7 @@ func (fsZones20 *FSZones2) AttachOrganization(ctx context.Context, exec bob.Exec
|
|||
}
|
||||
|
||||
type fsZones2Where[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Creationdate psql.WhereNullMod[Q, int64]
|
||||
Creator psql.WhereNullMod[Q, string]
|
||||
Editdate psql.WhereNullMod[Q, int64]
|
||||
|
|
@ -814,7 +814,7 @@ func (fsZones2Where[Q]) AliasedAs(alias string) fsZones2Where[Q] {
|
|||
|
||||
func buildFSZones2Where[Q psql.Filterable](cols fsZones2Columns) fsZones2Where[Q] {
|
||||
return fsZones2Where[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Creationdate: psql.WhereNull[Q, int64](cols.Creationdate),
|
||||
Creator: psql.WhereNull[Q, string](cols.Creator),
|
||||
Editdate: psql.WhereNull[Q, int64](cols.Editdate),
|
||||
|
|
@ -935,11 +935,8 @@ func (os FSZones2Slice) LoadOrganization(ctx context.Context, exec bob.Executor,
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"time"
|
||||
|
||||
"github.com/aarondl/opt/null"
|
||||
"github.com/aarondl/opt/omit"
|
||||
|
|
@ -25,24 +26,25 @@ import (
|
|||
|
||||
// HistoryContainerrelate is an object representing the database table.
|
||||
type HistoryContainerrelate struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
Containertype null.Val[string] `db:"containertype" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
Editor null.Val[string] `db:"editor" `
|
||||
Globalid null.Val[string] `db:"globalid" `
|
||||
Inspsampleid null.Val[string] `db:"inspsampleid" `
|
||||
Mosquitoinspid null.Val[string] `db:"mosquitoinspid" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
Treatmentid null.Val[string] `db:"treatmentid" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Version int32 `db:"version,pk" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Containertype null.Val[string] `db:"containertype" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
Editor null.Val[string] `db:"editor" `
|
||||
Globalid null.Val[string] `db:"globalid" `
|
||||
Inspsampleid null.Val[string] `db:"inspsampleid" `
|
||||
Mosquitoinspid null.Val[string] `db:"mosquitoinspid" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
Treatmentid null.Val[string] `db:"treatmentid" `
|
||||
Created null.Val[time.Time] `db:"created" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Version int32 `db:"version,pk" `
|
||||
|
||||
R historyContainerrelateR `db:"-" `
|
||||
}
|
||||
|
|
@ -65,7 +67,7 @@ type historyContainerrelateR struct {
|
|||
func buildHistoryContainerrelateColumns(alias string) historyContainerrelateColumns {
|
||||
return historyContainerrelateColumns{
|
||||
ColumnsExpr: expr.NewColumnsExpr(
|
||||
"organization_id", "containertype", "creationdate", "creator", "editdate", "editor", "globalid", "inspsampleid", "mosquitoinspid", "objectid", "treatmentid", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "version",
|
||||
"organization_id", "containertype", "creationdate", "creator", "editdate", "editor", "globalid", "inspsampleid", "mosquitoinspid", "objectid", "treatmentid", "created", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "version",
|
||||
).WithParent("history_containerrelate"),
|
||||
tableAlias: alias,
|
||||
OrganizationID: psql.Quote(alias, "organization_id"),
|
||||
|
|
@ -79,6 +81,7 @@ func buildHistoryContainerrelateColumns(alias string) historyContainerrelateColu
|
|||
Mosquitoinspid: psql.Quote(alias, "mosquitoinspid"),
|
||||
Objectid: psql.Quote(alias, "objectid"),
|
||||
Treatmentid: psql.Quote(alias, "treatmentid"),
|
||||
Created: psql.Quote(alias, "created"),
|
||||
CreatedDate: psql.Quote(alias, "created_date"),
|
||||
CreatedUser: psql.Quote(alias, "created_user"),
|
||||
GeometryX: psql.Quote(alias, "geometry_x"),
|
||||
|
|
@ -103,6 +106,7 @@ type historyContainerrelateColumns struct {
|
|||
Mosquitoinspid psql.Expression
|
||||
Objectid psql.Expression
|
||||
Treatmentid psql.Expression
|
||||
Created psql.Expression
|
||||
CreatedDate psql.Expression
|
||||
CreatedUser psql.Expression
|
||||
GeometryX psql.Expression
|
||||
|
|
@ -124,29 +128,30 @@ func (historyContainerrelateColumns) AliasedAs(alias string) historyContainerrel
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type HistoryContainerrelateSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
Containertype omitnull.Val[string] `db:"containertype" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
Editor omitnull.Val[string] `db:"editor" `
|
||||
Globalid omitnull.Val[string] `db:"globalid" `
|
||||
Inspsampleid omitnull.Val[string] `db:"inspsampleid" `
|
||||
Mosquitoinspid omitnull.Val[string] `db:"mosquitoinspid" `
|
||||
Objectid omit.Val[int32] `db:"objectid,pk" `
|
||||
Treatmentid omitnull.Val[string] `db:"treatmentid" `
|
||||
CreatedDate omitnull.Val[int64] `db:"created_date" `
|
||||
CreatedUser omitnull.Val[string] `db:"created_user" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Containertype omitnull.Val[string] `db:"containertype" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
Editor omitnull.Val[string] `db:"editor" `
|
||||
Globalid omitnull.Val[string] `db:"globalid" `
|
||||
Inspsampleid omitnull.Val[string] `db:"inspsampleid" `
|
||||
Mosquitoinspid omitnull.Val[string] `db:"mosquitoinspid" `
|
||||
Objectid omit.Val[int32] `db:"objectid,pk" `
|
||||
Treatmentid omitnull.Val[string] `db:"treatmentid" `
|
||||
Created omitnull.Val[time.Time] `db:"created" `
|
||||
CreatedDate omitnull.Val[int64] `db:"created_date" `
|
||||
CreatedUser omitnull.Val[string] `db:"created_user" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
}
|
||||
|
||||
func (s HistoryContainerrelateSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 18)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals := make([]string, 0, 19)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Containertype.IsUnset() {
|
||||
|
|
@ -179,6 +184,9 @@ func (s HistoryContainerrelateSetter) SetColumns() []string {
|
|||
if !s.Treatmentid.IsUnset() {
|
||||
vals = append(vals, "treatmentid")
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
vals = append(vals, "created")
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals = append(vals, "created_date")
|
||||
}
|
||||
|
|
@ -204,8 +212,8 @@ func (s HistoryContainerrelateSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s HistoryContainerrelateSetter) Overwrite(t *HistoryContainerrelate) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Containertype.IsUnset() {
|
||||
t.Containertype = s.Containertype.MustGetNull()
|
||||
|
|
@ -237,6 +245,9 @@ func (s HistoryContainerrelateSetter) Overwrite(t *HistoryContainerrelate) {
|
|||
if !s.Treatmentid.IsUnset() {
|
||||
t.Treatmentid = s.Treatmentid.MustGetNull()
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
t.Created = s.Created.MustGetNull()
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
t.CreatedDate = s.CreatedDate.MustGetNull()
|
||||
}
|
||||
|
|
@ -266,9 +277,9 @@ func (s *HistoryContainerrelateSetter) Apply(q *dialect.InsertQuery) {
|
|||
})
|
||||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 18)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
vals := make([]bob.Expression, 19)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -333,48 +344,54 @@ func (s *HistoryContainerrelateSetter) Apply(q *dialect.InsertQuery) {
|
|||
vals[10] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[11] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
if !s.Created.IsUnset() {
|
||||
vals[11] = psql.Arg(s.Created.MustGetNull())
|
||||
} else {
|
||||
vals[11] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[12] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[12] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
} else {
|
||||
vals[12] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[13] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[13] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
} else {
|
||||
vals[13] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[14] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[14] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
} else {
|
||||
vals[14] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[15] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[15] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
} else {
|
||||
vals[15] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[16] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[16] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
} else {
|
||||
vals[16] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[17] = psql.Arg(s.Version.MustGet())
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[17] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
} else {
|
||||
vals[17] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[18] = psql.Arg(s.Version.MustGet())
|
||||
} else {
|
||||
vals[18] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
return bob.ExpressSlice(ctx, w, d, start, vals, "", ", ", "")
|
||||
}))
|
||||
}
|
||||
|
|
@ -384,9 +401,9 @@ func (s HistoryContainerrelateSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery]
|
|||
}
|
||||
|
||||
func (s HistoryContainerrelateSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 18)
|
||||
exprs := make([]bob.Expression, 0, 19)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -463,6 +480,13 @@ func (s HistoryContainerrelateSetter) Expressions(prefix ...string) []bob.Expres
|
|||
}})
|
||||
}
|
||||
|
||||
if !s.Created.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created")...),
|
||||
psql.Arg(s.Created),
|
||||
}})
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created_date")...),
|
||||
|
|
@ -756,7 +780,7 @@ func (o *HistoryContainerrelate) Organization(mods ...bob.Mod[*dialect.SelectQue
|
|||
}
|
||||
|
||||
func (os HistoryContainerrelateSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -774,7 +798,7 @@ func (os HistoryContainerrelateSlice) Organization(mods ...bob.Mod[*dialect.Sele
|
|||
|
||||
func attachHistoryContainerrelateOrganization0(ctx context.Context, exec bob.Executor, count int, historyContainerrelate0 *HistoryContainerrelate, organization1 *Organization) (*HistoryContainerrelate, error) {
|
||||
setter := &HistoryContainerrelateSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := historyContainerrelate0.Update(ctx, exec, setter)
|
||||
|
|
@ -821,7 +845,7 @@ func (historyContainerrelate0 *HistoryContainerrelate) AttachOrganization(ctx co
|
|||
}
|
||||
|
||||
type historyContainerrelateWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Containertype psql.WhereNullMod[Q, string]
|
||||
Creationdate psql.WhereNullMod[Q, int64]
|
||||
Creator psql.WhereNullMod[Q, string]
|
||||
|
|
@ -832,6 +856,7 @@ type historyContainerrelateWhere[Q psql.Filterable] struct {
|
|||
Mosquitoinspid psql.WhereNullMod[Q, string]
|
||||
Objectid psql.WhereMod[Q, int32]
|
||||
Treatmentid psql.WhereNullMod[Q, string]
|
||||
Created psql.WhereNullMod[Q, time.Time]
|
||||
CreatedDate psql.WhereNullMod[Q, int64]
|
||||
CreatedUser psql.WhereNullMod[Q, string]
|
||||
GeometryX psql.WhereNullMod[Q, float64]
|
||||
|
|
@ -847,7 +872,7 @@ func (historyContainerrelateWhere[Q]) AliasedAs(alias string) historyContainerre
|
|||
|
||||
func buildHistoryContainerrelateWhere[Q psql.Filterable](cols historyContainerrelateColumns) historyContainerrelateWhere[Q] {
|
||||
return historyContainerrelateWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Containertype: psql.WhereNull[Q, string](cols.Containertype),
|
||||
Creationdate: psql.WhereNull[Q, int64](cols.Creationdate),
|
||||
Creator: psql.WhereNull[Q, string](cols.Creator),
|
||||
|
|
@ -858,6 +883,7 @@ func buildHistoryContainerrelateWhere[Q psql.Filterable](cols historyContainerre
|
|||
Mosquitoinspid: psql.WhereNull[Q, string](cols.Mosquitoinspid),
|
||||
Objectid: psql.Where[Q, int32](cols.Objectid),
|
||||
Treatmentid: psql.WhereNull[Q, string](cols.Treatmentid),
|
||||
Created: psql.WhereNull[Q, time.Time](cols.Created),
|
||||
CreatedDate: psql.WhereNull[Q, int64](cols.CreatedDate),
|
||||
CreatedUser: psql.WhereNull[Q, string](cols.CreatedUser),
|
||||
GeometryX: psql.WhereNull[Q, float64](cols.GeometryX),
|
||||
|
|
@ -969,11 +995,8 @@ func (os HistoryContainerrelateSlice) LoadOrganization(ctx context.Context, exec
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"time"
|
||||
|
||||
"github.com/aarondl/opt/null"
|
||||
"github.com/aarondl/opt/omit"
|
||||
|
|
@ -25,21 +26,22 @@ import (
|
|||
|
||||
// HistoryFieldscoutinglog is an object representing the database table.
|
||||
type HistoryFieldscoutinglog struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
Editor null.Val[string] `db:"editor" `
|
||||
Globalid null.Val[string] `db:"globalid" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
Status null.Val[int16] `db:"status" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Version int32 `db:"version,pk" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
Editor null.Val[string] `db:"editor" `
|
||||
Globalid null.Val[string] `db:"globalid" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
Status null.Val[int16] `db:"status" `
|
||||
Created null.Val[time.Time] `db:"created" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Version int32 `db:"version,pk" `
|
||||
|
||||
R historyFieldscoutinglogR `db:"-" `
|
||||
}
|
||||
|
|
@ -62,7 +64,7 @@ type historyFieldscoutinglogR struct {
|
|||
func buildHistoryFieldscoutinglogColumns(alias string) historyFieldscoutinglogColumns {
|
||||
return historyFieldscoutinglogColumns{
|
||||
ColumnsExpr: expr.NewColumnsExpr(
|
||||
"organization_id", "creationdate", "creator", "editdate", "editor", "globalid", "objectid", "status", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "version",
|
||||
"organization_id", "creationdate", "creator", "editdate", "editor", "globalid", "objectid", "status", "created", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "version",
|
||||
).WithParent("history_fieldscoutinglog"),
|
||||
tableAlias: alias,
|
||||
OrganizationID: psql.Quote(alias, "organization_id"),
|
||||
|
|
@ -73,6 +75,7 @@ func buildHistoryFieldscoutinglogColumns(alias string) historyFieldscoutinglogCo
|
|||
Globalid: psql.Quote(alias, "globalid"),
|
||||
Objectid: psql.Quote(alias, "objectid"),
|
||||
Status: psql.Quote(alias, "status"),
|
||||
Created: psql.Quote(alias, "created"),
|
||||
CreatedDate: psql.Quote(alias, "created_date"),
|
||||
CreatedUser: psql.Quote(alias, "created_user"),
|
||||
GeometryX: psql.Quote(alias, "geometry_x"),
|
||||
|
|
@ -94,6 +97,7 @@ type historyFieldscoutinglogColumns struct {
|
|||
Globalid psql.Expression
|
||||
Objectid psql.Expression
|
||||
Status psql.Expression
|
||||
Created psql.Expression
|
||||
CreatedDate psql.Expression
|
||||
CreatedUser psql.Expression
|
||||
GeometryX psql.Expression
|
||||
|
|
@ -115,26 +119,27 @@ func (historyFieldscoutinglogColumns) AliasedAs(alias string) historyFieldscouti
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type HistoryFieldscoutinglogSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
Editor omitnull.Val[string] `db:"editor" `
|
||||
Globalid omitnull.Val[string] `db:"globalid" `
|
||||
Objectid omit.Val[int32] `db:"objectid,pk" `
|
||||
Status omitnull.Val[int16] `db:"status" `
|
||||
CreatedDate omitnull.Val[int64] `db:"created_date" `
|
||||
CreatedUser omitnull.Val[string] `db:"created_user" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
Editor omitnull.Val[string] `db:"editor" `
|
||||
Globalid omitnull.Val[string] `db:"globalid" `
|
||||
Objectid omit.Val[int32] `db:"objectid,pk" `
|
||||
Status omitnull.Val[int16] `db:"status" `
|
||||
Created omitnull.Val[time.Time] `db:"created" `
|
||||
CreatedDate omitnull.Val[int64] `db:"created_date" `
|
||||
CreatedUser omitnull.Val[string] `db:"created_user" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
}
|
||||
|
||||
func (s HistoryFieldscoutinglogSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 15)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals := make([]string, 0, 16)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Creationdate.IsUnset() {
|
||||
|
|
@ -158,6 +163,9 @@ func (s HistoryFieldscoutinglogSetter) SetColumns() []string {
|
|||
if !s.Status.IsUnset() {
|
||||
vals = append(vals, "status")
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
vals = append(vals, "created")
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals = append(vals, "created_date")
|
||||
}
|
||||
|
|
@ -183,8 +191,8 @@ func (s HistoryFieldscoutinglogSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s HistoryFieldscoutinglogSetter) Overwrite(t *HistoryFieldscoutinglog) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Creationdate.IsUnset() {
|
||||
t.Creationdate = s.Creationdate.MustGetNull()
|
||||
|
|
@ -207,6 +215,9 @@ func (s HistoryFieldscoutinglogSetter) Overwrite(t *HistoryFieldscoutinglog) {
|
|||
if !s.Status.IsUnset() {
|
||||
t.Status = s.Status.MustGetNull()
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
t.Created = s.Created.MustGetNull()
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
t.CreatedDate = s.CreatedDate.MustGetNull()
|
||||
}
|
||||
|
|
@ -236,9 +247,9 @@ func (s *HistoryFieldscoutinglogSetter) Apply(q *dialect.InsertQuery) {
|
|||
})
|
||||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 15)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
vals := make([]bob.Expression, 16)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -285,48 +296,54 @@ func (s *HistoryFieldscoutinglogSetter) Apply(q *dialect.InsertQuery) {
|
|||
vals[7] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[8] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
if !s.Created.IsUnset() {
|
||||
vals[8] = psql.Arg(s.Created.MustGetNull())
|
||||
} else {
|
||||
vals[8] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[9] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[9] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
} else {
|
||||
vals[9] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[10] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[10] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
} else {
|
||||
vals[10] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[11] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[11] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
} else {
|
||||
vals[11] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[12] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[12] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
} else {
|
||||
vals[12] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[13] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[13] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
} else {
|
||||
vals[13] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[14] = psql.Arg(s.Version.MustGet())
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[14] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
} else {
|
||||
vals[14] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[15] = psql.Arg(s.Version.MustGet())
|
||||
} else {
|
||||
vals[15] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
return bob.ExpressSlice(ctx, w, d, start, vals, "", ", ", "")
|
||||
}))
|
||||
}
|
||||
|
|
@ -336,9 +353,9 @@ func (s HistoryFieldscoutinglogSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery]
|
|||
}
|
||||
|
||||
func (s HistoryFieldscoutinglogSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 15)
|
||||
exprs := make([]bob.Expression, 0, 16)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -394,6 +411,13 @@ func (s HistoryFieldscoutinglogSetter) Expressions(prefix ...string) []bob.Expre
|
|||
}})
|
||||
}
|
||||
|
||||
if !s.Created.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created")...),
|
||||
psql.Arg(s.Created),
|
||||
}})
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created_date")...),
|
||||
|
|
@ -687,7 +711,7 @@ func (o *HistoryFieldscoutinglog) Organization(mods ...bob.Mod[*dialect.SelectQu
|
|||
}
|
||||
|
||||
func (os HistoryFieldscoutinglogSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -705,7 +729,7 @@ func (os HistoryFieldscoutinglogSlice) Organization(mods ...bob.Mod[*dialect.Sel
|
|||
|
||||
func attachHistoryFieldscoutinglogOrganization0(ctx context.Context, exec bob.Executor, count int, historyFieldscoutinglog0 *HistoryFieldscoutinglog, organization1 *Organization) (*HistoryFieldscoutinglog, error) {
|
||||
setter := &HistoryFieldscoutinglogSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := historyFieldscoutinglog0.Update(ctx, exec, setter)
|
||||
|
|
@ -752,7 +776,7 @@ func (historyFieldscoutinglog0 *HistoryFieldscoutinglog) AttachOrganization(ctx
|
|||
}
|
||||
|
||||
type historyFieldscoutinglogWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Creationdate psql.WhereNullMod[Q, int64]
|
||||
Creator psql.WhereNullMod[Q, string]
|
||||
Editdate psql.WhereNullMod[Q, int64]
|
||||
|
|
@ -760,6 +784,7 @@ type historyFieldscoutinglogWhere[Q psql.Filterable] struct {
|
|||
Globalid psql.WhereNullMod[Q, string]
|
||||
Objectid psql.WhereMod[Q, int32]
|
||||
Status psql.WhereNullMod[Q, int16]
|
||||
Created psql.WhereNullMod[Q, time.Time]
|
||||
CreatedDate psql.WhereNullMod[Q, int64]
|
||||
CreatedUser psql.WhereNullMod[Q, string]
|
||||
GeometryX psql.WhereNullMod[Q, float64]
|
||||
|
|
@ -775,7 +800,7 @@ func (historyFieldscoutinglogWhere[Q]) AliasedAs(alias string) historyFieldscout
|
|||
|
||||
func buildHistoryFieldscoutinglogWhere[Q psql.Filterable](cols historyFieldscoutinglogColumns) historyFieldscoutinglogWhere[Q] {
|
||||
return historyFieldscoutinglogWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Creationdate: psql.WhereNull[Q, int64](cols.Creationdate),
|
||||
Creator: psql.WhereNull[Q, string](cols.Creator),
|
||||
Editdate: psql.WhereNull[Q, int64](cols.Editdate),
|
||||
|
|
@ -783,6 +808,7 @@ func buildHistoryFieldscoutinglogWhere[Q psql.Filterable](cols historyFieldscout
|
|||
Globalid: psql.WhereNull[Q, string](cols.Globalid),
|
||||
Objectid: psql.Where[Q, int32](cols.Objectid),
|
||||
Status: psql.WhereNull[Q, int16](cols.Status),
|
||||
Created: psql.WhereNull[Q, time.Time](cols.Created),
|
||||
CreatedDate: psql.WhereNull[Q, int64](cols.CreatedDate),
|
||||
CreatedUser: psql.WhereNull[Q, string](cols.CreatedUser),
|
||||
GeometryX: psql.WhereNull[Q, float64](cols.GeometryX),
|
||||
|
|
@ -894,11 +920,8 @@ func (os HistoryFieldscoutinglogSlice) LoadOrganization(ctx context.Context, exe
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"time"
|
||||
|
||||
"github.com/aarondl/opt/null"
|
||||
"github.com/aarondl/opt/omit"
|
||||
|
|
@ -25,22 +26,23 @@ import (
|
|||
|
||||
// HistoryHabitatrelate is an object representing the database table.
|
||||
type HistoryHabitatrelate struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
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" `
|
||||
Habitattype null.Val[string] `db:"habitattype" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Version int32 `db:"version,pk" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
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" `
|
||||
Habitattype null.Val[string] `db:"habitattype" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
Created null.Val[time.Time] `db:"created" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Version int32 `db:"version,pk" `
|
||||
|
||||
R historyHabitatrelateR `db:"-" `
|
||||
}
|
||||
|
|
@ -63,7 +65,7 @@ type historyHabitatrelateR struct {
|
|||
func buildHistoryHabitatrelateColumns(alias string) historyHabitatrelateColumns {
|
||||
return historyHabitatrelateColumns{
|
||||
ColumnsExpr: expr.NewColumnsExpr(
|
||||
"organization_id", "creationdate", "creator", "editdate", "editor", "foreign_id", "globalid", "habitattype", "objectid", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "version",
|
||||
"organization_id", "creationdate", "creator", "editdate", "editor", "foreign_id", "globalid", "habitattype", "objectid", "created", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "version",
|
||||
).WithParent("history_habitatrelate"),
|
||||
tableAlias: alias,
|
||||
OrganizationID: psql.Quote(alias, "organization_id"),
|
||||
|
|
@ -75,6 +77,7 @@ func buildHistoryHabitatrelateColumns(alias string) historyHabitatrelateColumns
|
|||
Globalid: psql.Quote(alias, "globalid"),
|
||||
Habitattype: psql.Quote(alias, "habitattype"),
|
||||
Objectid: psql.Quote(alias, "objectid"),
|
||||
Created: psql.Quote(alias, "created"),
|
||||
CreatedDate: psql.Quote(alias, "created_date"),
|
||||
CreatedUser: psql.Quote(alias, "created_user"),
|
||||
GeometryX: psql.Quote(alias, "geometry_x"),
|
||||
|
|
@ -97,6 +100,7 @@ type historyHabitatrelateColumns struct {
|
|||
Globalid psql.Expression
|
||||
Habitattype psql.Expression
|
||||
Objectid psql.Expression
|
||||
Created psql.Expression
|
||||
CreatedDate psql.Expression
|
||||
CreatedUser psql.Expression
|
||||
GeometryX psql.Expression
|
||||
|
|
@ -118,27 +122,28 @@ func (historyHabitatrelateColumns) AliasedAs(alias string) historyHabitatrelateC
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type HistoryHabitatrelateSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
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" `
|
||||
Habitattype omitnull.Val[string] `db:"habitattype" `
|
||||
Objectid omit.Val[int32] `db:"objectid,pk" `
|
||||
CreatedDate omitnull.Val[int64] `db:"created_date" `
|
||||
CreatedUser omitnull.Val[string] `db:"created_user" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
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" `
|
||||
Habitattype omitnull.Val[string] `db:"habitattype" `
|
||||
Objectid omit.Val[int32] `db:"objectid,pk" `
|
||||
Created omitnull.Val[time.Time] `db:"created" `
|
||||
CreatedDate omitnull.Val[int64] `db:"created_date" `
|
||||
CreatedUser omitnull.Val[string] `db:"created_user" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
}
|
||||
|
||||
func (s HistoryHabitatrelateSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 16)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals := make([]string, 0, 17)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Creationdate.IsUnset() {
|
||||
|
|
@ -165,6 +170,9 @@ func (s HistoryHabitatrelateSetter) SetColumns() []string {
|
|||
if s.Objectid.IsValue() {
|
||||
vals = append(vals, "objectid")
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
vals = append(vals, "created")
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals = append(vals, "created_date")
|
||||
}
|
||||
|
|
@ -190,8 +198,8 @@ func (s HistoryHabitatrelateSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s HistoryHabitatrelateSetter) Overwrite(t *HistoryHabitatrelate) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Creationdate.IsUnset() {
|
||||
t.Creationdate = s.Creationdate.MustGetNull()
|
||||
|
|
@ -217,6 +225,9 @@ func (s HistoryHabitatrelateSetter) Overwrite(t *HistoryHabitatrelate) {
|
|||
if s.Objectid.IsValue() {
|
||||
t.Objectid = s.Objectid.MustGet()
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
t.Created = s.Created.MustGetNull()
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
t.CreatedDate = s.CreatedDate.MustGetNull()
|
||||
}
|
||||
|
|
@ -246,9 +257,9 @@ func (s *HistoryHabitatrelateSetter) Apply(q *dialect.InsertQuery) {
|
|||
})
|
||||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 16)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
vals := make([]bob.Expression, 17)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -301,48 +312,54 @@ func (s *HistoryHabitatrelateSetter) Apply(q *dialect.InsertQuery) {
|
|||
vals[8] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[9] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
if !s.Created.IsUnset() {
|
||||
vals[9] = psql.Arg(s.Created.MustGetNull())
|
||||
} else {
|
||||
vals[9] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[10] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[10] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
} else {
|
||||
vals[10] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[11] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[11] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
} else {
|
||||
vals[11] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[12] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[12] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
} else {
|
||||
vals[12] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[13] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[13] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
} else {
|
||||
vals[13] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[14] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[14] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
} else {
|
||||
vals[14] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[15] = psql.Arg(s.Version.MustGet())
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[15] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
} else {
|
||||
vals[15] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[16] = psql.Arg(s.Version.MustGet())
|
||||
} else {
|
||||
vals[16] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
return bob.ExpressSlice(ctx, w, d, start, vals, "", ", ", "")
|
||||
}))
|
||||
}
|
||||
|
|
@ -352,9 +369,9 @@ func (s HistoryHabitatrelateSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery] {
|
|||
}
|
||||
|
||||
func (s HistoryHabitatrelateSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 16)
|
||||
exprs := make([]bob.Expression, 0, 17)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -417,6 +434,13 @@ func (s HistoryHabitatrelateSetter) Expressions(prefix ...string) []bob.Expressi
|
|||
}})
|
||||
}
|
||||
|
||||
if !s.Created.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created")...),
|
||||
psql.Arg(s.Created),
|
||||
}})
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created_date")...),
|
||||
|
|
@ -710,7 +734,7 @@ func (o *HistoryHabitatrelate) Organization(mods ...bob.Mod[*dialect.SelectQuery
|
|||
}
|
||||
|
||||
func (os HistoryHabitatrelateSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -728,7 +752,7 @@ func (os HistoryHabitatrelateSlice) Organization(mods ...bob.Mod[*dialect.Select
|
|||
|
||||
func attachHistoryHabitatrelateOrganization0(ctx context.Context, exec bob.Executor, count int, historyHabitatrelate0 *HistoryHabitatrelate, organization1 *Organization) (*HistoryHabitatrelate, error) {
|
||||
setter := &HistoryHabitatrelateSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := historyHabitatrelate0.Update(ctx, exec, setter)
|
||||
|
|
@ -775,7 +799,7 @@ func (historyHabitatrelate0 *HistoryHabitatrelate) AttachOrganization(ctx contex
|
|||
}
|
||||
|
||||
type historyHabitatrelateWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Creationdate psql.WhereNullMod[Q, int64]
|
||||
Creator psql.WhereNullMod[Q, string]
|
||||
Editdate psql.WhereNullMod[Q, int64]
|
||||
|
|
@ -784,6 +808,7 @@ type historyHabitatrelateWhere[Q psql.Filterable] struct {
|
|||
Globalid psql.WhereNullMod[Q, string]
|
||||
Habitattype psql.WhereNullMod[Q, string]
|
||||
Objectid psql.WhereMod[Q, int32]
|
||||
Created psql.WhereNullMod[Q, time.Time]
|
||||
CreatedDate psql.WhereNullMod[Q, int64]
|
||||
CreatedUser psql.WhereNullMod[Q, string]
|
||||
GeometryX psql.WhereNullMod[Q, float64]
|
||||
|
|
@ -799,7 +824,7 @@ func (historyHabitatrelateWhere[Q]) AliasedAs(alias string) historyHabitatrelate
|
|||
|
||||
func buildHistoryHabitatrelateWhere[Q psql.Filterable](cols historyHabitatrelateColumns) historyHabitatrelateWhere[Q] {
|
||||
return historyHabitatrelateWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Creationdate: psql.WhereNull[Q, int64](cols.Creationdate),
|
||||
Creator: psql.WhereNull[Q, string](cols.Creator),
|
||||
Editdate: psql.WhereNull[Q, int64](cols.Editdate),
|
||||
|
|
@ -808,6 +833,7 @@ func buildHistoryHabitatrelateWhere[Q psql.Filterable](cols historyHabitatrelate
|
|||
Globalid: psql.WhereNull[Q, string](cols.Globalid),
|
||||
Habitattype: psql.WhereNull[Q, string](cols.Habitattype),
|
||||
Objectid: psql.Where[Q, int32](cols.Objectid),
|
||||
Created: psql.WhereNull[Q, time.Time](cols.Created),
|
||||
CreatedDate: psql.WhereNull[Q, int64](cols.CreatedDate),
|
||||
CreatedUser: psql.WhereNull[Q, string](cols.CreatedUser),
|
||||
GeometryX: psql.WhereNull[Q, float64](cols.GeometryX),
|
||||
|
|
@ -919,11 +945,8 @@ func (os HistoryHabitatrelateSlice) LoadOrganization(ctx context.Context, exec b
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"time"
|
||||
|
||||
"github.com/aarondl/opt/null"
|
||||
"github.com/aarondl/opt/omit"
|
||||
|
|
@ -25,24 +26,25 @@ import (
|
|||
|
||||
// HistoryInspectionsample is an object representing the database table.
|
||||
type HistoryInspectionsample struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
Editor null.Val[string] `db:"editor" `
|
||||
Globalid null.Val[string] `db:"globalid" `
|
||||
Idbytech null.Val[string] `db:"idbytech" `
|
||||
InspID null.Val[string] `db:"insp_id" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
Processed null.Val[int16] `db:"processed" `
|
||||
Sampleid null.Val[string] `db:"sampleid" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Version int32 `db:"version,pk" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
Editor null.Val[string] `db:"editor" `
|
||||
Globalid null.Val[string] `db:"globalid" `
|
||||
Idbytech null.Val[string] `db:"idbytech" `
|
||||
InspID null.Val[string] `db:"insp_id" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
Processed null.Val[int16] `db:"processed" `
|
||||
Sampleid null.Val[string] `db:"sampleid" `
|
||||
Created null.Val[time.Time] `db:"created" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Version int32 `db:"version,pk" `
|
||||
|
||||
R historyInspectionsampleR `db:"-" `
|
||||
}
|
||||
|
|
@ -65,7 +67,7 @@ type historyInspectionsampleR struct {
|
|||
func buildHistoryInspectionsampleColumns(alias string) historyInspectionsampleColumns {
|
||||
return historyInspectionsampleColumns{
|
||||
ColumnsExpr: expr.NewColumnsExpr(
|
||||
"organization_id", "creationdate", "creator", "editdate", "editor", "globalid", "idbytech", "insp_id", "objectid", "processed", "sampleid", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "version",
|
||||
"organization_id", "creationdate", "creator", "editdate", "editor", "globalid", "idbytech", "insp_id", "objectid", "processed", "sampleid", "created", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "version",
|
||||
).WithParent("history_inspectionsample"),
|
||||
tableAlias: alias,
|
||||
OrganizationID: psql.Quote(alias, "organization_id"),
|
||||
|
|
@ -79,6 +81,7 @@ func buildHistoryInspectionsampleColumns(alias string) historyInspectionsampleCo
|
|||
Objectid: psql.Quote(alias, "objectid"),
|
||||
Processed: psql.Quote(alias, "processed"),
|
||||
Sampleid: psql.Quote(alias, "sampleid"),
|
||||
Created: psql.Quote(alias, "created"),
|
||||
CreatedDate: psql.Quote(alias, "created_date"),
|
||||
CreatedUser: psql.Quote(alias, "created_user"),
|
||||
GeometryX: psql.Quote(alias, "geometry_x"),
|
||||
|
|
@ -103,6 +106,7 @@ type historyInspectionsampleColumns struct {
|
|||
Objectid psql.Expression
|
||||
Processed psql.Expression
|
||||
Sampleid psql.Expression
|
||||
Created psql.Expression
|
||||
CreatedDate psql.Expression
|
||||
CreatedUser psql.Expression
|
||||
GeometryX psql.Expression
|
||||
|
|
@ -124,29 +128,30 @@ func (historyInspectionsampleColumns) AliasedAs(alias string) historyInspections
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type HistoryInspectionsampleSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
Editor omitnull.Val[string] `db:"editor" `
|
||||
Globalid omitnull.Val[string] `db:"globalid" `
|
||||
Idbytech omitnull.Val[string] `db:"idbytech" `
|
||||
InspID omitnull.Val[string] `db:"insp_id" `
|
||||
Objectid omit.Val[int32] `db:"objectid,pk" `
|
||||
Processed omitnull.Val[int16] `db:"processed" `
|
||||
Sampleid omitnull.Val[string] `db:"sampleid" `
|
||||
CreatedDate omitnull.Val[int64] `db:"created_date" `
|
||||
CreatedUser omitnull.Val[string] `db:"created_user" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
Editor omitnull.Val[string] `db:"editor" `
|
||||
Globalid omitnull.Val[string] `db:"globalid" `
|
||||
Idbytech omitnull.Val[string] `db:"idbytech" `
|
||||
InspID omitnull.Val[string] `db:"insp_id" `
|
||||
Objectid omit.Val[int32] `db:"objectid,pk" `
|
||||
Processed omitnull.Val[int16] `db:"processed" `
|
||||
Sampleid omitnull.Val[string] `db:"sampleid" `
|
||||
Created omitnull.Val[time.Time] `db:"created" `
|
||||
CreatedDate omitnull.Val[int64] `db:"created_date" `
|
||||
CreatedUser omitnull.Val[string] `db:"created_user" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
}
|
||||
|
||||
func (s HistoryInspectionsampleSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 18)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals := make([]string, 0, 19)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Creationdate.IsUnset() {
|
||||
|
|
@ -179,6 +184,9 @@ func (s HistoryInspectionsampleSetter) SetColumns() []string {
|
|||
if !s.Sampleid.IsUnset() {
|
||||
vals = append(vals, "sampleid")
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
vals = append(vals, "created")
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals = append(vals, "created_date")
|
||||
}
|
||||
|
|
@ -204,8 +212,8 @@ func (s HistoryInspectionsampleSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s HistoryInspectionsampleSetter) Overwrite(t *HistoryInspectionsample) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Creationdate.IsUnset() {
|
||||
t.Creationdate = s.Creationdate.MustGetNull()
|
||||
|
|
@ -237,6 +245,9 @@ func (s HistoryInspectionsampleSetter) Overwrite(t *HistoryInspectionsample) {
|
|||
if !s.Sampleid.IsUnset() {
|
||||
t.Sampleid = s.Sampleid.MustGetNull()
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
t.Created = s.Created.MustGetNull()
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
t.CreatedDate = s.CreatedDate.MustGetNull()
|
||||
}
|
||||
|
|
@ -266,9 +277,9 @@ func (s *HistoryInspectionsampleSetter) Apply(q *dialect.InsertQuery) {
|
|||
})
|
||||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 18)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
vals := make([]bob.Expression, 19)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -333,48 +344,54 @@ func (s *HistoryInspectionsampleSetter) Apply(q *dialect.InsertQuery) {
|
|||
vals[10] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[11] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
if !s.Created.IsUnset() {
|
||||
vals[11] = psql.Arg(s.Created.MustGetNull())
|
||||
} else {
|
||||
vals[11] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[12] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[12] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
} else {
|
||||
vals[12] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[13] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[13] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
} else {
|
||||
vals[13] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[14] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[14] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
} else {
|
||||
vals[14] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[15] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[15] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
} else {
|
||||
vals[15] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[16] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[16] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
} else {
|
||||
vals[16] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[17] = psql.Arg(s.Version.MustGet())
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[17] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
} else {
|
||||
vals[17] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[18] = psql.Arg(s.Version.MustGet())
|
||||
} else {
|
||||
vals[18] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
return bob.ExpressSlice(ctx, w, d, start, vals, "", ", ", "")
|
||||
}))
|
||||
}
|
||||
|
|
@ -384,9 +401,9 @@ func (s HistoryInspectionsampleSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery]
|
|||
}
|
||||
|
||||
func (s HistoryInspectionsampleSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 18)
|
||||
exprs := make([]bob.Expression, 0, 19)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -463,6 +480,13 @@ func (s HistoryInspectionsampleSetter) Expressions(prefix ...string) []bob.Expre
|
|||
}})
|
||||
}
|
||||
|
||||
if !s.Created.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created")...),
|
||||
psql.Arg(s.Created),
|
||||
}})
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created_date")...),
|
||||
|
|
@ -756,7 +780,7 @@ func (o *HistoryInspectionsample) Organization(mods ...bob.Mod[*dialect.SelectQu
|
|||
}
|
||||
|
||||
func (os HistoryInspectionsampleSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -774,7 +798,7 @@ func (os HistoryInspectionsampleSlice) Organization(mods ...bob.Mod[*dialect.Sel
|
|||
|
||||
func attachHistoryInspectionsampleOrganization0(ctx context.Context, exec bob.Executor, count int, historyInspectionsample0 *HistoryInspectionsample, organization1 *Organization) (*HistoryInspectionsample, error) {
|
||||
setter := &HistoryInspectionsampleSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := historyInspectionsample0.Update(ctx, exec, setter)
|
||||
|
|
@ -821,7 +845,7 @@ func (historyInspectionsample0 *HistoryInspectionsample) AttachOrganization(ctx
|
|||
}
|
||||
|
||||
type historyInspectionsampleWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Creationdate psql.WhereNullMod[Q, int64]
|
||||
Creator psql.WhereNullMod[Q, string]
|
||||
Editdate psql.WhereNullMod[Q, int64]
|
||||
|
|
@ -832,6 +856,7 @@ type historyInspectionsampleWhere[Q psql.Filterable] struct {
|
|||
Objectid psql.WhereMod[Q, int32]
|
||||
Processed psql.WhereNullMod[Q, int16]
|
||||
Sampleid psql.WhereNullMod[Q, string]
|
||||
Created psql.WhereNullMod[Q, time.Time]
|
||||
CreatedDate psql.WhereNullMod[Q, int64]
|
||||
CreatedUser psql.WhereNullMod[Q, string]
|
||||
GeometryX psql.WhereNullMod[Q, float64]
|
||||
|
|
@ -847,7 +872,7 @@ func (historyInspectionsampleWhere[Q]) AliasedAs(alias string) historyInspection
|
|||
|
||||
func buildHistoryInspectionsampleWhere[Q psql.Filterable](cols historyInspectionsampleColumns) historyInspectionsampleWhere[Q] {
|
||||
return historyInspectionsampleWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Creationdate: psql.WhereNull[Q, int64](cols.Creationdate),
|
||||
Creator: psql.WhereNull[Q, string](cols.Creator),
|
||||
Editdate: psql.WhereNull[Q, int64](cols.Editdate),
|
||||
|
|
@ -858,6 +883,7 @@ func buildHistoryInspectionsampleWhere[Q psql.Filterable](cols historyInspection
|
|||
Objectid: psql.Where[Q, int32](cols.Objectid),
|
||||
Processed: psql.WhereNull[Q, int16](cols.Processed),
|
||||
Sampleid: psql.WhereNull[Q, string](cols.Sampleid),
|
||||
Created: psql.WhereNull[Q, time.Time](cols.Created),
|
||||
CreatedDate: psql.WhereNull[Q, int64](cols.CreatedDate),
|
||||
CreatedUser: psql.WhereNull[Q, string](cols.CreatedUser),
|
||||
GeometryX: psql.WhereNull[Q, float64](cols.GeometryX),
|
||||
|
|
@ -969,11 +995,8 @@ func (os HistoryInspectionsampleSlice) LoadOrganization(ctx context.Context, exe
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"time"
|
||||
|
||||
"github.com/aarondl/opt/null"
|
||||
"github.com/aarondl/opt/omit"
|
||||
|
|
@ -25,35 +26,36 @@ import (
|
|||
|
||||
// HistoryInspectionsampledetail is an object representing the database table.
|
||||
type HistoryInspectionsampledetail struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
Comments null.Val[string] `db:"comments" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
Editor null.Val[string] `db:"editor" `
|
||||
Fadultact null.Val[string] `db:"fadultact" `
|
||||
Fdomstage null.Val[string] `db:"fdomstage" `
|
||||
Feggcount null.Val[int16] `db:"feggcount" `
|
||||
Fieldspecies null.Val[string] `db:"fieldspecies" `
|
||||
Flarvcount null.Val[int16] `db:"flarvcount" `
|
||||
Flstages null.Val[string] `db:"flstages" `
|
||||
Fpupcount null.Val[int16] `db:"fpupcount" `
|
||||
Globalid null.Val[string] `db:"globalid" `
|
||||
InspsampleID null.Val[string] `db:"inspsample_id" `
|
||||
Labspecies null.Val[string] `db:"labspecies" `
|
||||
Ldomstage null.Val[string] `db:"ldomstage" `
|
||||
Leggcount null.Val[int16] `db:"leggcount" `
|
||||
Llarvcount null.Val[int16] `db:"llarvcount" `
|
||||
Lpupcount null.Val[int16] `db:"lpupcount" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
Processed null.Val[int16] `db:"processed" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Version int32 `db:"version,pk" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Comments null.Val[string] `db:"comments" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
Editor null.Val[string] `db:"editor" `
|
||||
Fadultact null.Val[string] `db:"fadultact" `
|
||||
Fdomstage null.Val[string] `db:"fdomstage" `
|
||||
Feggcount null.Val[int16] `db:"feggcount" `
|
||||
Fieldspecies null.Val[string] `db:"fieldspecies" `
|
||||
Flarvcount null.Val[int16] `db:"flarvcount" `
|
||||
Flstages null.Val[string] `db:"flstages" `
|
||||
Fpupcount null.Val[int16] `db:"fpupcount" `
|
||||
Globalid null.Val[string] `db:"globalid" `
|
||||
InspsampleID null.Val[string] `db:"inspsample_id" `
|
||||
Labspecies null.Val[string] `db:"labspecies" `
|
||||
Ldomstage null.Val[string] `db:"ldomstage" `
|
||||
Leggcount null.Val[int16] `db:"leggcount" `
|
||||
Llarvcount null.Val[int16] `db:"llarvcount" `
|
||||
Lpupcount null.Val[int16] `db:"lpupcount" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
Processed null.Val[int16] `db:"processed" `
|
||||
Created null.Val[time.Time] `db:"created" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Version int32 `db:"version,pk" `
|
||||
|
||||
R historyInspectionsampledetailR `db:"-" `
|
||||
}
|
||||
|
|
@ -76,7 +78,7 @@ type historyInspectionsampledetailR struct {
|
|||
func buildHistoryInspectionsampledetailColumns(alias string) historyInspectionsampledetailColumns {
|
||||
return historyInspectionsampledetailColumns{
|
||||
ColumnsExpr: expr.NewColumnsExpr(
|
||||
"organization_id", "comments", "creationdate", "creator", "editdate", "editor", "fadultact", "fdomstage", "feggcount", "fieldspecies", "flarvcount", "flstages", "fpupcount", "globalid", "inspsample_id", "labspecies", "ldomstage", "leggcount", "llarvcount", "lpupcount", "objectid", "processed", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "version",
|
||||
"organization_id", "comments", "creationdate", "creator", "editdate", "editor", "fadultact", "fdomstage", "feggcount", "fieldspecies", "flarvcount", "flstages", "fpupcount", "globalid", "inspsample_id", "labspecies", "ldomstage", "leggcount", "llarvcount", "lpupcount", "objectid", "processed", "created", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "version",
|
||||
).WithParent("history_inspectionsampledetail"),
|
||||
tableAlias: alias,
|
||||
OrganizationID: psql.Quote(alias, "organization_id"),
|
||||
|
|
@ -101,6 +103,7 @@ func buildHistoryInspectionsampledetailColumns(alias string) historyInspectionsa
|
|||
Lpupcount: psql.Quote(alias, "lpupcount"),
|
||||
Objectid: psql.Quote(alias, "objectid"),
|
||||
Processed: psql.Quote(alias, "processed"),
|
||||
Created: psql.Quote(alias, "created"),
|
||||
CreatedDate: psql.Quote(alias, "created_date"),
|
||||
CreatedUser: psql.Quote(alias, "created_user"),
|
||||
GeometryX: psql.Quote(alias, "geometry_x"),
|
||||
|
|
@ -136,6 +139,7 @@ type historyInspectionsampledetailColumns struct {
|
|||
Lpupcount psql.Expression
|
||||
Objectid psql.Expression
|
||||
Processed psql.Expression
|
||||
Created psql.Expression
|
||||
CreatedDate psql.Expression
|
||||
CreatedUser psql.Expression
|
||||
GeometryX psql.Expression
|
||||
|
|
@ -157,40 +161,41 @@ func (historyInspectionsampledetailColumns) AliasedAs(alias string) historyInspe
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type HistoryInspectionsampledetailSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
Comments omitnull.Val[string] `db:"comments" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
Editor omitnull.Val[string] `db:"editor" `
|
||||
Fadultact omitnull.Val[string] `db:"fadultact" `
|
||||
Fdomstage omitnull.Val[string] `db:"fdomstage" `
|
||||
Feggcount omitnull.Val[int16] `db:"feggcount" `
|
||||
Fieldspecies omitnull.Val[string] `db:"fieldspecies" `
|
||||
Flarvcount omitnull.Val[int16] `db:"flarvcount" `
|
||||
Flstages omitnull.Val[string] `db:"flstages" `
|
||||
Fpupcount omitnull.Val[int16] `db:"fpupcount" `
|
||||
Globalid omitnull.Val[string] `db:"globalid" `
|
||||
InspsampleID omitnull.Val[string] `db:"inspsample_id" `
|
||||
Labspecies omitnull.Val[string] `db:"labspecies" `
|
||||
Ldomstage omitnull.Val[string] `db:"ldomstage" `
|
||||
Leggcount omitnull.Val[int16] `db:"leggcount" `
|
||||
Llarvcount omitnull.Val[int16] `db:"llarvcount" `
|
||||
Lpupcount omitnull.Val[int16] `db:"lpupcount" `
|
||||
Objectid omit.Val[int32] `db:"objectid,pk" `
|
||||
Processed omitnull.Val[int16] `db:"processed" `
|
||||
CreatedDate omitnull.Val[int64] `db:"created_date" `
|
||||
CreatedUser omitnull.Val[string] `db:"created_user" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Comments omitnull.Val[string] `db:"comments" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
Editor omitnull.Val[string] `db:"editor" `
|
||||
Fadultact omitnull.Val[string] `db:"fadultact" `
|
||||
Fdomstage omitnull.Val[string] `db:"fdomstage" `
|
||||
Feggcount omitnull.Val[int16] `db:"feggcount" `
|
||||
Fieldspecies omitnull.Val[string] `db:"fieldspecies" `
|
||||
Flarvcount omitnull.Val[int16] `db:"flarvcount" `
|
||||
Flstages omitnull.Val[string] `db:"flstages" `
|
||||
Fpupcount omitnull.Val[int16] `db:"fpupcount" `
|
||||
Globalid omitnull.Val[string] `db:"globalid" `
|
||||
InspsampleID omitnull.Val[string] `db:"inspsample_id" `
|
||||
Labspecies omitnull.Val[string] `db:"labspecies" `
|
||||
Ldomstage omitnull.Val[string] `db:"ldomstage" `
|
||||
Leggcount omitnull.Val[int16] `db:"leggcount" `
|
||||
Llarvcount omitnull.Val[int16] `db:"llarvcount" `
|
||||
Lpupcount omitnull.Val[int16] `db:"lpupcount" `
|
||||
Objectid omit.Val[int32] `db:"objectid,pk" `
|
||||
Processed omitnull.Val[int16] `db:"processed" `
|
||||
Created omitnull.Val[time.Time] `db:"created" `
|
||||
CreatedDate omitnull.Val[int64] `db:"created_date" `
|
||||
CreatedUser omitnull.Val[string] `db:"created_user" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
}
|
||||
|
||||
func (s HistoryInspectionsampledetailSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 29)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals := make([]string, 0, 30)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Comments.IsUnset() {
|
||||
|
|
@ -256,6 +261,9 @@ func (s HistoryInspectionsampledetailSetter) SetColumns() []string {
|
|||
if !s.Processed.IsUnset() {
|
||||
vals = append(vals, "processed")
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
vals = append(vals, "created")
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals = append(vals, "created_date")
|
||||
}
|
||||
|
|
@ -281,8 +289,8 @@ func (s HistoryInspectionsampledetailSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s HistoryInspectionsampledetailSetter) Overwrite(t *HistoryInspectionsampledetail) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Comments.IsUnset() {
|
||||
t.Comments = s.Comments.MustGetNull()
|
||||
|
|
@ -347,6 +355,9 @@ func (s HistoryInspectionsampledetailSetter) Overwrite(t *HistoryInspectionsampl
|
|||
if !s.Processed.IsUnset() {
|
||||
t.Processed = s.Processed.MustGetNull()
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
t.Created = s.Created.MustGetNull()
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
t.CreatedDate = s.CreatedDate.MustGetNull()
|
||||
}
|
||||
|
|
@ -376,9 +387,9 @@ func (s *HistoryInspectionsampledetailSetter) Apply(q *dialect.InsertQuery) {
|
|||
})
|
||||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 29)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
vals := make([]bob.Expression, 30)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -509,48 +520,54 @@ func (s *HistoryInspectionsampledetailSetter) Apply(q *dialect.InsertQuery) {
|
|||
vals[21] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[22] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
if !s.Created.IsUnset() {
|
||||
vals[22] = psql.Arg(s.Created.MustGetNull())
|
||||
} else {
|
||||
vals[22] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[23] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[23] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
} else {
|
||||
vals[23] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[24] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[24] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
} else {
|
||||
vals[24] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[25] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[25] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
} else {
|
||||
vals[25] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[26] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[26] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
} else {
|
||||
vals[26] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[27] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[27] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
} else {
|
||||
vals[27] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[28] = psql.Arg(s.Version.MustGet())
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[28] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
} else {
|
||||
vals[28] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[29] = psql.Arg(s.Version.MustGet())
|
||||
} else {
|
||||
vals[29] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
return bob.ExpressSlice(ctx, w, d, start, vals, "", ", ", "")
|
||||
}))
|
||||
}
|
||||
|
|
@ -560,9 +577,9 @@ func (s HistoryInspectionsampledetailSetter) UpdateMod() bob.Mod[*dialect.Update
|
|||
}
|
||||
|
||||
func (s HistoryInspectionsampledetailSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 29)
|
||||
exprs := make([]bob.Expression, 0, 30)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -716,6 +733,13 @@ func (s HistoryInspectionsampledetailSetter) Expressions(prefix ...string) []bob
|
|||
}})
|
||||
}
|
||||
|
||||
if !s.Created.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created")...),
|
||||
psql.Arg(s.Created),
|
||||
}})
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created_date")...),
|
||||
|
|
@ -1009,7 +1033,7 @@ func (o *HistoryInspectionsampledetail) Organization(mods ...bob.Mod[*dialect.Se
|
|||
}
|
||||
|
||||
func (os HistoryInspectionsampledetailSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -1027,7 +1051,7 @@ func (os HistoryInspectionsampledetailSlice) Organization(mods ...bob.Mod[*diale
|
|||
|
||||
func attachHistoryInspectionsampledetailOrganization0(ctx context.Context, exec bob.Executor, count int, historyInspectionsampledetail0 *HistoryInspectionsampledetail, organization1 *Organization) (*HistoryInspectionsampledetail, error) {
|
||||
setter := &HistoryInspectionsampledetailSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := historyInspectionsampledetail0.Update(ctx, exec, setter)
|
||||
|
|
@ -1074,7 +1098,7 @@ func (historyInspectionsampledetail0 *HistoryInspectionsampledetail) AttachOrgan
|
|||
}
|
||||
|
||||
type historyInspectionsampledetailWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Comments psql.WhereNullMod[Q, string]
|
||||
Creationdate psql.WhereNullMod[Q, int64]
|
||||
Creator psql.WhereNullMod[Q, string]
|
||||
|
|
@ -1096,6 +1120,7 @@ type historyInspectionsampledetailWhere[Q psql.Filterable] struct {
|
|||
Lpupcount psql.WhereNullMod[Q, int16]
|
||||
Objectid psql.WhereMod[Q, int32]
|
||||
Processed psql.WhereNullMod[Q, int16]
|
||||
Created psql.WhereNullMod[Q, time.Time]
|
||||
CreatedDate psql.WhereNullMod[Q, int64]
|
||||
CreatedUser psql.WhereNullMod[Q, string]
|
||||
GeometryX psql.WhereNullMod[Q, float64]
|
||||
|
|
@ -1111,7 +1136,7 @@ func (historyInspectionsampledetailWhere[Q]) AliasedAs(alias string) historyInsp
|
|||
|
||||
func buildHistoryInspectionsampledetailWhere[Q psql.Filterable](cols historyInspectionsampledetailColumns) historyInspectionsampledetailWhere[Q] {
|
||||
return historyInspectionsampledetailWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Comments: psql.WhereNull[Q, string](cols.Comments),
|
||||
Creationdate: psql.WhereNull[Q, int64](cols.Creationdate),
|
||||
Creator: psql.WhereNull[Q, string](cols.Creator),
|
||||
|
|
@ -1133,6 +1158,7 @@ func buildHistoryInspectionsampledetailWhere[Q psql.Filterable](cols historyInsp
|
|||
Lpupcount: psql.WhereNull[Q, int16](cols.Lpupcount),
|
||||
Objectid: psql.Where[Q, int32](cols.Objectid),
|
||||
Processed: psql.WhereNull[Q, int16](cols.Processed),
|
||||
Created: psql.WhereNull[Q, time.Time](cols.Created),
|
||||
CreatedDate: psql.WhereNull[Q, int64](cols.CreatedDate),
|
||||
CreatedUser: psql.WhereNull[Q, string](cols.CreatedUser),
|
||||
GeometryX: psql.WhereNull[Q, float64](cols.GeometryX),
|
||||
|
|
@ -1244,11 +1270,8 @@ func (os HistoryInspectionsampledetailSlice) LoadOrganization(ctx context.Contex
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"time"
|
||||
|
||||
"github.com/aarondl/opt/null"
|
||||
"github.com/aarondl/opt/omit"
|
||||
|
|
@ -25,58 +26,59 @@ import (
|
|||
|
||||
// HistoryLinelocation is an object representing the database table.
|
||||
type HistoryLinelocation struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
Accessdesc null.Val[string] `db:"accessdesc" `
|
||||
Acres null.Val[float64] `db:"acres" `
|
||||
Active null.Val[int16] `db:"active" `
|
||||
Comments null.Val[string] `db:"comments" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Description null.Val[string] `db:"description" `
|
||||
Externalid null.Val[string] `db:"externalid" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
Editor null.Val[string] `db:"editor" `
|
||||
Globalid null.Val[string] `db:"globalid" `
|
||||
Habitat null.Val[string] `db:"habitat" `
|
||||
Hectares null.Val[float64] `db:"hectares" `
|
||||
Jurisdiction null.Val[string] `db:"jurisdiction" `
|
||||
Larvinspectinterval null.Val[int16] `db:"larvinspectinterval" `
|
||||
Lastinspectactiontaken null.Val[string] `db:"lastinspectactiontaken" `
|
||||
Lastinspectactivity null.Val[string] `db:"lastinspectactivity" `
|
||||
Lastinspectavglarvae null.Val[float64] `db:"lastinspectavglarvae" `
|
||||
Lastinspectavgpupae null.Val[float64] `db:"lastinspectavgpupae" `
|
||||
Lastinspectbreeding null.Val[string] `db:"lastinspectbreeding" `
|
||||
Lastinspectconditions null.Val[string] `db:"lastinspectconditions" `
|
||||
Lastinspectdate null.Val[int64] `db:"lastinspectdate" `
|
||||
Lastinspectfieldspecies null.Val[string] `db:"lastinspectfieldspecies" `
|
||||
Lastinspectlstages null.Val[string] `db:"lastinspectlstages" `
|
||||
Lasttreatactivity null.Val[string] `db:"lasttreatactivity" `
|
||||
Lasttreatdate null.Val[int64] `db:"lasttreatdate" `
|
||||
Lasttreatproduct null.Val[string] `db:"lasttreatproduct" `
|
||||
Lasttreatqty null.Val[float64] `db:"lasttreatqty" `
|
||||
Lasttreatqtyunit null.Val[string] `db:"lasttreatqtyunit" `
|
||||
LengthFT null.Val[float64] `db:"length_ft" `
|
||||
LengthMeters null.Val[float64] `db:"length_meters" `
|
||||
Locationnumber null.Val[int64] `db:"locationnumber" `
|
||||
Name null.Val[string] `db:"name" `
|
||||
Nextactiondatescheduled null.Val[int64] `db:"nextactiondatescheduled" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
Priority null.Val[string] `db:"priority" `
|
||||
Symbology null.Val[string] `db:"symbology" `
|
||||
ShapeLength null.Val[float64] `db:"shape__length" `
|
||||
Usetype null.Val[string] `db:"usetype" `
|
||||
Waterorigin null.Val[string] `db:"waterorigin" `
|
||||
WidthFT null.Val[float64] `db:"width_ft" `
|
||||
WidthMeters null.Val[float64] `db:"width_meters" `
|
||||
Zone null.Val[string] `db:"zone" `
|
||||
Zone2 null.Val[string] `db:"zone2" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Version int32 `db:"version,pk" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Accessdesc null.Val[string] `db:"accessdesc" `
|
||||
Acres null.Val[float64] `db:"acres" `
|
||||
Active null.Val[int16] `db:"active" `
|
||||
Comments null.Val[string] `db:"comments" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Description null.Val[string] `db:"description" `
|
||||
Externalid null.Val[string] `db:"externalid" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
Editor null.Val[string] `db:"editor" `
|
||||
Globalid null.Val[string] `db:"globalid" `
|
||||
Habitat null.Val[string] `db:"habitat" `
|
||||
Hectares null.Val[float64] `db:"hectares" `
|
||||
Jurisdiction null.Val[string] `db:"jurisdiction" `
|
||||
Larvinspectinterval null.Val[int16] `db:"larvinspectinterval" `
|
||||
Lastinspectactiontaken null.Val[string] `db:"lastinspectactiontaken" `
|
||||
Lastinspectactivity null.Val[string] `db:"lastinspectactivity" `
|
||||
Lastinspectavglarvae null.Val[float64] `db:"lastinspectavglarvae" `
|
||||
Lastinspectavgpupae null.Val[float64] `db:"lastinspectavgpupae" `
|
||||
Lastinspectbreeding null.Val[string] `db:"lastinspectbreeding" `
|
||||
Lastinspectconditions null.Val[string] `db:"lastinspectconditions" `
|
||||
Lastinspectdate null.Val[int64] `db:"lastinspectdate" `
|
||||
Lastinspectfieldspecies null.Val[string] `db:"lastinspectfieldspecies" `
|
||||
Lastinspectlstages null.Val[string] `db:"lastinspectlstages" `
|
||||
Lasttreatactivity null.Val[string] `db:"lasttreatactivity" `
|
||||
Lasttreatdate null.Val[int64] `db:"lasttreatdate" `
|
||||
Lasttreatproduct null.Val[string] `db:"lasttreatproduct" `
|
||||
Lasttreatqty null.Val[float64] `db:"lasttreatqty" `
|
||||
Lasttreatqtyunit null.Val[string] `db:"lasttreatqtyunit" `
|
||||
LengthFT null.Val[float64] `db:"length_ft" `
|
||||
LengthMeters null.Val[float64] `db:"length_meters" `
|
||||
Locationnumber null.Val[int64] `db:"locationnumber" `
|
||||
Name null.Val[string] `db:"name" `
|
||||
Nextactiondatescheduled null.Val[int64] `db:"nextactiondatescheduled" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
Priority null.Val[string] `db:"priority" `
|
||||
Symbology null.Val[string] `db:"symbology" `
|
||||
ShapeLength null.Val[float64] `db:"shape__length" `
|
||||
Usetype null.Val[string] `db:"usetype" `
|
||||
Waterorigin null.Val[string] `db:"waterorigin" `
|
||||
WidthFT null.Val[float64] `db:"width_ft" `
|
||||
WidthMeters null.Val[float64] `db:"width_meters" `
|
||||
Zone null.Val[string] `db:"zone" `
|
||||
Zone2 null.Val[string] `db:"zone2" `
|
||||
Created null.Val[time.Time] `db:"created" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Version int32 `db:"version,pk" `
|
||||
|
||||
R historyLinelocationR `db:"-" `
|
||||
}
|
||||
|
|
@ -99,7 +101,7 @@ type historyLinelocationR struct {
|
|||
func buildHistoryLinelocationColumns(alias string) historyLinelocationColumns {
|
||||
return historyLinelocationColumns{
|
||||
ColumnsExpr: expr.NewColumnsExpr(
|
||||
"organization_id", "accessdesc", "acres", "active", "comments", "creationdate", "creator", "description", "externalid", "editdate", "editor", "globalid", "habitat", "hectares", "jurisdiction", "larvinspectinterval", "lastinspectactiontaken", "lastinspectactivity", "lastinspectavglarvae", "lastinspectavgpupae", "lastinspectbreeding", "lastinspectconditions", "lastinspectdate", "lastinspectfieldspecies", "lastinspectlstages", "lasttreatactivity", "lasttreatdate", "lasttreatproduct", "lasttreatqty", "lasttreatqtyunit", "length_ft", "length_meters", "locationnumber", "name", "nextactiondatescheduled", "objectid", "priority", "symbology", "shape__length", "usetype", "waterorigin", "width_ft", "width_meters", "zone", "zone2", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "version",
|
||||
"organization_id", "accessdesc", "acres", "active", "comments", "creationdate", "creator", "description", "externalid", "editdate", "editor", "globalid", "habitat", "hectares", "jurisdiction", "larvinspectinterval", "lastinspectactiontaken", "lastinspectactivity", "lastinspectavglarvae", "lastinspectavgpupae", "lastinspectbreeding", "lastinspectconditions", "lastinspectdate", "lastinspectfieldspecies", "lastinspectlstages", "lasttreatactivity", "lasttreatdate", "lasttreatproduct", "lasttreatqty", "lasttreatqtyunit", "length_ft", "length_meters", "locationnumber", "name", "nextactiondatescheduled", "objectid", "priority", "symbology", "shape__length", "usetype", "waterorigin", "width_ft", "width_meters", "zone", "zone2", "created", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "version",
|
||||
).WithParent("history_linelocation"),
|
||||
tableAlias: alias,
|
||||
OrganizationID: psql.Quote(alias, "organization_id"),
|
||||
|
|
@ -147,6 +149,7 @@ func buildHistoryLinelocationColumns(alias string) historyLinelocationColumns {
|
|||
WidthMeters: psql.Quote(alias, "width_meters"),
|
||||
Zone: psql.Quote(alias, "zone"),
|
||||
Zone2: psql.Quote(alias, "zone2"),
|
||||
Created: psql.Quote(alias, "created"),
|
||||
CreatedDate: psql.Quote(alias, "created_date"),
|
||||
CreatedUser: psql.Quote(alias, "created_user"),
|
||||
GeometryX: psql.Quote(alias, "geometry_x"),
|
||||
|
|
@ -205,6 +208,7 @@ type historyLinelocationColumns struct {
|
|||
WidthMeters psql.Expression
|
||||
Zone psql.Expression
|
||||
Zone2 psql.Expression
|
||||
Created psql.Expression
|
||||
CreatedDate psql.Expression
|
||||
CreatedUser psql.Expression
|
||||
GeometryX psql.Expression
|
||||
|
|
@ -226,63 +230,64 @@ func (historyLinelocationColumns) AliasedAs(alias string) historyLinelocationCol
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type HistoryLinelocationSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
Accessdesc omitnull.Val[string] `db:"accessdesc" `
|
||||
Acres omitnull.Val[float64] `db:"acres" `
|
||||
Active omitnull.Val[int16] `db:"active" `
|
||||
Comments omitnull.Val[string] `db:"comments" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Description omitnull.Val[string] `db:"description" `
|
||||
Externalid omitnull.Val[string] `db:"externalid" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
Editor omitnull.Val[string] `db:"editor" `
|
||||
Globalid omitnull.Val[string] `db:"globalid" `
|
||||
Habitat omitnull.Val[string] `db:"habitat" `
|
||||
Hectares omitnull.Val[float64] `db:"hectares" `
|
||||
Jurisdiction omitnull.Val[string] `db:"jurisdiction" `
|
||||
Larvinspectinterval omitnull.Val[int16] `db:"larvinspectinterval" `
|
||||
Lastinspectactiontaken omitnull.Val[string] `db:"lastinspectactiontaken" `
|
||||
Lastinspectactivity omitnull.Val[string] `db:"lastinspectactivity" `
|
||||
Lastinspectavglarvae omitnull.Val[float64] `db:"lastinspectavglarvae" `
|
||||
Lastinspectavgpupae omitnull.Val[float64] `db:"lastinspectavgpupae" `
|
||||
Lastinspectbreeding omitnull.Val[string] `db:"lastinspectbreeding" `
|
||||
Lastinspectconditions omitnull.Val[string] `db:"lastinspectconditions" `
|
||||
Lastinspectdate omitnull.Val[int64] `db:"lastinspectdate" `
|
||||
Lastinspectfieldspecies omitnull.Val[string] `db:"lastinspectfieldspecies" `
|
||||
Lastinspectlstages omitnull.Val[string] `db:"lastinspectlstages" `
|
||||
Lasttreatactivity omitnull.Val[string] `db:"lasttreatactivity" `
|
||||
Lasttreatdate omitnull.Val[int64] `db:"lasttreatdate" `
|
||||
Lasttreatproduct omitnull.Val[string] `db:"lasttreatproduct" `
|
||||
Lasttreatqty omitnull.Val[float64] `db:"lasttreatqty" `
|
||||
Lasttreatqtyunit omitnull.Val[string] `db:"lasttreatqtyunit" `
|
||||
LengthFT omitnull.Val[float64] `db:"length_ft" `
|
||||
LengthMeters omitnull.Val[float64] `db:"length_meters" `
|
||||
Locationnumber omitnull.Val[int64] `db:"locationnumber" `
|
||||
Name omitnull.Val[string] `db:"name" `
|
||||
Nextactiondatescheduled omitnull.Val[int64] `db:"nextactiondatescheduled" `
|
||||
Objectid omit.Val[int32] `db:"objectid,pk" `
|
||||
Priority omitnull.Val[string] `db:"priority" `
|
||||
Symbology omitnull.Val[string] `db:"symbology" `
|
||||
ShapeLength omitnull.Val[float64] `db:"shape__length" `
|
||||
Usetype omitnull.Val[string] `db:"usetype" `
|
||||
Waterorigin omitnull.Val[string] `db:"waterorigin" `
|
||||
WidthFT omitnull.Val[float64] `db:"width_ft" `
|
||||
WidthMeters omitnull.Val[float64] `db:"width_meters" `
|
||||
Zone omitnull.Val[string] `db:"zone" `
|
||||
Zone2 omitnull.Val[string] `db:"zone2" `
|
||||
CreatedDate omitnull.Val[int64] `db:"created_date" `
|
||||
CreatedUser omitnull.Val[string] `db:"created_user" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Accessdesc omitnull.Val[string] `db:"accessdesc" `
|
||||
Acres omitnull.Val[float64] `db:"acres" `
|
||||
Active omitnull.Val[int16] `db:"active" `
|
||||
Comments omitnull.Val[string] `db:"comments" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Description omitnull.Val[string] `db:"description" `
|
||||
Externalid omitnull.Val[string] `db:"externalid" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
Editor omitnull.Val[string] `db:"editor" `
|
||||
Globalid omitnull.Val[string] `db:"globalid" `
|
||||
Habitat omitnull.Val[string] `db:"habitat" `
|
||||
Hectares omitnull.Val[float64] `db:"hectares" `
|
||||
Jurisdiction omitnull.Val[string] `db:"jurisdiction" `
|
||||
Larvinspectinterval omitnull.Val[int16] `db:"larvinspectinterval" `
|
||||
Lastinspectactiontaken omitnull.Val[string] `db:"lastinspectactiontaken" `
|
||||
Lastinspectactivity omitnull.Val[string] `db:"lastinspectactivity" `
|
||||
Lastinspectavglarvae omitnull.Val[float64] `db:"lastinspectavglarvae" `
|
||||
Lastinspectavgpupae omitnull.Val[float64] `db:"lastinspectavgpupae" `
|
||||
Lastinspectbreeding omitnull.Val[string] `db:"lastinspectbreeding" `
|
||||
Lastinspectconditions omitnull.Val[string] `db:"lastinspectconditions" `
|
||||
Lastinspectdate omitnull.Val[int64] `db:"lastinspectdate" `
|
||||
Lastinspectfieldspecies omitnull.Val[string] `db:"lastinspectfieldspecies" `
|
||||
Lastinspectlstages omitnull.Val[string] `db:"lastinspectlstages" `
|
||||
Lasttreatactivity omitnull.Val[string] `db:"lasttreatactivity" `
|
||||
Lasttreatdate omitnull.Val[int64] `db:"lasttreatdate" `
|
||||
Lasttreatproduct omitnull.Val[string] `db:"lasttreatproduct" `
|
||||
Lasttreatqty omitnull.Val[float64] `db:"lasttreatqty" `
|
||||
Lasttreatqtyunit omitnull.Val[string] `db:"lasttreatqtyunit" `
|
||||
LengthFT omitnull.Val[float64] `db:"length_ft" `
|
||||
LengthMeters omitnull.Val[float64] `db:"length_meters" `
|
||||
Locationnumber omitnull.Val[int64] `db:"locationnumber" `
|
||||
Name omitnull.Val[string] `db:"name" `
|
||||
Nextactiondatescheduled omitnull.Val[int64] `db:"nextactiondatescheduled" `
|
||||
Objectid omit.Val[int32] `db:"objectid,pk" `
|
||||
Priority omitnull.Val[string] `db:"priority" `
|
||||
Symbology omitnull.Val[string] `db:"symbology" `
|
||||
ShapeLength omitnull.Val[float64] `db:"shape__length" `
|
||||
Usetype omitnull.Val[string] `db:"usetype" `
|
||||
Waterorigin omitnull.Val[string] `db:"waterorigin" `
|
||||
WidthFT omitnull.Val[float64] `db:"width_ft" `
|
||||
WidthMeters omitnull.Val[float64] `db:"width_meters" `
|
||||
Zone omitnull.Val[string] `db:"zone" `
|
||||
Zone2 omitnull.Val[string] `db:"zone2" `
|
||||
Created omitnull.Val[time.Time] `db:"created" `
|
||||
CreatedDate omitnull.Val[int64] `db:"created_date" `
|
||||
CreatedUser omitnull.Val[string] `db:"created_user" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
}
|
||||
|
||||
func (s HistoryLinelocationSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 52)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals := make([]string, 0, 53)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Accessdesc.IsUnset() {
|
||||
|
|
@ -417,6 +422,9 @@ func (s HistoryLinelocationSetter) SetColumns() []string {
|
|||
if !s.Zone2.IsUnset() {
|
||||
vals = append(vals, "zone2")
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
vals = append(vals, "created")
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals = append(vals, "created_date")
|
||||
}
|
||||
|
|
@ -442,8 +450,8 @@ func (s HistoryLinelocationSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s HistoryLinelocationSetter) Overwrite(t *HistoryLinelocation) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Accessdesc.IsUnset() {
|
||||
t.Accessdesc = s.Accessdesc.MustGetNull()
|
||||
|
|
@ -577,6 +585,9 @@ func (s HistoryLinelocationSetter) Overwrite(t *HistoryLinelocation) {
|
|||
if !s.Zone2.IsUnset() {
|
||||
t.Zone2 = s.Zone2.MustGetNull()
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
t.Created = s.Created.MustGetNull()
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
t.CreatedDate = s.CreatedDate.MustGetNull()
|
||||
}
|
||||
|
|
@ -606,9 +617,9 @@ func (s *HistoryLinelocationSetter) Apply(q *dialect.InsertQuery) {
|
|||
})
|
||||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 52)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
vals := make([]bob.Expression, 53)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -877,48 +888,54 @@ func (s *HistoryLinelocationSetter) Apply(q *dialect.InsertQuery) {
|
|||
vals[44] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[45] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
if !s.Created.IsUnset() {
|
||||
vals[45] = psql.Arg(s.Created.MustGetNull())
|
||||
} else {
|
||||
vals[45] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[46] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[46] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
} else {
|
||||
vals[46] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[47] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[47] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
} else {
|
||||
vals[47] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[48] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[48] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
} else {
|
||||
vals[48] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[49] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[49] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
} else {
|
||||
vals[49] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[50] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[50] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
} else {
|
||||
vals[50] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[51] = psql.Arg(s.Version.MustGet())
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[51] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
} else {
|
||||
vals[51] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[52] = psql.Arg(s.Version.MustGet())
|
||||
} else {
|
||||
vals[52] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
return bob.ExpressSlice(ctx, w, d, start, vals, "", ", ", "")
|
||||
}))
|
||||
}
|
||||
|
|
@ -928,9 +945,9 @@ func (s HistoryLinelocationSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery] {
|
|||
}
|
||||
|
||||
func (s HistoryLinelocationSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 52)
|
||||
exprs := make([]bob.Expression, 0, 53)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -1245,6 +1262,13 @@ func (s HistoryLinelocationSetter) Expressions(prefix ...string) []bob.Expressio
|
|||
}})
|
||||
}
|
||||
|
||||
if !s.Created.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created")...),
|
||||
psql.Arg(s.Created),
|
||||
}})
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created_date")...),
|
||||
|
|
@ -1538,7 +1562,7 @@ func (o *HistoryLinelocation) Organization(mods ...bob.Mod[*dialect.SelectQuery]
|
|||
}
|
||||
|
||||
func (os HistoryLinelocationSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -1556,7 +1580,7 @@ func (os HistoryLinelocationSlice) Organization(mods ...bob.Mod[*dialect.SelectQ
|
|||
|
||||
func attachHistoryLinelocationOrganization0(ctx context.Context, exec bob.Executor, count int, historyLinelocation0 *HistoryLinelocation, organization1 *Organization) (*HistoryLinelocation, error) {
|
||||
setter := &HistoryLinelocationSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := historyLinelocation0.Update(ctx, exec, setter)
|
||||
|
|
@ -1603,7 +1627,7 @@ func (historyLinelocation0 *HistoryLinelocation) AttachOrganization(ctx context.
|
|||
}
|
||||
|
||||
type historyLinelocationWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Accessdesc psql.WhereNullMod[Q, string]
|
||||
Acres psql.WhereNullMod[Q, float64]
|
||||
Active psql.WhereNullMod[Q, int16]
|
||||
|
|
@ -1648,6 +1672,7 @@ type historyLinelocationWhere[Q psql.Filterable] struct {
|
|||
WidthMeters psql.WhereNullMod[Q, float64]
|
||||
Zone psql.WhereNullMod[Q, string]
|
||||
Zone2 psql.WhereNullMod[Q, string]
|
||||
Created psql.WhereNullMod[Q, time.Time]
|
||||
CreatedDate psql.WhereNullMod[Q, int64]
|
||||
CreatedUser psql.WhereNullMod[Q, string]
|
||||
GeometryX psql.WhereNullMod[Q, float64]
|
||||
|
|
@ -1663,7 +1688,7 @@ func (historyLinelocationWhere[Q]) AliasedAs(alias string) historyLinelocationWh
|
|||
|
||||
func buildHistoryLinelocationWhere[Q psql.Filterable](cols historyLinelocationColumns) historyLinelocationWhere[Q] {
|
||||
return historyLinelocationWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Accessdesc: psql.WhereNull[Q, string](cols.Accessdesc),
|
||||
Acres: psql.WhereNull[Q, float64](cols.Acres),
|
||||
Active: psql.WhereNull[Q, int16](cols.Active),
|
||||
|
|
@ -1708,6 +1733,7 @@ func buildHistoryLinelocationWhere[Q psql.Filterable](cols historyLinelocationCo
|
|||
WidthMeters: psql.WhereNull[Q, float64](cols.WidthMeters),
|
||||
Zone: psql.WhereNull[Q, string](cols.Zone),
|
||||
Zone2: psql.WhereNull[Q, string](cols.Zone2),
|
||||
Created: psql.WhereNull[Q, time.Time](cols.Created),
|
||||
CreatedDate: psql.WhereNull[Q, int64](cols.CreatedDate),
|
||||
CreatedUser: psql.WhereNull[Q, string](cols.CreatedUser),
|
||||
GeometryX: psql.WhereNull[Q, float64](cols.GeometryX),
|
||||
|
|
@ -1819,11 +1845,8 @@ func (os HistoryLinelocationSlice) LoadOrganization(ctx context.Context, exec bo
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"time"
|
||||
|
||||
"github.com/aarondl/opt/null"
|
||||
"github.com/aarondl/opt/omit"
|
||||
|
|
@ -25,22 +26,23 @@ import (
|
|||
|
||||
// HistoryLocationtracking is an object representing the database table.
|
||||
type HistoryLocationtracking struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
Accuracy null.Val[float64] `db:"accuracy" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
Editor null.Val[string] `db:"editor" `
|
||||
Fieldtech null.Val[string] `db:"fieldtech" `
|
||||
Globalid null.Val[string] `db:"globalid" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Version int32 `db:"version,pk" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Accuracy null.Val[float64] `db:"accuracy" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
Editor null.Val[string] `db:"editor" `
|
||||
Fieldtech null.Val[string] `db:"fieldtech" `
|
||||
Globalid null.Val[string] `db:"globalid" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
Created null.Val[time.Time] `db:"created" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Version int32 `db:"version,pk" `
|
||||
|
||||
R historyLocationtrackingR `db:"-" `
|
||||
}
|
||||
|
|
@ -63,7 +65,7 @@ type historyLocationtrackingR struct {
|
|||
func buildHistoryLocationtrackingColumns(alias string) historyLocationtrackingColumns {
|
||||
return historyLocationtrackingColumns{
|
||||
ColumnsExpr: expr.NewColumnsExpr(
|
||||
"organization_id", "accuracy", "creationdate", "creator", "editdate", "editor", "fieldtech", "globalid", "objectid", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "version",
|
||||
"organization_id", "accuracy", "creationdate", "creator", "editdate", "editor", "fieldtech", "globalid", "objectid", "created", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "version",
|
||||
).WithParent("history_locationtracking"),
|
||||
tableAlias: alias,
|
||||
OrganizationID: psql.Quote(alias, "organization_id"),
|
||||
|
|
@ -75,6 +77,7 @@ func buildHistoryLocationtrackingColumns(alias string) historyLocationtrackingCo
|
|||
Fieldtech: psql.Quote(alias, "fieldtech"),
|
||||
Globalid: psql.Quote(alias, "globalid"),
|
||||
Objectid: psql.Quote(alias, "objectid"),
|
||||
Created: psql.Quote(alias, "created"),
|
||||
CreatedDate: psql.Quote(alias, "created_date"),
|
||||
CreatedUser: psql.Quote(alias, "created_user"),
|
||||
GeometryX: psql.Quote(alias, "geometry_x"),
|
||||
|
|
@ -97,6 +100,7 @@ type historyLocationtrackingColumns struct {
|
|||
Fieldtech psql.Expression
|
||||
Globalid psql.Expression
|
||||
Objectid psql.Expression
|
||||
Created psql.Expression
|
||||
CreatedDate psql.Expression
|
||||
CreatedUser psql.Expression
|
||||
GeometryX psql.Expression
|
||||
|
|
@ -118,27 +122,28 @@ func (historyLocationtrackingColumns) AliasedAs(alias string) historyLocationtra
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type HistoryLocationtrackingSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
Accuracy omitnull.Val[float64] `db:"accuracy" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
Editor omitnull.Val[string] `db:"editor" `
|
||||
Fieldtech omitnull.Val[string] `db:"fieldtech" `
|
||||
Globalid omitnull.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" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Accuracy omitnull.Val[float64] `db:"accuracy" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
Editor omitnull.Val[string] `db:"editor" `
|
||||
Fieldtech omitnull.Val[string] `db:"fieldtech" `
|
||||
Globalid omitnull.Val[string] `db:"globalid" `
|
||||
Objectid omit.Val[int32] `db:"objectid,pk" `
|
||||
Created omitnull.Val[time.Time] `db:"created" `
|
||||
CreatedDate omitnull.Val[int64] `db:"created_date" `
|
||||
CreatedUser omitnull.Val[string] `db:"created_user" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
}
|
||||
|
||||
func (s HistoryLocationtrackingSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 16)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals := make([]string, 0, 17)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Accuracy.IsUnset() {
|
||||
|
|
@ -165,6 +170,9 @@ func (s HistoryLocationtrackingSetter) SetColumns() []string {
|
|||
if s.Objectid.IsValue() {
|
||||
vals = append(vals, "objectid")
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
vals = append(vals, "created")
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals = append(vals, "created_date")
|
||||
}
|
||||
|
|
@ -190,8 +198,8 @@ func (s HistoryLocationtrackingSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s HistoryLocationtrackingSetter) Overwrite(t *HistoryLocationtracking) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Accuracy.IsUnset() {
|
||||
t.Accuracy = s.Accuracy.MustGetNull()
|
||||
|
|
@ -217,6 +225,9 @@ func (s HistoryLocationtrackingSetter) Overwrite(t *HistoryLocationtracking) {
|
|||
if s.Objectid.IsValue() {
|
||||
t.Objectid = s.Objectid.MustGet()
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
t.Created = s.Created.MustGetNull()
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
t.CreatedDate = s.CreatedDate.MustGetNull()
|
||||
}
|
||||
|
|
@ -246,9 +257,9 @@ func (s *HistoryLocationtrackingSetter) Apply(q *dialect.InsertQuery) {
|
|||
})
|
||||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 16)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
vals := make([]bob.Expression, 17)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -301,48 +312,54 @@ func (s *HistoryLocationtrackingSetter) Apply(q *dialect.InsertQuery) {
|
|||
vals[8] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[9] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
if !s.Created.IsUnset() {
|
||||
vals[9] = psql.Arg(s.Created.MustGetNull())
|
||||
} else {
|
||||
vals[9] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[10] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[10] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
} else {
|
||||
vals[10] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[11] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[11] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
} else {
|
||||
vals[11] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[12] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[12] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
} else {
|
||||
vals[12] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[13] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[13] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
} else {
|
||||
vals[13] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[14] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[14] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
} else {
|
||||
vals[14] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[15] = psql.Arg(s.Version.MustGet())
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[15] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
} else {
|
||||
vals[15] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[16] = psql.Arg(s.Version.MustGet())
|
||||
} else {
|
||||
vals[16] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
return bob.ExpressSlice(ctx, w, d, start, vals, "", ", ", "")
|
||||
}))
|
||||
}
|
||||
|
|
@ -352,9 +369,9 @@ func (s HistoryLocationtrackingSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery]
|
|||
}
|
||||
|
||||
func (s HistoryLocationtrackingSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 16)
|
||||
exprs := make([]bob.Expression, 0, 17)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -417,6 +434,13 @@ func (s HistoryLocationtrackingSetter) Expressions(prefix ...string) []bob.Expre
|
|||
}})
|
||||
}
|
||||
|
||||
if !s.Created.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created")...),
|
||||
psql.Arg(s.Created),
|
||||
}})
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created_date")...),
|
||||
|
|
@ -710,7 +734,7 @@ func (o *HistoryLocationtracking) Organization(mods ...bob.Mod[*dialect.SelectQu
|
|||
}
|
||||
|
||||
func (os HistoryLocationtrackingSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -728,7 +752,7 @@ func (os HistoryLocationtrackingSlice) Organization(mods ...bob.Mod[*dialect.Sel
|
|||
|
||||
func attachHistoryLocationtrackingOrganization0(ctx context.Context, exec bob.Executor, count int, historyLocationtracking0 *HistoryLocationtracking, organization1 *Organization) (*HistoryLocationtracking, error) {
|
||||
setter := &HistoryLocationtrackingSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := historyLocationtracking0.Update(ctx, exec, setter)
|
||||
|
|
@ -775,7 +799,7 @@ func (historyLocationtracking0 *HistoryLocationtracking) AttachOrganization(ctx
|
|||
}
|
||||
|
||||
type historyLocationtrackingWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Accuracy psql.WhereNullMod[Q, float64]
|
||||
Creationdate psql.WhereNullMod[Q, int64]
|
||||
Creator psql.WhereNullMod[Q, string]
|
||||
|
|
@ -784,6 +808,7 @@ type historyLocationtrackingWhere[Q psql.Filterable] struct {
|
|||
Fieldtech psql.WhereNullMod[Q, string]
|
||||
Globalid psql.WhereNullMod[Q, string]
|
||||
Objectid psql.WhereMod[Q, int32]
|
||||
Created psql.WhereNullMod[Q, time.Time]
|
||||
CreatedDate psql.WhereNullMod[Q, int64]
|
||||
CreatedUser psql.WhereNullMod[Q, string]
|
||||
GeometryX psql.WhereNullMod[Q, float64]
|
||||
|
|
@ -799,7 +824,7 @@ func (historyLocationtrackingWhere[Q]) AliasedAs(alias string) historyLocationtr
|
|||
|
||||
func buildHistoryLocationtrackingWhere[Q psql.Filterable](cols historyLocationtrackingColumns) historyLocationtrackingWhere[Q] {
|
||||
return historyLocationtrackingWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Accuracy: psql.WhereNull[Q, float64](cols.Accuracy),
|
||||
Creationdate: psql.WhereNull[Q, int64](cols.Creationdate),
|
||||
Creator: psql.WhereNull[Q, string](cols.Creator),
|
||||
|
|
@ -808,6 +833,7 @@ func buildHistoryLocationtrackingWhere[Q psql.Filterable](cols historyLocationtr
|
|||
Fieldtech: psql.WhereNull[Q, string](cols.Fieldtech),
|
||||
Globalid: psql.WhereNull[Q, string](cols.Globalid),
|
||||
Objectid: psql.Where[Q, int32](cols.Objectid),
|
||||
Created: psql.WhereNull[Q, time.Time](cols.Created),
|
||||
CreatedDate: psql.WhereNull[Q, int64](cols.CreatedDate),
|
||||
CreatedUser: psql.WhereNull[Q, string](cols.CreatedUser),
|
||||
GeometryX: psql.WhereNull[Q, float64](cols.GeometryX),
|
||||
|
|
@ -919,11 +945,8 @@ func (os HistoryLocationtrackingSlice) LoadOrganization(ctx context.Context, exe
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"time"
|
||||
|
||||
"github.com/aarondl/opt/null"
|
||||
"github.com/aarondl/opt/omit"
|
||||
|
|
@ -25,67 +26,68 @@ import (
|
|||
|
||||
// HistoryMosquitoinspection is an object representing the database table.
|
||||
type HistoryMosquitoinspection struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
Actiontaken null.Val[string] `db:"actiontaken" `
|
||||
Activity null.Val[string] `db:"activity" `
|
||||
Adultact null.Val[string] `db:"adultact" `
|
||||
Avetemp null.Val[float64] `db:"avetemp" `
|
||||
Avglarvae null.Val[float64] `db:"avglarvae" `
|
||||
Avgpupae null.Val[float64] `db:"avgpupae" `
|
||||
Breeding null.Val[string] `db:"breeding" `
|
||||
Cbcount null.Val[int16] `db:"cbcount" `
|
||||
Comments null.Val[string] `db:"comments" `
|
||||
Containercount null.Val[int16] `db:"containercount" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Domstage null.Val[string] `db:"domstage" `
|
||||
Eggs null.Val[int16] `db:"eggs" `
|
||||
Enddatetime null.Val[int64] `db:"enddatetime" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
Editor null.Val[string] `db:"editor" `
|
||||
Fieldspecies null.Val[string] `db:"fieldspecies" `
|
||||
Fieldtech null.Val[string] `db:"fieldtech" `
|
||||
Globalid null.Val[string] `db:"globalid" `
|
||||
Jurisdiction null.Val[string] `db:"jurisdiction" `
|
||||
Larvaepresent null.Val[int16] `db:"larvaepresent" `
|
||||
Linelocid null.Val[string] `db:"linelocid" `
|
||||
Locationname null.Val[string] `db:"locationname" `
|
||||
Lstages null.Val[string] `db:"lstages" `
|
||||
Numdips null.Val[int16] `db:"numdips" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
Personalcontact null.Val[int16] `db:"personalcontact" `
|
||||
Pointlocid null.Val[string] `db:"pointlocid" `
|
||||
Polygonlocid null.Val[string] `db:"polygonlocid" `
|
||||
Posdips null.Val[int16] `db:"posdips" `
|
||||
Positivecontainercount null.Val[int16] `db:"positivecontainercount" `
|
||||
Pupaepresent null.Val[int16] `db:"pupaepresent" `
|
||||
Raingauge null.Val[float64] `db:"raingauge" `
|
||||
Recordstatus null.Val[int16] `db:"recordstatus" `
|
||||
Reviewed null.Val[int16] `db:"reviewed" `
|
||||
Reviewedby null.Val[string] `db:"reviewedby" `
|
||||
Revieweddate null.Val[int64] `db:"revieweddate" `
|
||||
Sdid null.Val[string] `db:"sdid" `
|
||||
Sitecond null.Val[string] `db:"sitecond" `
|
||||
Srid null.Val[string] `db:"srid" `
|
||||
Startdatetime null.Val[int64] `db:"startdatetime" `
|
||||
Tirecount null.Val[int16] `db:"tirecount" `
|
||||
Totlarvae null.Val[int16] `db:"totlarvae" `
|
||||
Totpupae null.Val[int16] `db:"totpupae" `
|
||||
Visualmonitoring null.Val[int16] `db:"visualmonitoring" `
|
||||
Vmcomments null.Val[string] `db:"vmcomments" `
|
||||
Winddir null.Val[string] `db:"winddir" `
|
||||
Windspeed null.Val[float64] `db:"windspeed" `
|
||||
Zone null.Val[string] `db:"zone" `
|
||||
Zone2 null.Val[string] `db:"zone2" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Adminaction null.Val[string] `db:"adminaction" `
|
||||
Ptaid null.Val[string] `db:"ptaid" `
|
||||
Version int32 `db:"version,pk" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Actiontaken null.Val[string] `db:"actiontaken" `
|
||||
Activity null.Val[string] `db:"activity" `
|
||||
Adultact null.Val[string] `db:"adultact" `
|
||||
Avetemp null.Val[float64] `db:"avetemp" `
|
||||
Avglarvae null.Val[float64] `db:"avglarvae" `
|
||||
Avgpupae null.Val[float64] `db:"avgpupae" `
|
||||
Breeding null.Val[string] `db:"breeding" `
|
||||
Cbcount null.Val[int16] `db:"cbcount" `
|
||||
Comments null.Val[string] `db:"comments" `
|
||||
Containercount null.Val[int16] `db:"containercount" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Domstage null.Val[string] `db:"domstage" `
|
||||
Eggs null.Val[int16] `db:"eggs" `
|
||||
Enddatetime null.Val[int64] `db:"enddatetime" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
Editor null.Val[string] `db:"editor" `
|
||||
Fieldspecies null.Val[string] `db:"fieldspecies" `
|
||||
Fieldtech null.Val[string] `db:"fieldtech" `
|
||||
Globalid null.Val[string] `db:"globalid" `
|
||||
Jurisdiction null.Val[string] `db:"jurisdiction" `
|
||||
Larvaepresent null.Val[int16] `db:"larvaepresent" `
|
||||
Linelocid null.Val[string] `db:"linelocid" `
|
||||
Locationname null.Val[string] `db:"locationname" `
|
||||
Lstages null.Val[string] `db:"lstages" `
|
||||
Numdips null.Val[int16] `db:"numdips" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
Personalcontact null.Val[int16] `db:"personalcontact" `
|
||||
Pointlocid null.Val[string] `db:"pointlocid" `
|
||||
Polygonlocid null.Val[string] `db:"polygonlocid" `
|
||||
Posdips null.Val[int16] `db:"posdips" `
|
||||
Positivecontainercount null.Val[int16] `db:"positivecontainercount" `
|
||||
Pupaepresent null.Val[int16] `db:"pupaepresent" `
|
||||
Raingauge null.Val[float64] `db:"raingauge" `
|
||||
Recordstatus null.Val[int16] `db:"recordstatus" `
|
||||
Reviewed null.Val[int16] `db:"reviewed" `
|
||||
Reviewedby null.Val[string] `db:"reviewedby" `
|
||||
Revieweddate null.Val[int64] `db:"revieweddate" `
|
||||
Sdid null.Val[string] `db:"sdid" `
|
||||
Sitecond null.Val[string] `db:"sitecond" `
|
||||
Srid null.Val[string] `db:"srid" `
|
||||
Startdatetime null.Val[int64] `db:"startdatetime" `
|
||||
Tirecount null.Val[int16] `db:"tirecount" `
|
||||
Totlarvae null.Val[int16] `db:"totlarvae" `
|
||||
Totpupae null.Val[int16] `db:"totpupae" `
|
||||
Visualmonitoring null.Val[int16] `db:"visualmonitoring" `
|
||||
Vmcomments null.Val[string] `db:"vmcomments" `
|
||||
Winddir null.Val[string] `db:"winddir" `
|
||||
Windspeed null.Val[float64] `db:"windspeed" `
|
||||
Zone null.Val[string] `db:"zone" `
|
||||
Zone2 null.Val[string] `db:"zone2" `
|
||||
Created null.Val[time.Time] `db:"created" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Adminaction null.Val[string] `db:"adminaction" `
|
||||
Ptaid null.Val[string] `db:"ptaid" `
|
||||
Version int32 `db:"version,pk" `
|
||||
|
||||
R historyMosquitoinspectionR `db:"-" `
|
||||
}
|
||||
|
|
@ -108,7 +110,7 @@ type historyMosquitoinspectionR struct {
|
|||
func buildHistoryMosquitoinspectionColumns(alias string) historyMosquitoinspectionColumns {
|
||||
return historyMosquitoinspectionColumns{
|
||||
ColumnsExpr: expr.NewColumnsExpr(
|
||||
"organization_id", "actiontaken", "activity", "adultact", "avetemp", "avglarvae", "avgpupae", "breeding", "cbcount", "comments", "containercount", "creationdate", "creator", "domstage", "eggs", "enddatetime", "editdate", "editor", "fieldspecies", "fieldtech", "globalid", "jurisdiction", "larvaepresent", "linelocid", "locationname", "lstages", "numdips", "objectid", "personalcontact", "pointlocid", "polygonlocid", "posdips", "positivecontainercount", "pupaepresent", "raingauge", "recordstatus", "reviewed", "reviewedby", "revieweddate", "sdid", "sitecond", "srid", "startdatetime", "tirecount", "totlarvae", "totpupae", "visualmonitoring", "vmcomments", "winddir", "windspeed", "zone", "zone2", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "adminaction", "ptaid", "version",
|
||||
"organization_id", "actiontaken", "activity", "adultact", "avetemp", "avglarvae", "avgpupae", "breeding", "cbcount", "comments", "containercount", "creationdate", "creator", "domstage", "eggs", "enddatetime", "editdate", "editor", "fieldspecies", "fieldtech", "globalid", "jurisdiction", "larvaepresent", "linelocid", "locationname", "lstages", "numdips", "objectid", "personalcontact", "pointlocid", "polygonlocid", "posdips", "positivecontainercount", "pupaepresent", "raingauge", "recordstatus", "reviewed", "reviewedby", "revieweddate", "sdid", "sitecond", "srid", "startdatetime", "tirecount", "totlarvae", "totpupae", "visualmonitoring", "vmcomments", "winddir", "windspeed", "zone", "zone2", "created", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "adminaction", "ptaid", "version",
|
||||
).WithParent("history_mosquitoinspection"),
|
||||
tableAlias: alias,
|
||||
OrganizationID: psql.Quote(alias, "organization_id"),
|
||||
|
|
@ -163,6 +165,7 @@ func buildHistoryMosquitoinspectionColumns(alias string) historyMosquitoinspecti
|
|||
Windspeed: psql.Quote(alias, "windspeed"),
|
||||
Zone: psql.Quote(alias, "zone"),
|
||||
Zone2: psql.Quote(alias, "zone2"),
|
||||
Created: psql.Quote(alias, "created"),
|
||||
CreatedDate: psql.Quote(alias, "created_date"),
|
||||
CreatedUser: psql.Quote(alias, "created_user"),
|
||||
GeometryX: psql.Quote(alias, "geometry_x"),
|
||||
|
|
@ -230,6 +233,7 @@ type historyMosquitoinspectionColumns struct {
|
|||
Windspeed psql.Expression
|
||||
Zone psql.Expression
|
||||
Zone2 psql.Expression
|
||||
Created psql.Expression
|
||||
CreatedDate psql.Expression
|
||||
CreatedUser psql.Expression
|
||||
GeometryX psql.Expression
|
||||
|
|
@ -253,72 +257,73 @@ func (historyMosquitoinspectionColumns) AliasedAs(alias string) historyMosquitoi
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type HistoryMosquitoinspectionSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
Actiontaken omitnull.Val[string] `db:"actiontaken" `
|
||||
Activity omitnull.Val[string] `db:"activity" `
|
||||
Adultact omitnull.Val[string] `db:"adultact" `
|
||||
Avetemp omitnull.Val[float64] `db:"avetemp" `
|
||||
Avglarvae omitnull.Val[float64] `db:"avglarvae" `
|
||||
Avgpupae omitnull.Val[float64] `db:"avgpupae" `
|
||||
Breeding omitnull.Val[string] `db:"breeding" `
|
||||
Cbcount omitnull.Val[int16] `db:"cbcount" `
|
||||
Comments omitnull.Val[string] `db:"comments" `
|
||||
Containercount omitnull.Val[int16] `db:"containercount" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Domstage omitnull.Val[string] `db:"domstage" `
|
||||
Eggs omitnull.Val[int16] `db:"eggs" `
|
||||
Enddatetime omitnull.Val[int64] `db:"enddatetime" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
Editor omitnull.Val[string] `db:"editor" `
|
||||
Fieldspecies omitnull.Val[string] `db:"fieldspecies" `
|
||||
Fieldtech omitnull.Val[string] `db:"fieldtech" `
|
||||
Globalid omitnull.Val[string] `db:"globalid" `
|
||||
Jurisdiction omitnull.Val[string] `db:"jurisdiction" `
|
||||
Larvaepresent omitnull.Val[int16] `db:"larvaepresent" `
|
||||
Linelocid omitnull.Val[string] `db:"linelocid" `
|
||||
Locationname omitnull.Val[string] `db:"locationname" `
|
||||
Lstages omitnull.Val[string] `db:"lstages" `
|
||||
Numdips omitnull.Val[int16] `db:"numdips" `
|
||||
Objectid omit.Val[int32] `db:"objectid,pk" `
|
||||
Personalcontact omitnull.Val[int16] `db:"personalcontact" `
|
||||
Pointlocid omitnull.Val[string] `db:"pointlocid" `
|
||||
Polygonlocid omitnull.Val[string] `db:"polygonlocid" `
|
||||
Posdips omitnull.Val[int16] `db:"posdips" `
|
||||
Positivecontainercount omitnull.Val[int16] `db:"positivecontainercount" `
|
||||
Pupaepresent omitnull.Val[int16] `db:"pupaepresent" `
|
||||
Raingauge omitnull.Val[float64] `db:"raingauge" `
|
||||
Recordstatus omitnull.Val[int16] `db:"recordstatus" `
|
||||
Reviewed omitnull.Val[int16] `db:"reviewed" `
|
||||
Reviewedby omitnull.Val[string] `db:"reviewedby" `
|
||||
Revieweddate omitnull.Val[int64] `db:"revieweddate" `
|
||||
Sdid omitnull.Val[string] `db:"sdid" `
|
||||
Sitecond omitnull.Val[string] `db:"sitecond" `
|
||||
Srid omitnull.Val[string] `db:"srid" `
|
||||
Startdatetime omitnull.Val[int64] `db:"startdatetime" `
|
||||
Tirecount omitnull.Val[int16] `db:"tirecount" `
|
||||
Totlarvae omitnull.Val[int16] `db:"totlarvae" `
|
||||
Totpupae omitnull.Val[int16] `db:"totpupae" `
|
||||
Visualmonitoring omitnull.Val[int16] `db:"visualmonitoring" `
|
||||
Vmcomments omitnull.Val[string] `db:"vmcomments" `
|
||||
Winddir omitnull.Val[string] `db:"winddir" `
|
||||
Windspeed omitnull.Val[float64] `db:"windspeed" `
|
||||
Zone omitnull.Val[string] `db:"zone" `
|
||||
Zone2 omitnull.Val[string] `db:"zone2" `
|
||||
CreatedDate omitnull.Val[int64] `db:"created_date" `
|
||||
CreatedUser omitnull.Val[string] `db:"created_user" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Adminaction omitnull.Val[string] `db:"adminaction" `
|
||||
Ptaid omitnull.Val[string] `db:"ptaid" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Actiontaken omitnull.Val[string] `db:"actiontaken" `
|
||||
Activity omitnull.Val[string] `db:"activity" `
|
||||
Adultact omitnull.Val[string] `db:"adultact" `
|
||||
Avetemp omitnull.Val[float64] `db:"avetemp" `
|
||||
Avglarvae omitnull.Val[float64] `db:"avglarvae" `
|
||||
Avgpupae omitnull.Val[float64] `db:"avgpupae" `
|
||||
Breeding omitnull.Val[string] `db:"breeding" `
|
||||
Cbcount omitnull.Val[int16] `db:"cbcount" `
|
||||
Comments omitnull.Val[string] `db:"comments" `
|
||||
Containercount omitnull.Val[int16] `db:"containercount" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Domstage omitnull.Val[string] `db:"domstage" `
|
||||
Eggs omitnull.Val[int16] `db:"eggs" `
|
||||
Enddatetime omitnull.Val[int64] `db:"enddatetime" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
Editor omitnull.Val[string] `db:"editor" `
|
||||
Fieldspecies omitnull.Val[string] `db:"fieldspecies" `
|
||||
Fieldtech omitnull.Val[string] `db:"fieldtech" `
|
||||
Globalid omitnull.Val[string] `db:"globalid" `
|
||||
Jurisdiction omitnull.Val[string] `db:"jurisdiction" `
|
||||
Larvaepresent omitnull.Val[int16] `db:"larvaepresent" `
|
||||
Linelocid omitnull.Val[string] `db:"linelocid" `
|
||||
Locationname omitnull.Val[string] `db:"locationname" `
|
||||
Lstages omitnull.Val[string] `db:"lstages" `
|
||||
Numdips omitnull.Val[int16] `db:"numdips" `
|
||||
Objectid omit.Val[int32] `db:"objectid,pk" `
|
||||
Personalcontact omitnull.Val[int16] `db:"personalcontact" `
|
||||
Pointlocid omitnull.Val[string] `db:"pointlocid" `
|
||||
Polygonlocid omitnull.Val[string] `db:"polygonlocid" `
|
||||
Posdips omitnull.Val[int16] `db:"posdips" `
|
||||
Positivecontainercount omitnull.Val[int16] `db:"positivecontainercount" `
|
||||
Pupaepresent omitnull.Val[int16] `db:"pupaepresent" `
|
||||
Raingauge omitnull.Val[float64] `db:"raingauge" `
|
||||
Recordstatus omitnull.Val[int16] `db:"recordstatus" `
|
||||
Reviewed omitnull.Val[int16] `db:"reviewed" `
|
||||
Reviewedby omitnull.Val[string] `db:"reviewedby" `
|
||||
Revieweddate omitnull.Val[int64] `db:"revieweddate" `
|
||||
Sdid omitnull.Val[string] `db:"sdid" `
|
||||
Sitecond omitnull.Val[string] `db:"sitecond" `
|
||||
Srid omitnull.Val[string] `db:"srid" `
|
||||
Startdatetime omitnull.Val[int64] `db:"startdatetime" `
|
||||
Tirecount omitnull.Val[int16] `db:"tirecount" `
|
||||
Totlarvae omitnull.Val[int16] `db:"totlarvae" `
|
||||
Totpupae omitnull.Val[int16] `db:"totpupae" `
|
||||
Visualmonitoring omitnull.Val[int16] `db:"visualmonitoring" `
|
||||
Vmcomments omitnull.Val[string] `db:"vmcomments" `
|
||||
Winddir omitnull.Val[string] `db:"winddir" `
|
||||
Windspeed omitnull.Val[float64] `db:"windspeed" `
|
||||
Zone omitnull.Val[string] `db:"zone" `
|
||||
Zone2 omitnull.Val[string] `db:"zone2" `
|
||||
Created omitnull.Val[time.Time] `db:"created" `
|
||||
CreatedDate omitnull.Val[int64] `db:"created_date" `
|
||||
CreatedUser omitnull.Val[string] `db:"created_user" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Adminaction omitnull.Val[string] `db:"adminaction" `
|
||||
Ptaid omitnull.Val[string] `db:"ptaid" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
}
|
||||
|
||||
func (s HistoryMosquitoinspectionSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 61)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals := make([]string, 0, 62)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Actiontaken.IsUnset() {
|
||||
|
|
@ -474,6 +479,9 @@ func (s HistoryMosquitoinspectionSetter) SetColumns() []string {
|
|||
if !s.Zone2.IsUnset() {
|
||||
vals = append(vals, "zone2")
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
vals = append(vals, "created")
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals = append(vals, "created_date")
|
||||
}
|
||||
|
|
@ -505,8 +513,8 @@ func (s HistoryMosquitoinspectionSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s HistoryMosquitoinspectionSetter) Overwrite(t *HistoryMosquitoinspection) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Actiontaken.IsUnset() {
|
||||
t.Actiontaken = s.Actiontaken.MustGetNull()
|
||||
|
|
@ -661,6 +669,9 @@ func (s HistoryMosquitoinspectionSetter) Overwrite(t *HistoryMosquitoinspection)
|
|||
if !s.Zone2.IsUnset() {
|
||||
t.Zone2 = s.Zone2.MustGetNull()
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
t.Created = s.Created.MustGetNull()
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
t.CreatedDate = s.CreatedDate.MustGetNull()
|
||||
}
|
||||
|
|
@ -696,9 +707,9 @@ func (s *HistoryMosquitoinspectionSetter) Apply(q *dialect.InsertQuery) {
|
|||
})
|
||||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 61)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
vals := make([]bob.Expression, 62)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -1009,60 +1020,66 @@ func (s *HistoryMosquitoinspectionSetter) Apply(q *dialect.InsertQuery) {
|
|||
vals[51] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[52] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
if !s.Created.IsUnset() {
|
||||
vals[52] = psql.Arg(s.Created.MustGetNull())
|
||||
} else {
|
||||
vals[52] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[53] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[53] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
} else {
|
||||
vals[53] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[54] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[54] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
} else {
|
||||
vals[54] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[55] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[55] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
} else {
|
||||
vals[55] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[56] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[56] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
} else {
|
||||
vals[56] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[57] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[57] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
} else {
|
||||
vals[57] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.Adminaction.IsUnset() {
|
||||
vals[58] = psql.Arg(s.Adminaction.MustGetNull())
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[58] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
} else {
|
||||
vals[58] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.Ptaid.IsUnset() {
|
||||
vals[59] = psql.Arg(s.Ptaid.MustGetNull())
|
||||
if !s.Adminaction.IsUnset() {
|
||||
vals[59] = psql.Arg(s.Adminaction.MustGetNull())
|
||||
} else {
|
||||
vals[59] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[60] = psql.Arg(s.Version.MustGet())
|
||||
if !s.Ptaid.IsUnset() {
|
||||
vals[60] = psql.Arg(s.Ptaid.MustGetNull())
|
||||
} else {
|
||||
vals[60] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[61] = psql.Arg(s.Version.MustGet())
|
||||
} else {
|
||||
vals[61] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
return bob.ExpressSlice(ctx, w, d, start, vals, "", ", ", "")
|
||||
}))
|
||||
}
|
||||
|
|
@ -1072,9 +1089,9 @@ func (s HistoryMosquitoinspectionSetter) UpdateMod() bob.Mod[*dialect.UpdateQuer
|
|||
}
|
||||
|
||||
func (s HistoryMosquitoinspectionSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 61)
|
||||
exprs := make([]bob.Expression, 0, 62)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -1438,6 +1455,13 @@ func (s HistoryMosquitoinspectionSetter) Expressions(prefix ...string) []bob.Exp
|
|||
}})
|
||||
}
|
||||
|
||||
if !s.Created.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created")...),
|
||||
psql.Arg(s.Created),
|
||||
}})
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created_date")...),
|
||||
|
|
@ -1745,7 +1769,7 @@ func (o *HistoryMosquitoinspection) Organization(mods ...bob.Mod[*dialect.Select
|
|||
}
|
||||
|
||||
func (os HistoryMosquitoinspectionSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -1763,7 +1787,7 @@ func (os HistoryMosquitoinspectionSlice) Organization(mods ...bob.Mod[*dialect.S
|
|||
|
||||
func attachHistoryMosquitoinspectionOrganization0(ctx context.Context, exec bob.Executor, count int, historyMosquitoinspection0 *HistoryMosquitoinspection, organization1 *Organization) (*HistoryMosquitoinspection, error) {
|
||||
setter := &HistoryMosquitoinspectionSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := historyMosquitoinspection0.Update(ctx, exec, setter)
|
||||
|
|
@ -1810,7 +1834,7 @@ func (historyMosquitoinspection0 *HistoryMosquitoinspection) AttachOrganization(
|
|||
}
|
||||
|
||||
type historyMosquitoinspectionWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Actiontaken psql.WhereNullMod[Q, string]
|
||||
Activity psql.WhereNullMod[Q, string]
|
||||
Adultact psql.WhereNullMod[Q, string]
|
||||
|
|
@ -1862,6 +1886,7 @@ type historyMosquitoinspectionWhere[Q psql.Filterable] struct {
|
|||
Windspeed psql.WhereNullMod[Q, float64]
|
||||
Zone psql.WhereNullMod[Q, string]
|
||||
Zone2 psql.WhereNullMod[Q, string]
|
||||
Created psql.WhereNullMod[Q, time.Time]
|
||||
CreatedDate psql.WhereNullMod[Q, int64]
|
||||
CreatedUser psql.WhereNullMod[Q, string]
|
||||
GeometryX psql.WhereNullMod[Q, float64]
|
||||
|
|
@ -1879,7 +1904,7 @@ func (historyMosquitoinspectionWhere[Q]) AliasedAs(alias string) historyMosquito
|
|||
|
||||
func buildHistoryMosquitoinspectionWhere[Q psql.Filterable](cols historyMosquitoinspectionColumns) historyMosquitoinspectionWhere[Q] {
|
||||
return historyMosquitoinspectionWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Actiontaken: psql.WhereNull[Q, string](cols.Actiontaken),
|
||||
Activity: psql.WhereNull[Q, string](cols.Activity),
|
||||
Adultact: psql.WhereNull[Q, string](cols.Adultact),
|
||||
|
|
@ -1931,6 +1956,7 @@ func buildHistoryMosquitoinspectionWhere[Q psql.Filterable](cols historyMosquito
|
|||
Windspeed: psql.WhereNull[Q, float64](cols.Windspeed),
|
||||
Zone: psql.WhereNull[Q, string](cols.Zone),
|
||||
Zone2: psql.WhereNull[Q, string](cols.Zone2),
|
||||
Created: psql.WhereNull[Q, time.Time](cols.Created),
|
||||
CreatedDate: psql.WhereNull[Q, int64](cols.CreatedDate),
|
||||
CreatedUser: psql.WhereNull[Q, string](cols.CreatedUser),
|
||||
GeometryX: psql.WhereNull[Q, float64](cols.GeometryX),
|
||||
|
|
@ -2044,11 +2070,8 @@ func (os HistoryMosquitoinspectionSlice) LoadOrganization(ctx context.Context, e
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import (
|
|||
|
||||
// HistoryPointlocation is an object representing the database table.
|
||||
type HistoryPointlocation struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Accessdesc null.Val[string] `db:"accessdesc" `
|
||||
Active null.Val[int16] `db:"active" `
|
||||
Comments null.Val[string] `db:"comments" `
|
||||
|
|
@ -214,7 +214,7 @@ func (historyPointlocationColumns) AliasedAs(alias string) historyPointlocationC
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type HistoryPointlocationSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Accessdesc omitnull.Val[string] `db:"accessdesc" `
|
||||
Active omitnull.Val[int16] `db:"active" `
|
||||
Comments omitnull.Val[string] `db:"comments" `
|
||||
|
|
@ -266,7 +266,7 @@ type HistoryPointlocationSetter struct {
|
|||
|
||||
func (s HistoryPointlocationSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 48)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Accessdesc.IsUnset() {
|
||||
|
|
@ -414,8 +414,8 @@ func (s HistoryPointlocationSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s HistoryPointlocationSetter) Overwrite(t *HistoryPointlocation) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Accessdesc.IsUnset() {
|
||||
t.Accessdesc = s.Accessdesc.MustGetNull()
|
||||
|
|
@ -567,8 +567,8 @@ func (s *HistoryPointlocationSetter) Apply(q *dialect.InsertQuery) {
|
|||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 48)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -866,7 +866,7 @@ func (s HistoryPointlocationSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery] {
|
|||
func (s HistoryPointlocationSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 48)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -1446,7 +1446,7 @@ func (o *HistoryPointlocation) Organization(mods ...bob.Mod[*dialect.SelectQuery
|
|||
}
|
||||
|
||||
func (os HistoryPointlocationSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -1464,7 +1464,7 @@ func (os HistoryPointlocationSlice) Organization(mods ...bob.Mod[*dialect.Select
|
|||
|
||||
func attachHistoryPointlocationOrganization0(ctx context.Context, exec bob.Executor, count int, historyPointlocation0 *HistoryPointlocation, organization1 *Organization) (*HistoryPointlocation, error) {
|
||||
setter := &HistoryPointlocationSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := historyPointlocation0.Update(ctx, exec, setter)
|
||||
|
|
@ -1511,7 +1511,7 @@ func (historyPointlocation0 *HistoryPointlocation) AttachOrganization(ctx contex
|
|||
}
|
||||
|
||||
type historyPointlocationWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Accessdesc psql.WhereNullMod[Q, string]
|
||||
Active psql.WhereNullMod[Q, int16]
|
||||
Comments psql.WhereNullMod[Q, string]
|
||||
|
|
@ -1567,7 +1567,7 @@ func (historyPointlocationWhere[Q]) AliasedAs(alias string) historyPointlocation
|
|||
|
||||
func buildHistoryPointlocationWhere[Q psql.Filterable](cols historyPointlocationColumns) historyPointlocationWhere[Q] {
|
||||
return historyPointlocationWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Accessdesc: psql.WhereNull[Q, string](cols.Accessdesc),
|
||||
Active: psql.WhereNull[Q, int16](cols.Active),
|
||||
Comments: psql.WhereNull[Q, string](cols.Comments),
|
||||
|
|
@ -1719,11 +1719,8 @@ func (os HistoryPointlocationSlice) LoadOrganization(ctx context.Context, exec b
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import (
|
|||
|
||||
// HistoryPolygonlocation is an object representing the database table.
|
||||
type HistoryPolygonlocation struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Accessdesc null.Val[string] `db:"accessdesc" `
|
||||
Acres null.Val[float64] `db:"acres" `
|
||||
Active null.Val[int16] `db:"active" `
|
||||
|
|
@ -208,7 +208,7 @@ func (historyPolygonlocationColumns) AliasedAs(alias string) historyPolygonlocat
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type HistoryPolygonlocationSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Accessdesc omitnull.Val[string] `db:"accessdesc" `
|
||||
Acres omitnull.Val[float64] `db:"acres" `
|
||||
Active omitnull.Val[int16] `db:"active" `
|
||||
|
|
@ -258,7 +258,7 @@ type HistoryPolygonlocationSetter struct {
|
|||
|
||||
func (s HistoryPolygonlocationSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 46)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Accessdesc.IsUnset() {
|
||||
|
|
@ -400,8 +400,8 @@ func (s HistoryPolygonlocationSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s HistoryPolygonlocationSetter) Overwrite(t *HistoryPolygonlocation) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Accessdesc.IsUnset() {
|
||||
t.Accessdesc = s.Accessdesc.MustGetNull()
|
||||
|
|
@ -547,8 +547,8 @@ func (s *HistoryPolygonlocationSetter) Apply(q *dialect.InsertQuery) {
|
|||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 46)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -834,7 +834,7 @@ func (s HistoryPolygonlocationSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery]
|
|||
func (s HistoryPolygonlocationSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 46)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -1400,7 +1400,7 @@ func (o *HistoryPolygonlocation) Organization(mods ...bob.Mod[*dialect.SelectQue
|
|||
}
|
||||
|
||||
func (os HistoryPolygonlocationSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -1418,7 +1418,7 @@ func (os HistoryPolygonlocationSlice) Organization(mods ...bob.Mod[*dialect.Sele
|
|||
|
||||
func attachHistoryPolygonlocationOrganization0(ctx context.Context, exec bob.Executor, count int, historyPolygonlocation0 *HistoryPolygonlocation, organization1 *Organization) (*HistoryPolygonlocation, error) {
|
||||
setter := &HistoryPolygonlocationSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := historyPolygonlocation0.Update(ctx, exec, setter)
|
||||
|
|
@ -1465,7 +1465,7 @@ func (historyPolygonlocation0 *HistoryPolygonlocation) AttachOrganization(ctx co
|
|||
}
|
||||
|
||||
type historyPolygonlocationWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Accessdesc psql.WhereNullMod[Q, string]
|
||||
Acres psql.WhereNullMod[Q, float64]
|
||||
Active psql.WhereNullMod[Q, int16]
|
||||
|
|
@ -1519,7 +1519,7 @@ func (historyPolygonlocationWhere[Q]) AliasedAs(alias string) historyPolygonloca
|
|||
|
||||
func buildHistoryPolygonlocationWhere[Q psql.Filterable](cols historyPolygonlocationColumns) historyPolygonlocationWhere[Q] {
|
||||
return historyPolygonlocationWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Accessdesc: psql.WhereNull[Q, string](cols.Accessdesc),
|
||||
Acres: psql.WhereNull[Q, float64](cols.Acres),
|
||||
Active: psql.WhereNull[Q, int16](cols.Active),
|
||||
|
|
@ -1669,11 +1669,8 @@ func (os HistoryPolygonlocationSlice) LoadOrganization(ctx context.Context, exec
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"time"
|
||||
|
||||
"github.com/aarondl/opt/null"
|
||||
"github.com/aarondl/opt/omit"
|
||||
|
|
@ -25,38 +26,39 @@ import (
|
|||
|
||||
// HistoryPool is an object representing the database table.
|
||||
type HistoryPool struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
Comments null.Val[string] `db:"comments" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Datesent null.Val[int64] `db:"datesent" `
|
||||
Datetested null.Val[int64] `db:"datetested" `
|
||||
Diseasepos null.Val[string] `db:"diseasepos" `
|
||||
Diseasetested null.Val[string] `db:"diseasetested" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
Editor null.Val[string] `db:"editor" `
|
||||
Gatewaysync null.Val[int16] `db:"gatewaysync" `
|
||||
Globalid null.Val[string] `db:"globalid" `
|
||||
Lab null.Val[string] `db:"lab" `
|
||||
LabID null.Val[string] `db:"lab_id" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
Poolyear null.Val[int16] `db:"poolyear" `
|
||||
Processed null.Val[int16] `db:"processed" `
|
||||
Sampleid null.Val[string] `db:"sampleid" `
|
||||
Survtech null.Val[string] `db:"survtech" `
|
||||
Testmethod null.Val[string] `db:"testmethod" `
|
||||
Testtech null.Val[string] `db:"testtech" `
|
||||
TrapdataID null.Val[string] `db:"trapdata_id" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Vectorsurvcollectionid null.Val[string] `db:"vectorsurvcollectionid" `
|
||||
Vectorsurvpoolid null.Val[string] `db:"vectorsurvpoolid" `
|
||||
Vectorsurvtrapdataid null.Val[string] `db:"vectorsurvtrapdataid" `
|
||||
Version int32 `db:"version,pk" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Comments null.Val[string] `db:"comments" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Datesent null.Val[int64] `db:"datesent" `
|
||||
Datetested null.Val[int64] `db:"datetested" `
|
||||
Diseasepos null.Val[string] `db:"diseasepos" `
|
||||
Diseasetested null.Val[string] `db:"diseasetested" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
Editor null.Val[string] `db:"editor" `
|
||||
Gatewaysync null.Val[int16] `db:"gatewaysync" `
|
||||
Globalid null.Val[string] `db:"globalid" `
|
||||
Lab null.Val[string] `db:"lab" `
|
||||
LabID null.Val[string] `db:"lab_id" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
Poolyear null.Val[int16] `db:"poolyear" `
|
||||
Processed null.Val[int16] `db:"processed" `
|
||||
Sampleid null.Val[string] `db:"sampleid" `
|
||||
Survtech null.Val[string] `db:"survtech" `
|
||||
Testmethod null.Val[string] `db:"testmethod" `
|
||||
Testtech null.Val[string] `db:"testtech" `
|
||||
TrapdataID null.Val[string] `db:"trapdata_id" `
|
||||
Created null.Val[time.Time] `db:"created" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Vectorsurvcollectionid null.Val[string] `db:"vectorsurvcollectionid" `
|
||||
Vectorsurvpoolid null.Val[string] `db:"vectorsurvpoolid" `
|
||||
Vectorsurvtrapdataid null.Val[string] `db:"vectorsurvtrapdataid" `
|
||||
Version int32 `db:"version,pk" `
|
||||
|
||||
R historyPoolR `db:"-" `
|
||||
}
|
||||
|
|
@ -79,7 +81,7 @@ type historyPoolR struct {
|
|||
func buildHistoryPoolColumns(alias string) historyPoolColumns {
|
||||
return historyPoolColumns{
|
||||
ColumnsExpr: expr.NewColumnsExpr(
|
||||
"organization_id", "comments", "creationdate", "creator", "datesent", "datetested", "diseasepos", "diseasetested", "editdate", "editor", "gatewaysync", "globalid", "lab", "lab_id", "objectid", "poolyear", "processed", "sampleid", "survtech", "testmethod", "testtech", "trapdata_id", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "vectorsurvcollectionid", "vectorsurvpoolid", "vectorsurvtrapdataid", "version",
|
||||
"organization_id", "comments", "creationdate", "creator", "datesent", "datetested", "diseasepos", "diseasetested", "editdate", "editor", "gatewaysync", "globalid", "lab", "lab_id", "objectid", "poolyear", "processed", "sampleid", "survtech", "testmethod", "testtech", "trapdata_id", "created", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "vectorsurvcollectionid", "vectorsurvpoolid", "vectorsurvtrapdataid", "version",
|
||||
).WithParent("history_pool"),
|
||||
tableAlias: alias,
|
||||
OrganizationID: psql.Quote(alias, "organization_id"),
|
||||
|
|
@ -104,6 +106,7 @@ func buildHistoryPoolColumns(alias string) historyPoolColumns {
|
|||
Testmethod: psql.Quote(alias, "testmethod"),
|
||||
Testtech: psql.Quote(alias, "testtech"),
|
||||
TrapdataID: psql.Quote(alias, "trapdata_id"),
|
||||
Created: psql.Quote(alias, "created"),
|
||||
CreatedDate: psql.Quote(alias, "created_date"),
|
||||
CreatedUser: psql.Quote(alias, "created_user"),
|
||||
GeometryX: psql.Quote(alias, "geometry_x"),
|
||||
|
|
@ -142,6 +145,7 @@ type historyPoolColumns struct {
|
|||
Testmethod psql.Expression
|
||||
Testtech psql.Expression
|
||||
TrapdataID psql.Expression
|
||||
Created psql.Expression
|
||||
CreatedDate psql.Expression
|
||||
CreatedUser psql.Expression
|
||||
GeometryX psql.Expression
|
||||
|
|
@ -166,43 +170,44 @@ func (historyPoolColumns) AliasedAs(alias string) historyPoolColumns {
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type HistoryPoolSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
Comments omitnull.Val[string] `db:"comments" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Datesent omitnull.Val[int64] `db:"datesent" `
|
||||
Datetested omitnull.Val[int64] `db:"datetested" `
|
||||
Diseasepos omitnull.Val[string] `db:"diseasepos" `
|
||||
Diseasetested omitnull.Val[string] `db:"diseasetested" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
Editor omitnull.Val[string] `db:"editor" `
|
||||
Gatewaysync omitnull.Val[int16] `db:"gatewaysync" `
|
||||
Globalid omitnull.Val[string] `db:"globalid" `
|
||||
Lab omitnull.Val[string] `db:"lab" `
|
||||
LabID omitnull.Val[string] `db:"lab_id" `
|
||||
Objectid omit.Val[int32] `db:"objectid,pk" `
|
||||
Poolyear omitnull.Val[int16] `db:"poolyear" `
|
||||
Processed omitnull.Val[int16] `db:"processed" `
|
||||
Sampleid omitnull.Val[string] `db:"sampleid" `
|
||||
Survtech omitnull.Val[string] `db:"survtech" `
|
||||
Testmethod omitnull.Val[string] `db:"testmethod" `
|
||||
Testtech omitnull.Val[string] `db:"testtech" `
|
||||
TrapdataID omitnull.Val[string] `db:"trapdata_id" `
|
||||
CreatedDate omitnull.Val[int64] `db:"created_date" `
|
||||
CreatedUser omitnull.Val[string] `db:"created_user" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Vectorsurvcollectionid omitnull.Val[string] `db:"vectorsurvcollectionid" `
|
||||
Vectorsurvpoolid omitnull.Val[string] `db:"vectorsurvpoolid" `
|
||||
Vectorsurvtrapdataid omitnull.Val[string] `db:"vectorsurvtrapdataid" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Comments omitnull.Val[string] `db:"comments" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Datesent omitnull.Val[int64] `db:"datesent" `
|
||||
Datetested omitnull.Val[int64] `db:"datetested" `
|
||||
Diseasepos omitnull.Val[string] `db:"diseasepos" `
|
||||
Diseasetested omitnull.Val[string] `db:"diseasetested" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
Editor omitnull.Val[string] `db:"editor" `
|
||||
Gatewaysync omitnull.Val[int16] `db:"gatewaysync" `
|
||||
Globalid omitnull.Val[string] `db:"globalid" `
|
||||
Lab omitnull.Val[string] `db:"lab" `
|
||||
LabID omitnull.Val[string] `db:"lab_id" `
|
||||
Objectid omit.Val[int32] `db:"objectid,pk" `
|
||||
Poolyear omitnull.Val[int16] `db:"poolyear" `
|
||||
Processed omitnull.Val[int16] `db:"processed" `
|
||||
Sampleid omitnull.Val[string] `db:"sampleid" `
|
||||
Survtech omitnull.Val[string] `db:"survtech" `
|
||||
Testmethod omitnull.Val[string] `db:"testmethod" `
|
||||
Testtech omitnull.Val[string] `db:"testtech" `
|
||||
TrapdataID omitnull.Val[string] `db:"trapdata_id" `
|
||||
Created omitnull.Val[time.Time] `db:"created" `
|
||||
CreatedDate omitnull.Val[int64] `db:"created_date" `
|
||||
CreatedUser omitnull.Val[string] `db:"created_user" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Vectorsurvcollectionid omitnull.Val[string] `db:"vectorsurvcollectionid" `
|
||||
Vectorsurvpoolid omitnull.Val[string] `db:"vectorsurvpoolid" `
|
||||
Vectorsurvtrapdataid omitnull.Val[string] `db:"vectorsurvtrapdataid" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
}
|
||||
|
||||
func (s HistoryPoolSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 32)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals := make([]string, 0, 33)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Comments.IsUnset() {
|
||||
|
|
@ -268,6 +273,9 @@ func (s HistoryPoolSetter) SetColumns() []string {
|
|||
if !s.TrapdataID.IsUnset() {
|
||||
vals = append(vals, "trapdata_id")
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
vals = append(vals, "created")
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals = append(vals, "created_date")
|
||||
}
|
||||
|
|
@ -302,8 +310,8 @@ func (s HistoryPoolSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s HistoryPoolSetter) Overwrite(t *HistoryPool) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Comments.IsUnset() {
|
||||
t.Comments = s.Comments.MustGetNull()
|
||||
|
|
@ -368,6 +376,9 @@ func (s HistoryPoolSetter) Overwrite(t *HistoryPool) {
|
|||
if !s.TrapdataID.IsUnset() {
|
||||
t.TrapdataID = s.TrapdataID.MustGetNull()
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
t.Created = s.Created.MustGetNull()
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
t.CreatedDate = s.CreatedDate.MustGetNull()
|
||||
}
|
||||
|
|
@ -406,9 +417,9 @@ func (s *HistoryPoolSetter) Apply(q *dialect.InsertQuery) {
|
|||
})
|
||||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 32)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
vals := make([]bob.Expression, 33)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -539,66 +550,72 @@ func (s *HistoryPoolSetter) Apply(q *dialect.InsertQuery) {
|
|||
vals[21] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[22] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
if !s.Created.IsUnset() {
|
||||
vals[22] = psql.Arg(s.Created.MustGetNull())
|
||||
} else {
|
||||
vals[22] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[23] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[23] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
} else {
|
||||
vals[23] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[24] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[24] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
} else {
|
||||
vals[24] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[25] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[25] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
} else {
|
||||
vals[25] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[26] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[26] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
} else {
|
||||
vals[26] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[27] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[27] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
} else {
|
||||
vals[27] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.Vectorsurvcollectionid.IsUnset() {
|
||||
vals[28] = psql.Arg(s.Vectorsurvcollectionid.MustGetNull())
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[28] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
} else {
|
||||
vals[28] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.Vectorsurvpoolid.IsUnset() {
|
||||
vals[29] = psql.Arg(s.Vectorsurvpoolid.MustGetNull())
|
||||
if !s.Vectorsurvcollectionid.IsUnset() {
|
||||
vals[29] = psql.Arg(s.Vectorsurvcollectionid.MustGetNull())
|
||||
} else {
|
||||
vals[29] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.Vectorsurvtrapdataid.IsUnset() {
|
||||
vals[30] = psql.Arg(s.Vectorsurvtrapdataid.MustGetNull())
|
||||
if !s.Vectorsurvpoolid.IsUnset() {
|
||||
vals[30] = psql.Arg(s.Vectorsurvpoolid.MustGetNull())
|
||||
} else {
|
||||
vals[30] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[31] = psql.Arg(s.Version.MustGet())
|
||||
if !s.Vectorsurvtrapdataid.IsUnset() {
|
||||
vals[31] = psql.Arg(s.Vectorsurvtrapdataid.MustGetNull())
|
||||
} else {
|
||||
vals[31] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[32] = psql.Arg(s.Version.MustGet())
|
||||
} else {
|
||||
vals[32] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
return bob.ExpressSlice(ctx, w, d, start, vals, "", ", ", "")
|
||||
}))
|
||||
}
|
||||
|
|
@ -608,9 +625,9 @@ func (s HistoryPoolSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery] {
|
|||
}
|
||||
|
||||
func (s HistoryPoolSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 32)
|
||||
exprs := make([]bob.Expression, 0, 33)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -764,6 +781,13 @@ func (s HistoryPoolSetter) Expressions(prefix ...string) []bob.Expression {
|
|||
}})
|
||||
}
|
||||
|
||||
if !s.Created.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created")...),
|
||||
psql.Arg(s.Created),
|
||||
}})
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created_date")...),
|
||||
|
|
@ -1078,7 +1102,7 @@ func (o *HistoryPool) Organization(mods ...bob.Mod[*dialect.SelectQuery]) Organi
|
|||
}
|
||||
|
||||
func (os HistoryPoolSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -1096,7 +1120,7 @@ func (os HistoryPoolSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) O
|
|||
|
||||
func attachHistoryPoolOrganization0(ctx context.Context, exec bob.Executor, count int, historyPool0 *HistoryPool, organization1 *Organization) (*HistoryPool, error) {
|
||||
setter := &HistoryPoolSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := historyPool0.Update(ctx, exec, setter)
|
||||
|
|
@ -1143,7 +1167,7 @@ func (historyPool0 *HistoryPool) AttachOrganization(ctx context.Context, exec bo
|
|||
}
|
||||
|
||||
type historyPoolWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Comments psql.WhereNullMod[Q, string]
|
||||
Creationdate psql.WhereNullMod[Q, int64]
|
||||
Creator psql.WhereNullMod[Q, string]
|
||||
|
|
@ -1165,6 +1189,7 @@ type historyPoolWhere[Q psql.Filterable] struct {
|
|||
Testmethod psql.WhereNullMod[Q, string]
|
||||
Testtech psql.WhereNullMod[Q, string]
|
||||
TrapdataID psql.WhereNullMod[Q, string]
|
||||
Created psql.WhereNullMod[Q, time.Time]
|
||||
CreatedDate psql.WhereNullMod[Q, int64]
|
||||
CreatedUser psql.WhereNullMod[Q, string]
|
||||
GeometryX psql.WhereNullMod[Q, float64]
|
||||
|
|
@ -1183,7 +1208,7 @@ func (historyPoolWhere[Q]) AliasedAs(alias string) historyPoolWhere[Q] {
|
|||
|
||||
func buildHistoryPoolWhere[Q psql.Filterable](cols historyPoolColumns) historyPoolWhere[Q] {
|
||||
return historyPoolWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Comments: psql.WhereNull[Q, string](cols.Comments),
|
||||
Creationdate: psql.WhereNull[Q, int64](cols.Creationdate),
|
||||
Creator: psql.WhereNull[Q, string](cols.Creator),
|
||||
|
|
@ -1205,6 +1230,7 @@ func buildHistoryPoolWhere[Q psql.Filterable](cols historyPoolColumns) historyPo
|
|||
Testmethod: psql.WhereNull[Q, string](cols.Testmethod),
|
||||
Testtech: psql.WhereNull[Q, string](cols.Testtech),
|
||||
TrapdataID: psql.WhereNull[Q, string](cols.TrapdataID),
|
||||
Created: psql.WhereNull[Q, time.Time](cols.Created),
|
||||
CreatedDate: psql.WhereNull[Q, int64](cols.CreatedDate),
|
||||
CreatedUser: psql.WhereNull[Q, string](cols.CreatedUser),
|
||||
GeometryX: psql.WhereNull[Q, float64](cols.GeometryX),
|
||||
|
|
@ -1319,11 +1345,8 @@ func (os HistoryPoolSlice) LoadOrganization(ctx context.Context, exec bob.Execut
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"time"
|
||||
|
||||
"github.com/aarondl/opt/null"
|
||||
"github.com/aarondl/opt/omit"
|
||||
|
|
@ -25,24 +26,25 @@ import (
|
|||
|
||||
// HistoryPooldetail is an object representing the database table.
|
||||
type HistoryPooldetail struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
Editor null.Val[string] `db:"editor" `
|
||||
Females null.Val[int16] `db:"females" `
|
||||
Globalid null.Val[string] `db:"globalid" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
PoolID null.Val[string] `db:"pool_id" `
|
||||
Species null.Val[string] `db:"species" `
|
||||
TrapdataID null.Val[string] `db:"trapdata_id" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Version int32 `db:"version,pk" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
Editor null.Val[string] `db:"editor" `
|
||||
Females null.Val[int16] `db:"females" `
|
||||
Globalid null.Val[string] `db:"globalid" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
PoolID null.Val[string] `db:"pool_id" `
|
||||
Species null.Val[string] `db:"species" `
|
||||
TrapdataID null.Val[string] `db:"trapdata_id" `
|
||||
Created null.Val[time.Time] `db:"created" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Version int32 `db:"version,pk" `
|
||||
|
||||
R historyPooldetailR `db:"-" `
|
||||
}
|
||||
|
|
@ -65,7 +67,7 @@ type historyPooldetailR struct {
|
|||
func buildHistoryPooldetailColumns(alias string) historyPooldetailColumns {
|
||||
return historyPooldetailColumns{
|
||||
ColumnsExpr: expr.NewColumnsExpr(
|
||||
"organization_id", "creationdate", "creator", "editdate", "editor", "females", "globalid", "objectid", "pool_id", "species", "trapdata_id", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "version",
|
||||
"organization_id", "creationdate", "creator", "editdate", "editor", "females", "globalid", "objectid", "pool_id", "species", "trapdata_id", "created", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "version",
|
||||
).WithParent("history_pooldetail"),
|
||||
tableAlias: alias,
|
||||
OrganizationID: psql.Quote(alias, "organization_id"),
|
||||
|
|
@ -79,6 +81,7 @@ func buildHistoryPooldetailColumns(alias string) historyPooldetailColumns {
|
|||
PoolID: psql.Quote(alias, "pool_id"),
|
||||
Species: psql.Quote(alias, "species"),
|
||||
TrapdataID: psql.Quote(alias, "trapdata_id"),
|
||||
Created: psql.Quote(alias, "created"),
|
||||
CreatedDate: psql.Quote(alias, "created_date"),
|
||||
CreatedUser: psql.Quote(alias, "created_user"),
|
||||
GeometryX: psql.Quote(alias, "geometry_x"),
|
||||
|
|
@ -103,6 +106,7 @@ type historyPooldetailColumns struct {
|
|||
PoolID psql.Expression
|
||||
Species psql.Expression
|
||||
TrapdataID psql.Expression
|
||||
Created psql.Expression
|
||||
CreatedDate psql.Expression
|
||||
CreatedUser psql.Expression
|
||||
GeometryX psql.Expression
|
||||
|
|
@ -124,29 +128,30 @@ func (historyPooldetailColumns) AliasedAs(alias string) historyPooldetailColumns
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type HistoryPooldetailSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
Editor omitnull.Val[string] `db:"editor" `
|
||||
Females omitnull.Val[int16] `db:"females" `
|
||||
Globalid omitnull.Val[string] `db:"globalid" `
|
||||
Objectid omit.Val[int32] `db:"objectid,pk" `
|
||||
PoolID omitnull.Val[string] `db:"pool_id" `
|
||||
Species omitnull.Val[string] `db:"species" `
|
||||
TrapdataID omitnull.Val[string] `db:"trapdata_id" `
|
||||
CreatedDate omitnull.Val[int64] `db:"created_date" `
|
||||
CreatedUser omitnull.Val[string] `db:"created_user" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
Editor omitnull.Val[string] `db:"editor" `
|
||||
Females omitnull.Val[int16] `db:"females" `
|
||||
Globalid omitnull.Val[string] `db:"globalid" `
|
||||
Objectid omit.Val[int32] `db:"objectid,pk" `
|
||||
PoolID omitnull.Val[string] `db:"pool_id" `
|
||||
Species omitnull.Val[string] `db:"species" `
|
||||
TrapdataID omitnull.Val[string] `db:"trapdata_id" `
|
||||
Created omitnull.Val[time.Time] `db:"created" `
|
||||
CreatedDate omitnull.Val[int64] `db:"created_date" `
|
||||
CreatedUser omitnull.Val[string] `db:"created_user" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
}
|
||||
|
||||
func (s HistoryPooldetailSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 18)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals := make([]string, 0, 19)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Creationdate.IsUnset() {
|
||||
|
|
@ -179,6 +184,9 @@ func (s HistoryPooldetailSetter) SetColumns() []string {
|
|||
if !s.TrapdataID.IsUnset() {
|
||||
vals = append(vals, "trapdata_id")
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
vals = append(vals, "created")
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals = append(vals, "created_date")
|
||||
}
|
||||
|
|
@ -204,8 +212,8 @@ func (s HistoryPooldetailSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s HistoryPooldetailSetter) Overwrite(t *HistoryPooldetail) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Creationdate.IsUnset() {
|
||||
t.Creationdate = s.Creationdate.MustGetNull()
|
||||
|
|
@ -237,6 +245,9 @@ func (s HistoryPooldetailSetter) Overwrite(t *HistoryPooldetail) {
|
|||
if !s.TrapdataID.IsUnset() {
|
||||
t.TrapdataID = s.TrapdataID.MustGetNull()
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
t.Created = s.Created.MustGetNull()
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
t.CreatedDate = s.CreatedDate.MustGetNull()
|
||||
}
|
||||
|
|
@ -266,9 +277,9 @@ func (s *HistoryPooldetailSetter) Apply(q *dialect.InsertQuery) {
|
|||
})
|
||||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 18)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
vals := make([]bob.Expression, 19)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -333,48 +344,54 @@ func (s *HistoryPooldetailSetter) Apply(q *dialect.InsertQuery) {
|
|||
vals[10] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[11] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
if !s.Created.IsUnset() {
|
||||
vals[11] = psql.Arg(s.Created.MustGetNull())
|
||||
} else {
|
||||
vals[11] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[12] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[12] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
} else {
|
||||
vals[12] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[13] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[13] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
} else {
|
||||
vals[13] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[14] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[14] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
} else {
|
||||
vals[14] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[15] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[15] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
} else {
|
||||
vals[15] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[16] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[16] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
} else {
|
||||
vals[16] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[17] = psql.Arg(s.Version.MustGet())
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[17] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
} else {
|
||||
vals[17] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[18] = psql.Arg(s.Version.MustGet())
|
||||
} else {
|
||||
vals[18] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
return bob.ExpressSlice(ctx, w, d, start, vals, "", ", ", "")
|
||||
}))
|
||||
}
|
||||
|
|
@ -384,9 +401,9 @@ func (s HistoryPooldetailSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery] {
|
|||
}
|
||||
|
||||
func (s HistoryPooldetailSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 18)
|
||||
exprs := make([]bob.Expression, 0, 19)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -463,6 +480,13 @@ func (s HistoryPooldetailSetter) Expressions(prefix ...string) []bob.Expression
|
|||
}})
|
||||
}
|
||||
|
||||
if !s.Created.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created")...),
|
||||
psql.Arg(s.Created),
|
||||
}})
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created_date")...),
|
||||
|
|
@ -756,7 +780,7 @@ func (o *HistoryPooldetail) Organization(mods ...bob.Mod[*dialect.SelectQuery])
|
|||
}
|
||||
|
||||
func (os HistoryPooldetailSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -774,7 +798,7 @@ func (os HistoryPooldetailSlice) Organization(mods ...bob.Mod[*dialect.SelectQue
|
|||
|
||||
func attachHistoryPooldetailOrganization0(ctx context.Context, exec bob.Executor, count int, historyPooldetail0 *HistoryPooldetail, organization1 *Organization) (*HistoryPooldetail, error) {
|
||||
setter := &HistoryPooldetailSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := historyPooldetail0.Update(ctx, exec, setter)
|
||||
|
|
@ -821,7 +845,7 @@ func (historyPooldetail0 *HistoryPooldetail) AttachOrganization(ctx context.Cont
|
|||
}
|
||||
|
||||
type historyPooldetailWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Creationdate psql.WhereNullMod[Q, int64]
|
||||
Creator psql.WhereNullMod[Q, string]
|
||||
Editdate psql.WhereNullMod[Q, int64]
|
||||
|
|
@ -832,6 +856,7 @@ type historyPooldetailWhere[Q psql.Filterable] struct {
|
|||
PoolID psql.WhereNullMod[Q, string]
|
||||
Species psql.WhereNullMod[Q, string]
|
||||
TrapdataID psql.WhereNullMod[Q, string]
|
||||
Created psql.WhereNullMod[Q, time.Time]
|
||||
CreatedDate psql.WhereNullMod[Q, int64]
|
||||
CreatedUser psql.WhereNullMod[Q, string]
|
||||
GeometryX psql.WhereNullMod[Q, float64]
|
||||
|
|
@ -847,7 +872,7 @@ func (historyPooldetailWhere[Q]) AliasedAs(alias string) historyPooldetailWhere[
|
|||
|
||||
func buildHistoryPooldetailWhere[Q psql.Filterable](cols historyPooldetailColumns) historyPooldetailWhere[Q] {
|
||||
return historyPooldetailWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Creationdate: psql.WhereNull[Q, int64](cols.Creationdate),
|
||||
Creator: psql.WhereNull[Q, string](cols.Creator),
|
||||
Editdate: psql.WhereNull[Q, int64](cols.Editdate),
|
||||
|
|
@ -858,6 +883,7 @@ func buildHistoryPooldetailWhere[Q psql.Filterable](cols historyPooldetailColumn
|
|||
PoolID: psql.WhereNull[Q, string](cols.PoolID),
|
||||
Species: psql.WhereNull[Q, string](cols.Species),
|
||||
TrapdataID: psql.WhereNull[Q, string](cols.TrapdataID),
|
||||
Created: psql.WhereNull[Q, time.Time](cols.Created),
|
||||
CreatedDate: psql.WhereNull[Q, int64](cols.CreatedDate),
|
||||
CreatedUser: psql.WhereNull[Q, string](cols.CreatedUser),
|
||||
GeometryX: psql.WhereNull[Q, float64](cols.GeometryX),
|
||||
|
|
@ -969,11 +995,8 @@ func (os HistoryPooldetailSlice) LoadOrganization(ctx context.Context, exec bob.
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import (
|
|||
|
||||
// HistoryProposedtreatmentarea is an object representing the database table.
|
||||
type HistoryProposedtreatmentarea struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Acres null.Val[float64] `db:"acres" `
|
||||
Comments null.Val[string] `db:"comments" `
|
||||
Completed null.Val[int16] `db:"completed" `
|
||||
|
|
@ -181,7 +181,7 @@ func (historyProposedtreatmentareaColumns) AliasedAs(alias string) historyPropos
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type HistoryProposedtreatmentareaSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Acres omitnull.Val[float64] `db:"acres" `
|
||||
Comments omitnull.Val[string] `db:"comments" `
|
||||
Completed omitnull.Val[int16] `db:"completed" `
|
||||
|
|
@ -222,7 +222,7 @@ type HistoryProposedtreatmentareaSetter struct {
|
|||
|
||||
func (s HistoryProposedtreatmentareaSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 37)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Acres.IsUnset() {
|
||||
|
|
@ -337,8 +337,8 @@ func (s HistoryProposedtreatmentareaSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s HistoryProposedtreatmentareaSetter) Overwrite(t *HistoryProposedtreatmentarea) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Acres.IsUnset() {
|
||||
t.Acres = s.Acres.MustGetNull()
|
||||
|
|
@ -457,8 +457,8 @@ func (s *HistoryProposedtreatmentareaSetter) Apply(q *dialect.InsertQuery) {
|
|||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 37)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -690,7 +690,7 @@ func (s HistoryProposedtreatmentareaSetter) UpdateMod() bob.Mod[*dialect.UpdateQ
|
|||
func (s HistoryProposedtreatmentareaSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 37)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -1193,7 +1193,7 @@ func (o *HistoryProposedtreatmentarea) Organization(mods ...bob.Mod[*dialect.Sel
|
|||
}
|
||||
|
||||
func (os HistoryProposedtreatmentareaSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -1211,7 +1211,7 @@ func (os HistoryProposedtreatmentareaSlice) Organization(mods ...bob.Mod[*dialec
|
|||
|
||||
func attachHistoryProposedtreatmentareaOrganization0(ctx context.Context, exec bob.Executor, count int, historyProposedtreatmentarea0 *HistoryProposedtreatmentarea, organization1 *Organization) (*HistoryProposedtreatmentarea, error) {
|
||||
setter := &HistoryProposedtreatmentareaSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := historyProposedtreatmentarea0.Update(ctx, exec, setter)
|
||||
|
|
@ -1258,7 +1258,7 @@ func (historyProposedtreatmentarea0 *HistoryProposedtreatmentarea) AttachOrganiz
|
|||
}
|
||||
|
||||
type historyProposedtreatmentareaWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Acres psql.WhereNullMod[Q, float64]
|
||||
Comments psql.WhereNullMod[Q, string]
|
||||
Completed psql.WhereNullMod[Q, int16]
|
||||
|
|
@ -1303,7 +1303,7 @@ func (historyProposedtreatmentareaWhere[Q]) AliasedAs(alias string) historyPropo
|
|||
|
||||
func buildHistoryProposedtreatmentareaWhere[Q psql.Filterable](cols historyProposedtreatmentareaColumns) historyProposedtreatmentareaWhere[Q] {
|
||||
return historyProposedtreatmentareaWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Acres: psql.WhereNull[Q, float64](cols.Acres),
|
||||
Comments: psql.WhereNull[Q, string](cols.Comments),
|
||||
Completed: psql.WhereNull[Q, int16](cols.Completed),
|
||||
|
|
@ -1444,11 +1444,8 @@ func (os HistoryProposedtreatmentareaSlice) LoadOrganization(ctx context.Context
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"time"
|
||||
|
||||
"github.com/aarondl/opt/null"
|
||||
"github.com/aarondl/opt/omit"
|
||||
|
|
@ -25,72 +26,73 @@ import (
|
|||
|
||||
// HistoryQamosquitoinspection is an object representing the database table.
|
||||
type HistoryQamosquitoinspection struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
Acresbreeding null.Val[float64] `db:"acresbreeding" `
|
||||
Actiontaken null.Val[string] `db:"actiontaken" `
|
||||
Adultactivity null.Val[int16] `db:"adultactivity" `
|
||||
Aquaticorganisms null.Val[string] `db:"aquaticorganisms" `
|
||||
Avetemp null.Val[float64] `db:"avetemp" `
|
||||
Breedingpotential null.Val[string] `db:"breedingpotential" `
|
||||
Comments null.Val[string] `db:"comments" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Enddatetime null.Val[int64] `db:"enddatetime" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
Editor null.Val[string] `db:"editor" `
|
||||
Fieldtech null.Val[string] `db:"fieldtech" `
|
||||
Fish null.Val[int16] `db:"fish" `
|
||||
Globalid null.Val[string] `db:"globalid" `
|
||||
Habvalue1 null.Val[int16] `db:"habvalue1" `
|
||||
Habvalue1percent null.Val[int16] `db:"habvalue1percent" `
|
||||
Habvalue2 null.Val[int16] `db:"habvalue2" `
|
||||
Habvalue2percent null.Val[int16] `db:"habvalue2percent" `
|
||||
Larvaeinsidetreatedarea null.Val[int16] `db:"larvaeinsidetreatedarea" `
|
||||
Larvaeoutsidetreatedarea null.Val[int16] `db:"larvaeoutsidetreatedarea" `
|
||||
Larvaepresent null.Val[int16] `db:"larvaepresent" `
|
||||
Larvaereason null.Val[string] `db:"larvaereason" `
|
||||
Linelocid null.Val[string] `db:"linelocid" `
|
||||
Locationname null.Val[string] `db:"locationname" `
|
||||
LR null.Val[int16] `db:"lr" `
|
||||
Mosquitohabitat null.Val[string] `db:"mosquitohabitat" `
|
||||
Movingwater null.Val[int16] `db:"movingwater" `
|
||||
Negdips null.Val[int16] `db:"negdips" `
|
||||
Nowaterever null.Val[int16] `db:"nowaterever" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
Pointlocid null.Val[string] `db:"pointlocid" `
|
||||
Polygonlocid null.Val[string] `db:"polygonlocid" `
|
||||
Posdips null.Val[int16] `db:"posdips" `
|
||||
Potential null.Val[int16] `db:"potential" `
|
||||
Raingauge null.Val[float64] `db:"raingauge" `
|
||||
Recordstatus null.Val[int16] `db:"recordstatus" `
|
||||
Reviewed null.Val[int16] `db:"reviewed" `
|
||||
Reviewedby null.Val[string] `db:"reviewedby" `
|
||||
Revieweddate null.Val[int64] `db:"revieweddate" `
|
||||
Sitetype null.Val[string] `db:"sitetype" `
|
||||
Soilconditions null.Val[string] `db:"soilconditions" `
|
||||
Sourcereduction null.Val[string] `db:"sourcereduction" `
|
||||
Startdatetime null.Val[int64] `db:"startdatetime" `
|
||||
Totalacres null.Val[float64] `db:"totalacres" `
|
||||
Vegetation null.Val[string] `db:"vegetation" `
|
||||
Waterconditions null.Val[string] `db:"waterconditions" `
|
||||
Waterduration null.Val[string] `db:"waterduration" `
|
||||
Watermovement1 null.Val[string] `db:"watermovement1" `
|
||||
Watermovement1percent null.Val[int16] `db:"watermovement1percent" `
|
||||
Watermovement2 null.Val[string] `db:"watermovement2" `
|
||||
Watermovement2percent null.Val[int16] `db:"watermovement2percent" `
|
||||
Waterpresent null.Val[int16] `db:"waterpresent" `
|
||||
Watersource null.Val[string] `db:"watersource" `
|
||||
Winddir null.Val[string] `db:"winddir" `
|
||||
Windspeed null.Val[float64] `db:"windspeed" `
|
||||
Zone null.Val[string] `db:"zone" `
|
||||
Zone2 null.Val[string] `db:"zone2" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Version int32 `db:"version,pk" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Acresbreeding null.Val[float64] `db:"acresbreeding" `
|
||||
Actiontaken null.Val[string] `db:"actiontaken" `
|
||||
Adultactivity null.Val[int16] `db:"adultactivity" `
|
||||
Aquaticorganisms null.Val[string] `db:"aquaticorganisms" `
|
||||
Avetemp null.Val[float64] `db:"avetemp" `
|
||||
Breedingpotential null.Val[string] `db:"breedingpotential" `
|
||||
Comments null.Val[string] `db:"comments" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Enddatetime null.Val[int64] `db:"enddatetime" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
Editor null.Val[string] `db:"editor" `
|
||||
Fieldtech null.Val[string] `db:"fieldtech" `
|
||||
Fish null.Val[int16] `db:"fish" `
|
||||
Globalid null.Val[string] `db:"globalid" `
|
||||
Habvalue1 null.Val[int16] `db:"habvalue1" `
|
||||
Habvalue1percent null.Val[int16] `db:"habvalue1percent" `
|
||||
Habvalue2 null.Val[int16] `db:"habvalue2" `
|
||||
Habvalue2percent null.Val[int16] `db:"habvalue2percent" `
|
||||
Larvaeinsidetreatedarea null.Val[int16] `db:"larvaeinsidetreatedarea" `
|
||||
Larvaeoutsidetreatedarea null.Val[int16] `db:"larvaeoutsidetreatedarea" `
|
||||
Larvaepresent null.Val[int16] `db:"larvaepresent" `
|
||||
Larvaereason null.Val[string] `db:"larvaereason" `
|
||||
Linelocid null.Val[string] `db:"linelocid" `
|
||||
Locationname null.Val[string] `db:"locationname" `
|
||||
LR null.Val[int16] `db:"lr" `
|
||||
Mosquitohabitat null.Val[string] `db:"mosquitohabitat" `
|
||||
Movingwater null.Val[int16] `db:"movingwater" `
|
||||
Negdips null.Val[int16] `db:"negdips" `
|
||||
Nowaterever null.Val[int16] `db:"nowaterever" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
Pointlocid null.Val[string] `db:"pointlocid" `
|
||||
Polygonlocid null.Val[string] `db:"polygonlocid" `
|
||||
Posdips null.Val[int16] `db:"posdips" `
|
||||
Potential null.Val[int16] `db:"potential" `
|
||||
Raingauge null.Val[float64] `db:"raingauge" `
|
||||
Recordstatus null.Val[int16] `db:"recordstatus" `
|
||||
Reviewed null.Val[int16] `db:"reviewed" `
|
||||
Reviewedby null.Val[string] `db:"reviewedby" `
|
||||
Revieweddate null.Val[int64] `db:"revieweddate" `
|
||||
Sitetype null.Val[string] `db:"sitetype" `
|
||||
Soilconditions null.Val[string] `db:"soilconditions" `
|
||||
Sourcereduction null.Val[string] `db:"sourcereduction" `
|
||||
Startdatetime null.Val[int64] `db:"startdatetime" `
|
||||
Totalacres null.Val[float64] `db:"totalacres" `
|
||||
Vegetation null.Val[string] `db:"vegetation" `
|
||||
Waterconditions null.Val[string] `db:"waterconditions" `
|
||||
Waterduration null.Val[string] `db:"waterduration" `
|
||||
Watermovement1 null.Val[string] `db:"watermovement1" `
|
||||
Watermovement1percent null.Val[int16] `db:"watermovement1percent" `
|
||||
Watermovement2 null.Val[string] `db:"watermovement2" `
|
||||
Watermovement2percent null.Val[int16] `db:"watermovement2percent" `
|
||||
Waterpresent null.Val[int16] `db:"waterpresent" `
|
||||
Watersource null.Val[string] `db:"watersource" `
|
||||
Winddir null.Val[string] `db:"winddir" `
|
||||
Windspeed null.Val[float64] `db:"windspeed" `
|
||||
Zone null.Val[string] `db:"zone" `
|
||||
Zone2 null.Val[string] `db:"zone2" `
|
||||
Created null.Val[time.Time] `db:"created" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Version int32 `db:"version,pk" `
|
||||
|
||||
R historyQamosquitoinspectionR `db:"-" `
|
||||
}
|
||||
|
|
@ -113,7 +115,7 @@ type historyQamosquitoinspectionR struct {
|
|||
func buildHistoryQamosquitoinspectionColumns(alias string) historyQamosquitoinspectionColumns {
|
||||
return historyQamosquitoinspectionColumns{
|
||||
ColumnsExpr: expr.NewColumnsExpr(
|
||||
"organization_id", "acresbreeding", "actiontaken", "adultactivity", "aquaticorganisms", "avetemp", "breedingpotential", "comments", "creationdate", "creator", "enddatetime", "editdate", "editor", "fieldtech", "fish", "globalid", "habvalue1", "habvalue1percent", "habvalue2", "habvalue2percent", "larvaeinsidetreatedarea", "larvaeoutsidetreatedarea", "larvaepresent", "larvaereason", "linelocid", "locationname", "lr", "mosquitohabitat", "movingwater", "negdips", "nowaterever", "objectid", "pointlocid", "polygonlocid", "posdips", "potential", "raingauge", "recordstatus", "reviewed", "reviewedby", "revieweddate", "sitetype", "soilconditions", "sourcereduction", "startdatetime", "totalacres", "vegetation", "waterconditions", "waterduration", "watermovement1", "watermovement1percent", "watermovement2", "watermovement2percent", "waterpresent", "watersource", "winddir", "windspeed", "zone", "zone2", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "version",
|
||||
"organization_id", "acresbreeding", "actiontaken", "adultactivity", "aquaticorganisms", "avetemp", "breedingpotential", "comments", "creationdate", "creator", "enddatetime", "editdate", "editor", "fieldtech", "fish", "globalid", "habvalue1", "habvalue1percent", "habvalue2", "habvalue2percent", "larvaeinsidetreatedarea", "larvaeoutsidetreatedarea", "larvaepresent", "larvaereason", "linelocid", "locationname", "lr", "mosquitohabitat", "movingwater", "negdips", "nowaterever", "objectid", "pointlocid", "polygonlocid", "posdips", "potential", "raingauge", "recordstatus", "reviewed", "reviewedby", "revieweddate", "sitetype", "soilconditions", "sourcereduction", "startdatetime", "totalacres", "vegetation", "waterconditions", "waterduration", "watermovement1", "watermovement1percent", "watermovement2", "watermovement2percent", "waterpresent", "watersource", "winddir", "windspeed", "zone", "zone2", "created", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "version",
|
||||
).WithParent("history_qamosquitoinspection"),
|
||||
tableAlias: alias,
|
||||
OrganizationID: psql.Quote(alias, "organization_id"),
|
||||
|
|
@ -175,6 +177,7 @@ func buildHistoryQamosquitoinspectionColumns(alias string) historyQamosquitoinsp
|
|||
Windspeed: psql.Quote(alias, "windspeed"),
|
||||
Zone: psql.Quote(alias, "zone"),
|
||||
Zone2: psql.Quote(alias, "zone2"),
|
||||
Created: psql.Quote(alias, "created"),
|
||||
CreatedDate: psql.Quote(alias, "created_date"),
|
||||
CreatedUser: psql.Quote(alias, "created_user"),
|
||||
GeometryX: psql.Quote(alias, "geometry_x"),
|
||||
|
|
@ -247,6 +250,7 @@ type historyQamosquitoinspectionColumns struct {
|
|||
Windspeed psql.Expression
|
||||
Zone psql.Expression
|
||||
Zone2 psql.Expression
|
||||
Created psql.Expression
|
||||
CreatedDate psql.Expression
|
||||
CreatedUser psql.Expression
|
||||
GeometryX psql.Expression
|
||||
|
|
@ -268,77 +272,78 @@ func (historyQamosquitoinspectionColumns) AliasedAs(alias string) historyQamosqu
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type HistoryQamosquitoinspectionSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
Acresbreeding omitnull.Val[float64] `db:"acresbreeding" `
|
||||
Actiontaken omitnull.Val[string] `db:"actiontaken" `
|
||||
Adultactivity omitnull.Val[int16] `db:"adultactivity" `
|
||||
Aquaticorganisms omitnull.Val[string] `db:"aquaticorganisms" `
|
||||
Avetemp omitnull.Val[float64] `db:"avetemp" `
|
||||
Breedingpotential omitnull.Val[string] `db:"breedingpotential" `
|
||||
Comments omitnull.Val[string] `db:"comments" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Enddatetime omitnull.Val[int64] `db:"enddatetime" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
Editor omitnull.Val[string] `db:"editor" `
|
||||
Fieldtech omitnull.Val[string] `db:"fieldtech" `
|
||||
Fish omitnull.Val[int16] `db:"fish" `
|
||||
Globalid omitnull.Val[string] `db:"globalid" `
|
||||
Habvalue1 omitnull.Val[int16] `db:"habvalue1" `
|
||||
Habvalue1percent omitnull.Val[int16] `db:"habvalue1percent" `
|
||||
Habvalue2 omitnull.Val[int16] `db:"habvalue2" `
|
||||
Habvalue2percent omitnull.Val[int16] `db:"habvalue2percent" `
|
||||
Larvaeinsidetreatedarea omitnull.Val[int16] `db:"larvaeinsidetreatedarea" `
|
||||
Larvaeoutsidetreatedarea omitnull.Val[int16] `db:"larvaeoutsidetreatedarea" `
|
||||
Larvaepresent omitnull.Val[int16] `db:"larvaepresent" `
|
||||
Larvaereason omitnull.Val[string] `db:"larvaereason" `
|
||||
Linelocid omitnull.Val[string] `db:"linelocid" `
|
||||
Locationname omitnull.Val[string] `db:"locationname" `
|
||||
LR omitnull.Val[int16] `db:"lr" `
|
||||
Mosquitohabitat omitnull.Val[string] `db:"mosquitohabitat" `
|
||||
Movingwater omitnull.Val[int16] `db:"movingwater" `
|
||||
Negdips omitnull.Val[int16] `db:"negdips" `
|
||||
Nowaterever omitnull.Val[int16] `db:"nowaterever" `
|
||||
Objectid omit.Val[int32] `db:"objectid,pk" `
|
||||
Pointlocid omitnull.Val[string] `db:"pointlocid" `
|
||||
Polygonlocid omitnull.Val[string] `db:"polygonlocid" `
|
||||
Posdips omitnull.Val[int16] `db:"posdips" `
|
||||
Potential omitnull.Val[int16] `db:"potential" `
|
||||
Raingauge omitnull.Val[float64] `db:"raingauge" `
|
||||
Recordstatus omitnull.Val[int16] `db:"recordstatus" `
|
||||
Reviewed omitnull.Val[int16] `db:"reviewed" `
|
||||
Reviewedby omitnull.Val[string] `db:"reviewedby" `
|
||||
Revieweddate omitnull.Val[int64] `db:"revieweddate" `
|
||||
Sitetype omitnull.Val[string] `db:"sitetype" `
|
||||
Soilconditions omitnull.Val[string] `db:"soilconditions" `
|
||||
Sourcereduction omitnull.Val[string] `db:"sourcereduction" `
|
||||
Startdatetime omitnull.Val[int64] `db:"startdatetime" `
|
||||
Totalacres omitnull.Val[float64] `db:"totalacres" `
|
||||
Vegetation omitnull.Val[string] `db:"vegetation" `
|
||||
Waterconditions omitnull.Val[string] `db:"waterconditions" `
|
||||
Waterduration omitnull.Val[string] `db:"waterduration" `
|
||||
Watermovement1 omitnull.Val[string] `db:"watermovement1" `
|
||||
Watermovement1percent omitnull.Val[int16] `db:"watermovement1percent" `
|
||||
Watermovement2 omitnull.Val[string] `db:"watermovement2" `
|
||||
Watermovement2percent omitnull.Val[int16] `db:"watermovement2percent" `
|
||||
Waterpresent omitnull.Val[int16] `db:"waterpresent" `
|
||||
Watersource omitnull.Val[string] `db:"watersource" `
|
||||
Winddir omitnull.Val[string] `db:"winddir" `
|
||||
Windspeed omitnull.Val[float64] `db:"windspeed" `
|
||||
Zone omitnull.Val[string] `db:"zone" `
|
||||
Zone2 omitnull.Val[string] `db:"zone2" `
|
||||
CreatedDate omitnull.Val[int64] `db:"created_date" `
|
||||
CreatedUser omitnull.Val[string] `db:"created_user" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Acresbreeding omitnull.Val[float64] `db:"acresbreeding" `
|
||||
Actiontaken omitnull.Val[string] `db:"actiontaken" `
|
||||
Adultactivity omitnull.Val[int16] `db:"adultactivity" `
|
||||
Aquaticorganisms omitnull.Val[string] `db:"aquaticorganisms" `
|
||||
Avetemp omitnull.Val[float64] `db:"avetemp" `
|
||||
Breedingpotential omitnull.Val[string] `db:"breedingpotential" `
|
||||
Comments omitnull.Val[string] `db:"comments" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Enddatetime omitnull.Val[int64] `db:"enddatetime" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
Editor omitnull.Val[string] `db:"editor" `
|
||||
Fieldtech omitnull.Val[string] `db:"fieldtech" `
|
||||
Fish omitnull.Val[int16] `db:"fish" `
|
||||
Globalid omitnull.Val[string] `db:"globalid" `
|
||||
Habvalue1 omitnull.Val[int16] `db:"habvalue1" `
|
||||
Habvalue1percent omitnull.Val[int16] `db:"habvalue1percent" `
|
||||
Habvalue2 omitnull.Val[int16] `db:"habvalue2" `
|
||||
Habvalue2percent omitnull.Val[int16] `db:"habvalue2percent" `
|
||||
Larvaeinsidetreatedarea omitnull.Val[int16] `db:"larvaeinsidetreatedarea" `
|
||||
Larvaeoutsidetreatedarea omitnull.Val[int16] `db:"larvaeoutsidetreatedarea" `
|
||||
Larvaepresent omitnull.Val[int16] `db:"larvaepresent" `
|
||||
Larvaereason omitnull.Val[string] `db:"larvaereason" `
|
||||
Linelocid omitnull.Val[string] `db:"linelocid" `
|
||||
Locationname omitnull.Val[string] `db:"locationname" `
|
||||
LR omitnull.Val[int16] `db:"lr" `
|
||||
Mosquitohabitat omitnull.Val[string] `db:"mosquitohabitat" `
|
||||
Movingwater omitnull.Val[int16] `db:"movingwater" `
|
||||
Negdips omitnull.Val[int16] `db:"negdips" `
|
||||
Nowaterever omitnull.Val[int16] `db:"nowaterever" `
|
||||
Objectid omit.Val[int32] `db:"objectid,pk" `
|
||||
Pointlocid omitnull.Val[string] `db:"pointlocid" `
|
||||
Polygonlocid omitnull.Val[string] `db:"polygonlocid" `
|
||||
Posdips omitnull.Val[int16] `db:"posdips" `
|
||||
Potential omitnull.Val[int16] `db:"potential" `
|
||||
Raingauge omitnull.Val[float64] `db:"raingauge" `
|
||||
Recordstatus omitnull.Val[int16] `db:"recordstatus" `
|
||||
Reviewed omitnull.Val[int16] `db:"reviewed" `
|
||||
Reviewedby omitnull.Val[string] `db:"reviewedby" `
|
||||
Revieweddate omitnull.Val[int64] `db:"revieweddate" `
|
||||
Sitetype omitnull.Val[string] `db:"sitetype" `
|
||||
Soilconditions omitnull.Val[string] `db:"soilconditions" `
|
||||
Sourcereduction omitnull.Val[string] `db:"sourcereduction" `
|
||||
Startdatetime omitnull.Val[int64] `db:"startdatetime" `
|
||||
Totalacres omitnull.Val[float64] `db:"totalacres" `
|
||||
Vegetation omitnull.Val[string] `db:"vegetation" `
|
||||
Waterconditions omitnull.Val[string] `db:"waterconditions" `
|
||||
Waterduration omitnull.Val[string] `db:"waterduration" `
|
||||
Watermovement1 omitnull.Val[string] `db:"watermovement1" `
|
||||
Watermovement1percent omitnull.Val[int16] `db:"watermovement1percent" `
|
||||
Watermovement2 omitnull.Val[string] `db:"watermovement2" `
|
||||
Watermovement2percent omitnull.Val[int16] `db:"watermovement2percent" `
|
||||
Waterpresent omitnull.Val[int16] `db:"waterpresent" `
|
||||
Watersource omitnull.Val[string] `db:"watersource" `
|
||||
Winddir omitnull.Val[string] `db:"winddir" `
|
||||
Windspeed omitnull.Val[float64] `db:"windspeed" `
|
||||
Zone omitnull.Val[string] `db:"zone" `
|
||||
Zone2 omitnull.Val[string] `db:"zone2" `
|
||||
Created omitnull.Val[time.Time] `db:"created" `
|
||||
CreatedDate omitnull.Val[int64] `db:"created_date" `
|
||||
CreatedUser omitnull.Val[string] `db:"created_user" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
}
|
||||
|
||||
func (s HistoryQamosquitoinspectionSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 66)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals := make([]string, 0, 67)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Acresbreeding.IsUnset() {
|
||||
|
|
@ -515,6 +520,9 @@ func (s HistoryQamosquitoinspectionSetter) SetColumns() []string {
|
|||
if !s.Zone2.IsUnset() {
|
||||
vals = append(vals, "zone2")
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
vals = append(vals, "created")
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals = append(vals, "created_date")
|
||||
}
|
||||
|
|
@ -540,8 +548,8 @@ func (s HistoryQamosquitoinspectionSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s HistoryQamosquitoinspectionSetter) Overwrite(t *HistoryQamosquitoinspection) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Acresbreeding.IsUnset() {
|
||||
t.Acresbreeding = s.Acresbreeding.MustGetNull()
|
||||
|
|
@ -717,6 +725,9 @@ func (s HistoryQamosquitoinspectionSetter) Overwrite(t *HistoryQamosquitoinspect
|
|||
if !s.Zone2.IsUnset() {
|
||||
t.Zone2 = s.Zone2.MustGetNull()
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
t.Created = s.Created.MustGetNull()
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
t.CreatedDate = s.CreatedDate.MustGetNull()
|
||||
}
|
||||
|
|
@ -746,9 +757,9 @@ func (s *HistoryQamosquitoinspectionSetter) Apply(q *dialect.InsertQuery) {
|
|||
})
|
||||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 66)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
vals := make([]bob.Expression, 67)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -1101,48 +1112,54 @@ func (s *HistoryQamosquitoinspectionSetter) Apply(q *dialect.InsertQuery) {
|
|||
vals[58] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[59] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
if !s.Created.IsUnset() {
|
||||
vals[59] = psql.Arg(s.Created.MustGetNull())
|
||||
} else {
|
||||
vals[59] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[60] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[60] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
} else {
|
||||
vals[60] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[61] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[61] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
} else {
|
||||
vals[61] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[62] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[62] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
} else {
|
||||
vals[62] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[63] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[63] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
} else {
|
||||
vals[63] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[64] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[64] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
} else {
|
||||
vals[64] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[65] = psql.Arg(s.Version.MustGet())
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[65] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
} else {
|
||||
vals[65] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[66] = psql.Arg(s.Version.MustGet())
|
||||
} else {
|
||||
vals[66] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
return bob.ExpressSlice(ctx, w, d, start, vals, "", ", ", "")
|
||||
}))
|
||||
}
|
||||
|
|
@ -1152,9 +1169,9 @@ func (s HistoryQamosquitoinspectionSetter) UpdateMod() bob.Mod[*dialect.UpdateQu
|
|||
}
|
||||
|
||||
func (s HistoryQamosquitoinspectionSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 66)
|
||||
exprs := make([]bob.Expression, 0, 67)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -1567,6 +1584,13 @@ func (s HistoryQamosquitoinspectionSetter) Expressions(prefix ...string) []bob.E
|
|||
}})
|
||||
}
|
||||
|
||||
if !s.Created.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created")...),
|
||||
psql.Arg(s.Created),
|
||||
}})
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created_date")...),
|
||||
|
|
@ -1860,7 +1884,7 @@ func (o *HistoryQamosquitoinspection) Organization(mods ...bob.Mod[*dialect.Sele
|
|||
}
|
||||
|
||||
func (os HistoryQamosquitoinspectionSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -1878,7 +1902,7 @@ func (os HistoryQamosquitoinspectionSlice) Organization(mods ...bob.Mod[*dialect
|
|||
|
||||
func attachHistoryQamosquitoinspectionOrganization0(ctx context.Context, exec bob.Executor, count int, historyQamosquitoinspection0 *HistoryQamosquitoinspection, organization1 *Organization) (*HistoryQamosquitoinspection, error) {
|
||||
setter := &HistoryQamosquitoinspectionSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := historyQamosquitoinspection0.Update(ctx, exec, setter)
|
||||
|
|
@ -1925,7 +1949,7 @@ func (historyQamosquitoinspection0 *HistoryQamosquitoinspection) AttachOrganizat
|
|||
}
|
||||
|
||||
type historyQamosquitoinspectionWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Acresbreeding psql.WhereNullMod[Q, float64]
|
||||
Actiontaken psql.WhereNullMod[Q, string]
|
||||
Adultactivity psql.WhereNullMod[Q, int16]
|
||||
|
|
@ -1984,6 +2008,7 @@ type historyQamosquitoinspectionWhere[Q psql.Filterable] struct {
|
|||
Windspeed psql.WhereNullMod[Q, float64]
|
||||
Zone psql.WhereNullMod[Q, string]
|
||||
Zone2 psql.WhereNullMod[Q, string]
|
||||
Created psql.WhereNullMod[Q, time.Time]
|
||||
CreatedDate psql.WhereNullMod[Q, int64]
|
||||
CreatedUser psql.WhereNullMod[Q, string]
|
||||
GeometryX psql.WhereNullMod[Q, float64]
|
||||
|
|
@ -1999,7 +2024,7 @@ func (historyQamosquitoinspectionWhere[Q]) AliasedAs(alias string) historyQamosq
|
|||
|
||||
func buildHistoryQamosquitoinspectionWhere[Q psql.Filterable](cols historyQamosquitoinspectionColumns) historyQamosquitoinspectionWhere[Q] {
|
||||
return historyQamosquitoinspectionWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Acresbreeding: psql.WhereNull[Q, float64](cols.Acresbreeding),
|
||||
Actiontaken: psql.WhereNull[Q, string](cols.Actiontaken),
|
||||
Adultactivity: psql.WhereNull[Q, int16](cols.Adultactivity),
|
||||
|
|
@ -2058,6 +2083,7 @@ func buildHistoryQamosquitoinspectionWhere[Q psql.Filterable](cols historyQamosq
|
|||
Windspeed: psql.WhereNull[Q, float64](cols.Windspeed),
|
||||
Zone: psql.WhereNull[Q, string](cols.Zone),
|
||||
Zone2: psql.WhereNull[Q, string](cols.Zone2),
|
||||
Created: psql.WhereNull[Q, time.Time](cols.Created),
|
||||
CreatedDate: psql.WhereNull[Q, int64](cols.CreatedDate),
|
||||
CreatedUser: psql.WhereNull[Q, string](cols.CreatedUser),
|
||||
GeometryX: psql.WhereNull[Q, float64](cols.GeometryX),
|
||||
|
|
@ -2169,11 +2195,8 @@ func (os HistoryQamosquitoinspectionSlice) LoadOrganization(ctx context.Context,
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"time"
|
||||
|
||||
"github.com/aarondl/opt/null"
|
||||
"github.com/aarondl/opt/omit"
|
||||
|
|
@ -25,40 +26,41 @@ import (
|
|||
|
||||
// HistoryRodentlocation is an object representing the database table.
|
||||
type HistoryRodentlocation struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
Accessdesc null.Val[string] `db:"accessdesc" `
|
||||
Active null.Val[int16] `db:"active" `
|
||||
Comments null.Val[string] `db:"comments" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Description null.Val[string] `db:"description" `
|
||||
Externalid null.Val[string] `db:"externalid" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
Editor null.Val[string] `db:"editor" `
|
||||
Globalid null.Val[string] `db:"globalid" `
|
||||
Habitat null.Val[string] `db:"habitat" `
|
||||
Lastinspectaction null.Val[string] `db:"lastinspectaction" `
|
||||
Lastinspectconditions null.Val[string] `db:"lastinspectconditions" `
|
||||
Lastinspectdate null.Val[int64] `db:"lastinspectdate" `
|
||||
Lastinspectrodentevidence null.Val[string] `db:"lastinspectrodentevidence" `
|
||||
Lastinspectspecies null.Val[string] `db:"lastinspectspecies" `
|
||||
Locationname null.Val[string] `db:"locationname" `
|
||||
Locationnumber null.Val[int64] `db:"locationnumber" `
|
||||
Nextactiondatescheduled null.Val[int64] `db:"nextactiondatescheduled" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
Priority null.Val[string] `db:"priority" `
|
||||
Symbology null.Val[string] `db:"symbology" `
|
||||
Usetype null.Val[string] `db:"usetype" `
|
||||
Zone null.Val[string] `db:"zone" `
|
||||
Zone2 null.Val[string] `db:"zone2" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Jurisdiction null.Val[string] `db:"jurisdiction" `
|
||||
Version int32 `db:"version,pk" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Accessdesc null.Val[string] `db:"accessdesc" `
|
||||
Active null.Val[int16] `db:"active" `
|
||||
Comments null.Val[string] `db:"comments" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Description null.Val[string] `db:"description" `
|
||||
Externalid null.Val[string] `db:"externalid" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
Editor null.Val[string] `db:"editor" `
|
||||
Globalid null.Val[string] `db:"globalid" `
|
||||
Habitat null.Val[string] `db:"habitat" `
|
||||
Lastinspectaction null.Val[string] `db:"lastinspectaction" `
|
||||
Lastinspectconditions null.Val[string] `db:"lastinspectconditions" `
|
||||
Lastinspectdate null.Val[int64] `db:"lastinspectdate" `
|
||||
Lastinspectrodentevidence null.Val[string] `db:"lastinspectrodentevidence" `
|
||||
Lastinspectspecies null.Val[string] `db:"lastinspectspecies" `
|
||||
Locationname null.Val[string] `db:"locationname" `
|
||||
Locationnumber null.Val[int64] `db:"locationnumber" `
|
||||
Nextactiondatescheduled null.Val[int64] `db:"nextactiondatescheduled" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
Priority null.Val[string] `db:"priority" `
|
||||
Symbology null.Val[string] `db:"symbology" `
|
||||
Usetype null.Val[string] `db:"usetype" `
|
||||
Zone null.Val[string] `db:"zone" `
|
||||
Zone2 null.Val[string] `db:"zone2" `
|
||||
Created null.Val[time.Time] `db:"created" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Jurisdiction null.Val[string] `db:"jurisdiction" `
|
||||
Version int32 `db:"version,pk" `
|
||||
|
||||
R historyRodentlocationR `db:"-" `
|
||||
}
|
||||
|
|
@ -81,7 +83,7 @@ type historyRodentlocationR struct {
|
|||
func buildHistoryRodentlocationColumns(alias string) historyRodentlocationColumns {
|
||||
return historyRodentlocationColumns{
|
||||
ColumnsExpr: expr.NewColumnsExpr(
|
||||
"organization_id", "accessdesc", "active", "comments", "creationdate", "creator", "description", "externalid", "editdate", "editor", "globalid", "habitat", "lastinspectaction", "lastinspectconditions", "lastinspectdate", "lastinspectrodentevidence", "lastinspectspecies", "locationname", "locationnumber", "nextactiondatescheduled", "objectid", "priority", "symbology", "usetype", "zone", "zone2", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "jurisdiction", "version",
|
||||
"organization_id", "accessdesc", "active", "comments", "creationdate", "creator", "description", "externalid", "editdate", "editor", "globalid", "habitat", "lastinspectaction", "lastinspectconditions", "lastinspectdate", "lastinspectrodentevidence", "lastinspectspecies", "locationname", "locationnumber", "nextactiondatescheduled", "objectid", "priority", "symbology", "usetype", "zone", "zone2", "created", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "jurisdiction", "version",
|
||||
).WithParent("history_rodentlocation"),
|
||||
tableAlias: alias,
|
||||
OrganizationID: psql.Quote(alias, "organization_id"),
|
||||
|
|
@ -110,6 +112,7 @@ func buildHistoryRodentlocationColumns(alias string) historyRodentlocationColumn
|
|||
Usetype: psql.Quote(alias, "usetype"),
|
||||
Zone: psql.Quote(alias, "zone"),
|
||||
Zone2: psql.Quote(alias, "zone2"),
|
||||
Created: psql.Quote(alias, "created"),
|
||||
CreatedDate: psql.Quote(alias, "created_date"),
|
||||
CreatedUser: psql.Quote(alias, "created_user"),
|
||||
GeometryX: psql.Quote(alias, "geometry_x"),
|
||||
|
|
@ -150,6 +153,7 @@ type historyRodentlocationColumns struct {
|
|||
Usetype psql.Expression
|
||||
Zone psql.Expression
|
||||
Zone2 psql.Expression
|
||||
Created psql.Expression
|
||||
CreatedDate psql.Expression
|
||||
CreatedUser psql.Expression
|
||||
GeometryX psql.Expression
|
||||
|
|
@ -172,45 +176,46 @@ func (historyRodentlocationColumns) AliasedAs(alias string) historyRodentlocatio
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type HistoryRodentlocationSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
Accessdesc omitnull.Val[string] `db:"accessdesc" `
|
||||
Active omitnull.Val[int16] `db:"active" `
|
||||
Comments omitnull.Val[string] `db:"comments" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Description omitnull.Val[string] `db:"description" `
|
||||
Externalid omitnull.Val[string] `db:"externalid" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
Editor omitnull.Val[string] `db:"editor" `
|
||||
Globalid omitnull.Val[string] `db:"globalid" `
|
||||
Habitat omitnull.Val[string] `db:"habitat" `
|
||||
Lastinspectaction omitnull.Val[string] `db:"lastinspectaction" `
|
||||
Lastinspectconditions omitnull.Val[string] `db:"lastinspectconditions" `
|
||||
Lastinspectdate omitnull.Val[int64] `db:"lastinspectdate" `
|
||||
Lastinspectrodentevidence omitnull.Val[string] `db:"lastinspectrodentevidence" `
|
||||
Lastinspectspecies omitnull.Val[string] `db:"lastinspectspecies" `
|
||||
Locationname omitnull.Val[string] `db:"locationname" `
|
||||
Locationnumber omitnull.Val[int64] `db:"locationnumber" `
|
||||
Nextactiondatescheduled omitnull.Val[int64] `db:"nextactiondatescheduled" `
|
||||
Objectid omit.Val[int32] `db:"objectid,pk" `
|
||||
Priority omitnull.Val[string] `db:"priority" `
|
||||
Symbology omitnull.Val[string] `db:"symbology" `
|
||||
Usetype omitnull.Val[string] `db:"usetype" `
|
||||
Zone omitnull.Val[string] `db:"zone" `
|
||||
Zone2 omitnull.Val[string] `db:"zone2" `
|
||||
CreatedDate omitnull.Val[int64] `db:"created_date" `
|
||||
CreatedUser omitnull.Val[string] `db:"created_user" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Jurisdiction omitnull.Val[string] `db:"jurisdiction" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Accessdesc omitnull.Val[string] `db:"accessdesc" `
|
||||
Active omitnull.Val[int16] `db:"active" `
|
||||
Comments omitnull.Val[string] `db:"comments" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Description omitnull.Val[string] `db:"description" `
|
||||
Externalid omitnull.Val[string] `db:"externalid" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
Editor omitnull.Val[string] `db:"editor" `
|
||||
Globalid omitnull.Val[string] `db:"globalid" `
|
||||
Habitat omitnull.Val[string] `db:"habitat" `
|
||||
Lastinspectaction omitnull.Val[string] `db:"lastinspectaction" `
|
||||
Lastinspectconditions omitnull.Val[string] `db:"lastinspectconditions" `
|
||||
Lastinspectdate omitnull.Val[int64] `db:"lastinspectdate" `
|
||||
Lastinspectrodentevidence omitnull.Val[string] `db:"lastinspectrodentevidence" `
|
||||
Lastinspectspecies omitnull.Val[string] `db:"lastinspectspecies" `
|
||||
Locationname omitnull.Val[string] `db:"locationname" `
|
||||
Locationnumber omitnull.Val[int64] `db:"locationnumber" `
|
||||
Nextactiondatescheduled omitnull.Val[int64] `db:"nextactiondatescheduled" `
|
||||
Objectid omit.Val[int32] `db:"objectid,pk" `
|
||||
Priority omitnull.Val[string] `db:"priority" `
|
||||
Symbology omitnull.Val[string] `db:"symbology" `
|
||||
Usetype omitnull.Val[string] `db:"usetype" `
|
||||
Zone omitnull.Val[string] `db:"zone" `
|
||||
Zone2 omitnull.Val[string] `db:"zone2" `
|
||||
Created omitnull.Val[time.Time] `db:"created" `
|
||||
CreatedDate omitnull.Val[int64] `db:"created_date" `
|
||||
CreatedUser omitnull.Val[string] `db:"created_user" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Jurisdiction omitnull.Val[string] `db:"jurisdiction" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
}
|
||||
|
||||
func (s HistoryRodentlocationSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 34)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals := make([]string, 0, 35)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Accessdesc.IsUnset() {
|
||||
|
|
@ -288,6 +293,9 @@ func (s HistoryRodentlocationSetter) SetColumns() []string {
|
|||
if !s.Zone2.IsUnset() {
|
||||
vals = append(vals, "zone2")
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
vals = append(vals, "created")
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals = append(vals, "created_date")
|
||||
}
|
||||
|
|
@ -316,8 +324,8 @@ func (s HistoryRodentlocationSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s HistoryRodentlocationSetter) Overwrite(t *HistoryRodentlocation) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Accessdesc.IsUnset() {
|
||||
t.Accessdesc = s.Accessdesc.MustGetNull()
|
||||
|
|
@ -394,6 +402,9 @@ func (s HistoryRodentlocationSetter) Overwrite(t *HistoryRodentlocation) {
|
|||
if !s.Zone2.IsUnset() {
|
||||
t.Zone2 = s.Zone2.MustGetNull()
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
t.Created = s.Created.MustGetNull()
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
t.CreatedDate = s.CreatedDate.MustGetNull()
|
||||
}
|
||||
|
|
@ -426,9 +437,9 @@ func (s *HistoryRodentlocationSetter) Apply(q *dialect.InsertQuery) {
|
|||
})
|
||||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 34)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
vals := make([]bob.Expression, 35)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -583,54 +594,60 @@ func (s *HistoryRodentlocationSetter) Apply(q *dialect.InsertQuery) {
|
|||
vals[25] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[26] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
if !s.Created.IsUnset() {
|
||||
vals[26] = psql.Arg(s.Created.MustGetNull())
|
||||
} else {
|
||||
vals[26] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[27] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[27] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
} else {
|
||||
vals[27] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[28] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[28] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
} else {
|
||||
vals[28] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[29] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[29] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
} else {
|
||||
vals[29] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[30] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[30] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
} else {
|
||||
vals[30] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[31] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[31] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
} else {
|
||||
vals[31] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.Jurisdiction.IsUnset() {
|
||||
vals[32] = psql.Arg(s.Jurisdiction.MustGetNull())
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[32] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
} else {
|
||||
vals[32] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[33] = psql.Arg(s.Version.MustGet())
|
||||
if !s.Jurisdiction.IsUnset() {
|
||||
vals[33] = psql.Arg(s.Jurisdiction.MustGetNull())
|
||||
} else {
|
||||
vals[33] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[34] = psql.Arg(s.Version.MustGet())
|
||||
} else {
|
||||
vals[34] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
return bob.ExpressSlice(ctx, w, d, start, vals, "", ", ", "")
|
||||
}))
|
||||
}
|
||||
|
|
@ -640,9 +657,9 @@ func (s HistoryRodentlocationSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery] {
|
|||
}
|
||||
|
||||
func (s HistoryRodentlocationSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 34)
|
||||
exprs := make([]bob.Expression, 0, 35)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -824,6 +841,13 @@ func (s HistoryRodentlocationSetter) Expressions(prefix ...string) []bob.Express
|
|||
}})
|
||||
}
|
||||
|
||||
if !s.Created.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created")...),
|
||||
psql.Arg(s.Created),
|
||||
}})
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created_date")...),
|
||||
|
|
@ -1124,7 +1148,7 @@ func (o *HistoryRodentlocation) Organization(mods ...bob.Mod[*dialect.SelectQuer
|
|||
}
|
||||
|
||||
func (os HistoryRodentlocationSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -1142,7 +1166,7 @@ func (os HistoryRodentlocationSlice) Organization(mods ...bob.Mod[*dialect.Selec
|
|||
|
||||
func attachHistoryRodentlocationOrganization0(ctx context.Context, exec bob.Executor, count int, historyRodentlocation0 *HistoryRodentlocation, organization1 *Organization) (*HistoryRodentlocation, error) {
|
||||
setter := &HistoryRodentlocationSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := historyRodentlocation0.Update(ctx, exec, setter)
|
||||
|
|
@ -1189,7 +1213,7 @@ func (historyRodentlocation0 *HistoryRodentlocation) AttachOrganization(ctx cont
|
|||
}
|
||||
|
||||
type historyRodentlocationWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Accessdesc psql.WhereNullMod[Q, string]
|
||||
Active psql.WhereNullMod[Q, int16]
|
||||
Comments psql.WhereNullMod[Q, string]
|
||||
|
|
@ -1215,6 +1239,7 @@ type historyRodentlocationWhere[Q psql.Filterable] struct {
|
|||
Usetype psql.WhereNullMod[Q, string]
|
||||
Zone psql.WhereNullMod[Q, string]
|
||||
Zone2 psql.WhereNullMod[Q, string]
|
||||
Created psql.WhereNullMod[Q, time.Time]
|
||||
CreatedDate psql.WhereNullMod[Q, int64]
|
||||
CreatedUser psql.WhereNullMod[Q, string]
|
||||
GeometryX psql.WhereNullMod[Q, float64]
|
||||
|
|
@ -1231,7 +1256,7 @@ func (historyRodentlocationWhere[Q]) AliasedAs(alias string) historyRodentlocati
|
|||
|
||||
func buildHistoryRodentlocationWhere[Q psql.Filterable](cols historyRodentlocationColumns) historyRodentlocationWhere[Q] {
|
||||
return historyRodentlocationWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Accessdesc: psql.WhereNull[Q, string](cols.Accessdesc),
|
||||
Active: psql.WhereNull[Q, int16](cols.Active),
|
||||
Comments: psql.WhereNull[Q, string](cols.Comments),
|
||||
|
|
@ -1257,6 +1282,7 @@ func buildHistoryRodentlocationWhere[Q psql.Filterable](cols historyRodentlocati
|
|||
Usetype: psql.WhereNull[Q, string](cols.Usetype),
|
||||
Zone: psql.WhereNull[Q, string](cols.Zone),
|
||||
Zone2: psql.WhereNull[Q, string](cols.Zone2),
|
||||
Created: psql.WhereNull[Q, time.Time](cols.Created),
|
||||
CreatedDate: psql.WhereNull[Q, int64](cols.CreatedDate),
|
||||
CreatedUser: psql.WhereNull[Q, string](cols.CreatedUser),
|
||||
GeometryX: psql.WhereNull[Q, float64](cols.GeometryX),
|
||||
|
|
@ -1369,11 +1395,8 @@ func (os HistoryRodentlocationSlice) LoadOrganization(ctx context.Context, exec
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"time"
|
||||
|
||||
"github.com/aarondl/opt/null"
|
||||
"github.com/aarondl/opt/omit"
|
||||
|
|
@ -25,56 +26,57 @@ import (
|
|||
|
||||
// HistorySamplecollection is an object representing the database table.
|
||||
type HistorySamplecollection struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
Activity null.Val[string] `db:"activity" `
|
||||
Avetemp null.Val[float64] `db:"avetemp" `
|
||||
Chickenid null.Val[string] `db:"chickenid" `
|
||||
Comments null.Val[string] `db:"comments" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Datesent null.Val[int64] `db:"datesent" `
|
||||
Datetested null.Val[int64] `db:"datetested" `
|
||||
Diseasepos null.Val[string] `db:"diseasepos" `
|
||||
Diseasetested null.Val[string] `db:"diseasetested" `
|
||||
Enddatetime null.Val[int64] `db:"enddatetime" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
Editor null.Val[string] `db:"editor" `
|
||||
Fieldtech null.Val[string] `db:"fieldtech" `
|
||||
Flockid null.Val[string] `db:"flockid" `
|
||||
Gatewaysync null.Val[int16] `db:"gatewaysync" `
|
||||
Globalid null.Val[string] `db:"globalid" `
|
||||
Lab null.Val[string] `db:"lab" `
|
||||
Locationname null.Val[string] `db:"locationname" `
|
||||
LocID null.Val[string] `db:"loc_id" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
Processed null.Val[int16] `db:"processed" `
|
||||
Raingauge null.Val[float64] `db:"raingauge" `
|
||||
Recordstatus null.Val[int16] `db:"recordstatus" `
|
||||
Reviewed null.Val[int16] `db:"reviewed" `
|
||||
Reviewedby null.Val[string] `db:"reviewedby" `
|
||||
Revieweddate null.Val[int64] `db:"revieweddate" `
|
||||
Samplecond null.Val[string] `db:"samplecond" `
|
||||
Samplecount null.Val[int16] `db:"samplecount" `
|
||||
Sampleid null.Val[string] `db:"sampleid" `
|
||||
Sampletype null.Val[string] `db:"sampletype" `
|
||||
Sex null.Val[string] `db:"sex" `
|
||||
Sitecond null.Val[string] `db:"sitecond" `
|
||||
Species null.Val[string] `db:"species" `
|
||||
Startdatetime null.Val[int64] `db:"startdatetime" `
|
||||
Survtech null.Val[string] `db:"survtech" `
|
||||
Testmethod null.Val[string] `db:"testmethod" `
|
||||
Testtech null.Val[string] `db:"testtech" `
|
||||
Winddir null.Val[string] `db:"winddir" `
|
||||
Windspeed null.Val[float64] `db:"windspeed" `
|
||||
Zone null.Val[string] `db:"zone" `
|
||||
Zone2 null.Val[string] `db:"zone2" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Version int32 `db:"version,pk" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Activity null.Val[string] `db:"activity" `
|
||||
Avetemp null.Val[float64] `db:"avetemp" `
|
||||
Chickenid null.Val[string] `db:"chickenid" `
|
||||
Comments null.Val[string] `db:"comments" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Datesent null.Val[int64] `db:"datesent" `
|
||||
Datetested null.Val[int64] `db:"datetested" `
|
||||
Diseasepos null.Val[string] `db:"diseasepos" `
|
||||
Diseasetested null.Val[string] `db:"diseasetested" `
|
||||
Enddatetime null.Val[int64] `db:"enddatetime" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
Editor null.Val[string] `db:"editor" `
|
||||
Fieldtech null.Val[string] `db:"fieldtech" `
|
||||
Flockid null.Val[string] `db:"flockid" `
|
||||
Gatewaysync null.Val[int16] `db:"gatewaysync" `
|
||||
Globalid null.Val[string] `db:"globalid" `
|
||||
Lab null.Val[string] `db:"lab" `
|
||||
Locationname null.Val[string] `db:"locationname" `
|
||||
LocID null.Val[string] `db:"loc_id" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
Processed null.Val[int16] `db:"processed" `
|
||||
Raingauge null.Val[float64] `db:"raingauge" `
|
||||
Recordstatus null.Val[int16] `db:"recordstatus" `
|
||||
Reviewed null.Val[int16] `db:"reviewed" `
|
||||
Reviewedby null.Val[string] `db:"reviewedby" `
|
||||
Revieweddate null.Val[int64] `db:"revieweddate" `
|
||||
Samplecond null.Val[string] `db:"samplecond" `
|
||||
Samplecount null.Val[int16] `db:"samplecount" `
|
||||
Sampleid null.Val[string] `db:"sampleid" `
|
||||
Sampletype null.Val[string] `db:"sampletype" `
|
||||
Sex null.Val[string] `db:"sex" `
|
||||
Sitecond null.Val[string] `db:"sitecond" `
|
||||
Species null.Val[string] `db:"species" `
|
||||
Startdatetime null.Val[int64] `db:"startdatetime" `
|
||||
Survtech null.Val[string] `db:"survtech" `
|
||||
Testmethod null.Val[string] `db:"testmethod" `
|
||||
Testtech null.Val[string] `db:"testtech" `
|
||||
Winddir null.Val[string] `db:"winddir" `
|
||||
Windspeed null.Val[float64] `db:"windspeed" `
|
||||
Zone null.Val[string] `db:"zone" `
|
||||
Zone2 null.Val[string] `db:"zone2" `
|
||||
Created null.Val[time.Time] `db:"created" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Version int32 `db:"version,pk" `
|
||||
|
||||
R historySamplecollectionR `db:"-" `
|
||||
}
|
||||
|
|
@ -97,7 +99,7 @@ type historySamplecollectionR struct {
|
|||
func buildHistorySamplecollectionColumns(alias string) historySamplecollectionColumns {
|
||||
return historySamplecollectionColumns{
|
||||
ColumnsExpr: expr.NewColumnsExpr(
|
||||
"organization_id", "activity", "avetemp", "chickenid", "comments", "creationdate", "creator", "datesent", "datetested", "diseasepos", "diseasetested", "enddatetime", "editdate", "editor", "fieldtech", "flockid", "gatewaysync", "globalid", "lab", "locationname", "loc_id", "objectid", "processed", "raingauge", "recordstatus", "reviewed", "reviewedby", "revieweddate", "samplecond", "samplecount", "sampleid", "sampletype", "sex", "sitecond", "species", "startdatetime", "survtech", "testmethod", "testtech", "winddir", "windspeed", "zone", "zone2", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "version",
|
||||
"organization_id", "activity", "avetemp", "chickenid", "comments", "creationdate", "creator", "datesent", "datetested", "diseasepos", "diseasetested", "enddatetime", "editdate", "editor", "fieldtech", "flockid", "gatewaysync", "globalid", "lab", "locationname", "loc_id", "objectid", "processed", "raingauge", "recordstatus", "reviewed", "reviewedby", "revieweddate", "samplecond", "samplecount", "sampleid", "sampletype", "sex", "sitecond", "species", "startdatetime", "survtech", "testmethod", "testtech", "winddir", "windspeed", "zone", "zone2", "created", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "version",
|
||||
).WithParent("history_samplecollection"),
|
||||
tableAlias: alias,
|
||||
OrganizationID: psql.Quote(alias, "organization_id"),
|
||||
|
|
@ -143,6 +145,7 @@ func buildHistorySamplecollectionColumns(alias string) historySamplecollectionCo
|
|||
Windspeed: psql.Quote(alias, "windspeed"),
|
||||
Zone: psql.Quote(alias, "zone"),
|
||||
Zone2: psql.Quote(alias, "zone2"),
|
||||
Created: psql.Quote(alias, "created"),
|
||||
CreatedDate: psql.Quote(alias, "created_date"),
|
||||
CreatedUser: psql.Quote(alias, "created_user"),
|
||||
GeometryX: psql.Quote(alias, "geometry_x"),
|
||||
|
|
@ -199,6 +202,7 @@ type historySamplecollectionColumns struct {
|
|||
Windspeed psql.Expression
|
||||
Zone psql.Expression
|
||||
Zone2 psql.Expression
|
||||
Created psql.Expression
|
||||
CreatedDate psql.Expression
|
||||
CreatedUser psql.Expression
|
||||
GeometryX psql.Expression
|
||||
|
|
@ -220,61 +224,62 @@ func (historySamplecollectionColumns) AliasedAs(alias string) historySamplecolle
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type HistorySamplecollectionSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
Activity omitnull.Val[string] `db:"activity" `
|
||||
Avetemp omitnull.Val[float64] `db:"avetemp" `
|
||||
Chickenid omitnull.Val[string] `db:"chickenid" `
|
||||
Comments omitnull.Val[string] `db:"comments" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Datesent omitnull.Val[int64] `db:"datesent" `
|
||||
Datetested omitnull.Val[int64] `db:"datetested" `
|
||||
Diseasepos omitnull.Val[string] `db:"diseasepos" `
|
||||
Diseasetested omitnull.Val[string] `db:"diseasetested" `
|
||||
Enddatetime omitnull.Val[int64] `db:"enddatetime" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
Editor omitnull.Val[string] `db:"editor" `
|
||||
Fieldtech omitnull.Val[string] `db:"fieldtech" `
|
||||
Flockid omitnull.Val[string] `db:"flockid" `
|
||||
Gatewaysync omitnull.Val[int16] `db:"gatewaysync" `
|
||||
Globalid omitnull.Val[string] `db:"globalid" `
|
||||
Lab omitnull.Val[string] `db:"lab" `
|
||||
Locationname omitnull.Val[string] `db:"locationname" `
|
||||
LocID omitnull.Val[string] `db:"loc_id" `
|
||||
Objectid omit.Val[int32] `db:"objectid,pk" `
|
||||
Processed omitnull.Val[int16] `db:"processed" `
|
||||
Raingauge omitnull.Val[float64] `db:"raingauge" `
|
||||
Recordstatus omitnull.Val[int16] `db:"recordstatus" `
|
||||
Reviewed omitnull.Val[int16] `db:"reviewed" `
|
||||
Reviewedby omitnull.Val[string] `db:"reviewedby" `
|
||||
Revieweddate omitnull.Val[int64] `db:"revieweddate" `
|
||||
Samplecond omitnull.Val[string] `db:"samplecond" `
|
||||
Samplecount omitnull.Val[int16] `db:"samplecount" `
|
||||
Sampleid omitnull.Val[string] `db:"sampleid" `
|
||||
Sampletype omitnull.Val[string] `db:"sampletype" `
|
||||
Sex omitnull.Val[string] `db:"sex" `
|
||||
Sitecond omitnull.Val[string] `db:"sitecond" `
|
||||
Species omitnull.Val[string] `db:"species" `
|
||||
Startdatetime omitnull.Val[int64] `db:"startdatetime" `
|
||||
Survtech omitnull.Val[string] `db:"survtech" `
|
||||
Testmethod omitnull.Val[string] `db:"testmethod" `
|
||||
Testtech omitnull.Val[string] `db:"testtech" `
|
||||
Winddir omitnull.Val[string] `db:"winddir" `
|
||||
Windspeed omitnull.Val[float64] `db:"windspeed" `
|
||||
Zone omitnull.Val[string] `db:"zone" `
|
||||
Zone2 omitnull.Val[string] `db:"zone2" `
|
||||
CreatedDate omitnull.Val[int64] `db:"created_date" `
|
||||
CreatedUser omitnull.Val[string] `db:"created_user" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Activity omitnull.Val[string] `db:"activity" `
|
||||
Avetemp omitnull.Val[float64] `db:"avetemp" `
|
||||
Chickenid omitnull.Val[string] `db:"chickenid" `
|
||||
Comments omitnull.Val[string] `db:"comments" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Datesent omitnull.Val[int64] `db:"datesent" `
|
||||
Datetested omitnull.Val[int64] `db:"datetested" `
|
||||
Diseasepos omitnull.Val[string] `db:"diseasepos" `
|
||||
Diseasetested omitnull.Val[string] `db:"diseasetested" `
|
||||
Enddatetime omitnull.Val[int64] `db:"enddatetime" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
Editor omitnull.Val[string] `db:"editor" `
|
||||
Fieldtech omitnull.Val[string] `db:"fieldtech" `
|
||||
Flockid omitnull.Val[string] `db:"flockid" `
|
||||
Gatewaysync omitnull.Val[int16] `db:"gatewaysync" `
|
||||
Globalid omitnull.Val[string] `db:"globalid" `
|
||||
Lab omitnull.Val[string] `db:"lab" `
|
||||
Locationname omitnull.Val[string] `db:"locationname" `
|
||||
LocID omitnull.Val[string] `db:"loc_id" `
|
||||
Objectid omit.Val[int32] `db:"objectid,pk" `
|
||||
Processed omitnull.Val[int16] `db:"processed" `
|
||||
Raingauge omitnull.Val[float64] `db:"raingauge" `
|
||||
Recordstatus omitnull.Val[int16] `db:"recordstatus" `
|
||||
Reviewed omitnull.Val[int16] `db:"reviewed" `
|
||||
Reviewedby omitnull.Val[string] `db:"reviewedby" `
|
||||
Revieweddate omitnull.Val[int64] `db:"revieweddate" `
|
||||
Samplecond omitnull.Val[string] `db:"samplecond" `
|
||||
Samplecount omitnull.Val[int16] `db:"samplecount" `
|
||||
Sampleid omitnull.Val[string] `db:"sampleid" `
|
||||
Sampletype omitnull.Val[string] `db:"sampletype" `
|
||||
Sex omitnull.Val[string] `db:"sex" `
|
||||
Sitecond omitnull.Val[string] `db:"sitecond" `
|
||||
Species omitnull.Val[string] `db:"species" `
|
||||
Startdatetime omitnull.Val[int64] `db:"startdatetime" `
|
||||
Survtech omitnull.Val[string] `db:"survtech" `
|
||||
Testmethod omitnull.Val[string] `db:"testmethod" `
|
||||
Testtech omitnull.Val[string] `db:"testtech" `
|
||||
Winddir omitnull.Val[string] `db:"winddir" `
|
||||
Windspeed omitnull.Val[float64] `db:"windspeed" `
|
||||
Zone omitnull.Val[string] `db:"zone" `
|
||||
Zone2 omitnull.Val[string] `db:"zone2" `
|
||||
Created omitnull.Val[time.Time] `db:"created" `
|
||||
CreatedDate omitnull.Val[int64] `db:"created_date" `
|
||||
CreatedUser omitnull.Val[string] `db:"created_user" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
}
|
||||
|
||||
func (s HistorySamplecollectionSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 50)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals := make([]string, 0, 51)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Activity.IsUnset() {
|
||||
|
|
@ -403,6 +408,9 @@ func (s HistorySamplecollectionSetter) SetColumns() []string {
|
|||
if !s.Zone2.IsUnset() {
|
||||
vals = append(vals, "zone2")
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
vals = append(vals, "created")
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals = append(vals, "created_date")
|
||||
}
|
||||
|
|
@ -428,8 +436,8 @@ func (s HistorySamplecollectionSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s HistorySamplecollectionSetter) Overwrite(t *HistorySamplecollection) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Activity.IsUnset() {
|
||||
t.Activity = s.Activity.MustGetNull()
|
||||
|
|
@ -557,6 +565,9 @@ func (s HistorySamplecollectionSetter) Overwrite(t *HistorySamplecollection) {
|
|||
if !s.Zone2.IsUnset() {
|
||||
t.Zone2 = s.Zone2.MustGetNull()
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
t.Created = s.Created.MustGetNull()
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
t.CreatedDate = s.CreatedDate.MustGetNull()
|
||||
}
|
||||
|
|
@ -586,9 +597,9 @@ func (s *HistorySamplecollectionSetter) Apply(q *dialect.InsertQuery) {
|
|||
})
|
||||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 50)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
vals := make([]bob.Expression, 51)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -845,48 +856,54 @@ func (s *HistorySamplecollectionSetter) Apply(q *dialect.InsertQuery) {
|
|||
vals[42] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[43] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
if !s.Created.IsUnset() {
|
||||
vals[43] = psql.Arg(s.Created.MustGetNull())
|
||||
} else {
|
||||
vals[43] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[44] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[44] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
} else {
|
||||
vals[44] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[45] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[45] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
} else {
|
||||
vals[45] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[46] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[46] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
} else {
|
||||
vals[46] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[47] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[47] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
} else {
|
||||
vals[47] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[48] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[48] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
} else {
|
||||
vals[48] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[49] = psql.Arg(s.Version.MustGet())
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[49] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
} else {
|
||||
vals[49] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[50] = psql.Arg(s.Version.MustGet())
|
||||
} else {
|
||||
vals[50] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
return bob.ExpressSlice(ctx, w, d, start, vals, "", ", ", "")
|
||||
}))
|
||||
}
|
||||
|
|
@ -896,9 +913,9 @@ func (s HistorySamplecollectionSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery]
|
|||
}
|
||||
|
||||
func (s HistorySamplecollectionSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 50)
|
||||
exprs := make([]bob.Expression, 0, 51)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -1199,6 +1216,13 @@ func (s HistorySamplecollectionSetter) Expressions(prefix ...string) []bob.Expre
|
|||
}})
|
||||
}
|
||||
|
||||
if !s.Created.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created")...),
|
||||
psql.Arg(s.Created),
|
||||
}})
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created_date")...),
|
||||
|
|
@ -1492,7 +1516,7 @@ func (o *HistorySamplecollection) Organization(mods ...bob.Mod[*dialect.SelectQu
|
|||
}
|
||||
|
||||
func (os HistorySamplecollectionSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -1510,7 +1534,7 @@ func (os HistorySamplecollectionSlice) Organization(mods ...bob.Mod[*dialect.Sel
|
|||
|
||||
func attachHistorySamplecollectionOrganization0(ctx context.Context, exec bob.Executor, count int, historySamplecollection0 *HistorySamplecollection, organization1 *Organization) (*HistorySamplecollection, error) {
|
||||
setter := &HistorySamplecollectionSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := historySamplecollection0.Update(ctx, exec, setter)
|
||||
|
|
@ -1557,7 +1581,7 @@ func (historySamplecollection0 *HistorySamplecollection) AttachOrganization(ctx
|
|||
}
|
||||
|
||||
type historySamplecollectionWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Activity psql.WhereNullMod[Q, string]
|
||||
Avetemp psql.WhereNullMod[Q, float64]
|
||||
Chickenid psql.WhereNullMod[Q, string]
|
||||
|
|
@ -1600,6 +1624,7 @@ type historySamplecollectionWhere[Q psql.Filterable] struct {
|
|||
Windspeed psql.WhereNullMod[Q, float64]
|
||||
Zone psql.WhereNullMod[Q, string]
|
||||
Zone2 psql.WhereNullMod[Q, string]
|
||||
Created psql.WhereNullMod[Q, time.Time]
|
||||
CreatedDate psql.WhereNullMod[Q, int64]
|
||||
CreatedUser psql.WhereNullMod[Q, string]
|
||||
GeometryX psql.WhereNullMod[Q, float64]
|
||||
|
|
@ -1615,7 +1640,7 @@ func (historySamplecollectionWhere[Q]) AliasedAs(alias string) historySamplecoll
|
|||
|
||||
func buildHistorySamplecollectionWhere[Q psql.Filterable](cols historySamplecollectionColumns) historySamplecollectionWhere[Q] {
|
||||
return historySamplecollectionWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Activity: psql.WhereNull[Q, string](cols.Activity),
|
||||
Avetemp: psql.WhereNull[Q, float64](cols.Avetemp),
|
||||
Chickenid: psql.WhereNull[Q, string](cols.Chickenid),
|
||||
|
|
@ -1658,6 +1683,7 @@ func buildHistorySamplecollectionWhere[Q psql.Filterable](cols historySamplecoll
|
|||
Windspeed: psql.WhereNull[Q, float64](cols.Windspeed),
|
||||
Zone: psql.WhereNull[Q, string](cols.Zone),
|
||||
Zone2: psql.WhereNull[Q, string](cols.Zone2),
|
||||
Created: psql.WhereNull[Q, time.Time](cols.Created),
|
||||
CreatedDate: psql.WhereNull[Q, int64](cols.CreatedDate),
|
||||
CreatedUser: psql.WhereNull[Q, string](cols.CreatedUser),
|
||||
GeometryX: psql.WhereNull[Q, float64](cols.GeometryX),
|
||||
|
|
@ -1769,11 +1795,8 @@ func (os HistorySamplecollectionSlice) LoadOrganization(ctx context.Context, exe
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"time"
|
||||
|
||||
"github.com/aarondl/opt/null"
|
||||
"github.com/aarondl/opt/omit"
|
||||
|
|
@ -25,34 +26,35 @@ import (
|
|||
|
||||
// HistorySamplelocation is an object representing the database table.
|
||||
type HistorySamplelocation struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
Accessdesc null.Val[string] `db:"accessdesc" `
|
||||
Active null.Val[int16] `db:"active" `
|
||||
Comments null.Val[string] `db:"comments" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Description null.Val[string] `db:"description" `
|
||||
Externalid null.Val[string] `db:"externalid" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
Editor null.Val[string] `db:"editor" `
|
||||
Gatewaysync null.Val[int16] `db:"gatewaysync" `
|
||||
Globalid null.Val[string] `db:"globalid" `
|
||||
Habitat null.Val[string] `db:"habitat" `
|
||||
Locationnumber null.Val[int64] `db:"locationnumber" `
|
||||
Name null.Val[string] `db:"name" `
|
||||
Nextactiondatescheduled null.Val[int64] `db:"nextactiondatescheduled" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
Priority null.Val[string] `db:"priority" `
|
||||
Usetype null.Val[string] `db:"usetype" `
|
||||
Zone null.Val[string] `db:"zone" `
|
||||
Zone2 null.Val[string] `db:"zone2" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Version int32 `db:"version,pk" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Accessdesc null.Val[string] `db:"accessdesc" `
|
||||
Active null.Val[int16] `db:"active" `
|
||||
Comments null.Val[string] `db:"comments" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Description null.Val[string] `db:"description" `
|
||||
Externalid null.Val[string] `db:"externalid" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
Editor null.Val[string] `db:"editor" `
|
||||
Gatewaysync null.Val[int16] `db:"gatewaysync" `
|
||||
Globalid null.Val[string] `db:"globalid" `
|
||||
Habitat null.Val[string] `db:"habitat" `
|
||||
Locationnumber null.Val[int64] `db:"locationnumber" `
|
||||
Name null.Val[string] `db:"name" `
|
||||
Nextactiondatescheduled null.Val[int64] `db:"nextactiondatescheduled" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
Priority null.Val[string] `db:"priority" `
|
||||
Usetype null.Val[string] `db:"usetype" `
|
||||
Zone null.Val[string] `db:"zone" `
|
||||
Zone2 null.Val[string] `db:"zone2" `
|
||||
Created null.Val[time.Time] `db:"created" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Version int32 `db:"version,pk" `
|
||||
|
||||
R historySamplelocationR `db:"-" `
|
||||
}
|
||||
|
|
@ -75,7 +77,7 @@ type historySamplelocationR struct {
|
|||
func buildHistorySamplelocationColumns(alias string) historySamplelocationColumns {
|
||||
return historySamplelocationColumns{
|
||||
ColumnsExpr: expr.NewColumnsExpr(
|
||||
"organization_id", "accessdesc", "active", "comments", "creationdate", "creator", "description", "externalid", "editdate", "editor", "gatewaysync", "globalid", "habitat", "locationnumber", "name", "nextactiondatescheduled", "objectid", "priority", "usetype", "zone", "zone2", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "version",
|
||||
"organization_id", "accessdesc", "active", "comments", "creationdate", "creator", "description", "externalid", "editdate", "editor", "gatewaysync", "globalid", "habitat", "locationnumber", "name", "nextactiondatescheduled", "objectid", "priority", "usetype", "zone", "zone2", "created", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "version",
|
||||
).WithParent("history_samplelocation"),
|
||||
tableAlias: alias,
|
||||
OrganizationID: psql.Quote(alias, "organization_id"),
|
||||
|
|
@ -99,6 +101,7 @@ func buildHistorySamplelocationColumns(alias string) historySamplelocationColumn
|
|||
Usetype: psql.Quote(alias, "usetype"),
|
||||
Zone: psql.Quote(alias, "zone"),
|
||||
Zone2: psql.Quote(alias, "zone2"),
|
||||
Created: psql.Quote(alias, "created"),
|
||||
CreatedDate: psql.Quote(alias, "created_date"),
|
||||
CreatedUser: psql.Quote(alias, "created_user"),
|
||||
GeometryX: psql.Quote(alias, "geometry_x"),
|
||||
|
|
@ -133,6 +136,7 @@ type historySamplelocationColumns struct {
|
|||
Usetype psql.Expression
|
||||
Zone psql.Expression
|
||||
Zone2 psql.Expression
|
||||
Created psql.Expression
|
||||
CreatedDate psql.Expression
|
||||
CreatedUser psql.Expression
|
||||
GeometryX psql.Expression
|
||||
|
|
@ -154,39 +158,40 @@ func (historySamplelocationColumns) AliasedAs(alias string) historySamplelocatio
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type HistorySamplelocationSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
Accessdesc omitnull.Val[string] `db:"accessdesc" `
|
||||
Active omitnull.Val[int16] `db:"active" `
|
||||
Comments omitnull.Val[string] `db:"comments" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Description omitnull.Val[string] `db:"description" `
|
||||
Externalid omitnull.Val[string] `db:"externalid" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
Editor omitnull.Val[string] `db:"editor" `
|
||||
Gatewaysync omitnull.Val[int16] `db:"gatewaysync" `
|
||||
Globalid omitnull.Val[string] `db:"globalid" `
|
||||
Habitat omitnull.Val[string] `db:"habitat" `
|
||||
Locationnumber omitnull.Val[int64] `db:"locationnumber" `
|
||||
Name omitnull.Val[string] `db:"name" `
|
||||
Nextactiondatescheduled omitnull.Val[int64] `db:"nextactiondatescheduled" `
|
||||
Objectid omit.Val[int32] `db:"objectid,pk" `
|
||||
Priority omitnull.Val[string] `db:"priority" `
|
||||
Usetype omitnull.Val[string] `db:"usetype" `
|
||||
Zone omitnull.Val[string] `db:"zone" `
|
||||
Zone2 omitnull.Val[string] `db:"zone2" `
|
||||
CreatedDate omitnull.Val[int64] `db:"created_date" `
|
||||
CreatedUser omitnull.Val[string] `db:"created_user" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Accessdesc omitnull.Val[string] `db:"accessdesc" `
|
||||
Active omitnull.Val[int16] `db:"active" `
|
||||
Comments omitnull.Val[string] `db:"comments" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Description omitnull.Val[string] `db:"description" `
|
||||
Externalid omitnull.Val[string] `db:"externalid" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
Editor omitnull.Val[string] `db:"editor" `
|
||||
Gatewaysync omitnull.Val[int16] `db:"gatewaysync" `
|
||||
Globalid omitnull.Val[string] `db:"globalid" `
|
||||
Habitat omitnull.Val[string] `db:"habitat" `
|
||||
Locationnumber omitnull.Val[int64] `db:"locationnumber" `
|
||||
Name omitnull.Val[string] `db:"name" `
|
||||
Nextactiondatescheduled omitnull.Val[int64] `db:"nextactiondatescheduled" `
|
||||
Objectid omit.Val[int32] `db:"objectid,pk" `
|
||||
Priority omitnull.Val[string] `db:"priority" `
|
||||
Usetype omitnull.Val[string] `db:"usetype" `
|
||||
Zone omitnull.Val[string] `db:"zone" `
|
||||
Zone2 omitnull.Val[string] `db:"zone2" `
|
||||
Created omitnull.Val[time.Time] `db:"created" `
|
||||
CreatedDate omitnull.Val[int64] `db:"created_date" `
|
||||
CreatedUser omitnull.Val[string] `db:"created_user" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
}
|
||||
|
||||
func (s HistorySamplelocationSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 28)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals := make([]string, 0, 29)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Accessdesc.IsUnset() {
|
||||
|
|
@ -249,6 +254,9 @@ func (s HistorySamplelocationSetter) SetColumns() []string {
|
|||
if !s.Zone2.IsUnset() {
|
||||
vals = append(vals, "zone2")
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
vals = append(vals, "created")
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals = append(vals, "created_date")
|
||||
}
|
||||
|
|
@ -274,8 +282,8 @@ func (s HistorySamplelocationSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s HistorySamplelocationSetter) Overwrite(t *HistorySamplelocation) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Accessdesc.IsUnset() {
|
||||
t.Accessdesc = s.Accessdesc.MustGetNull()
|
||||
|
|
@ -337,6 +345,9 @@ func (s HistorySamplelocationSetter) Overwrite(t *HistorySamplelocation) {
|
|||
if !s.Zone2.IsUnset() {
|
||||
t.Zone2 = s.Zone2.MustGetNull()
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
t.Created = s.Created.MustGetNull()
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
t.CreatedDate = s.CreatedDate.MustGetNull()
|
||||
}
|
||||
|
|
@ -366,9 +377,9 @@ func (s *HistorySamplelocationSetter) Apply(q *dialect.InsertQuery) {
|
|||
})
|
||||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 28)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
vals := make([]bob.Expression, 29)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -493,48 +504,54 @@ func (s *HistorySamplelocationSetter) Apply(q *dialect.InsertQuery) {
|
|||
vals[20] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[21] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
if !s.Created.IsUnset() {
|
||||
vals[21] = psql.Arg(s.Created.MustGetNull())
|
||||
} else {
|
||||
vals[21] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[22] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[22] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
} else {
|
||||
vals[22] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[23] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[23] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
} else {
|
||||
vals[23] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[24] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[24] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
} else {
|
||||
vals[24] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[25] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[25] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
} else {
|
||||
vals[25] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[26] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[26] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
} else {
|
||||
vals[26] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[27] = psql.Arg(s.Version.MustGet())
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[27] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
} else {
|
||||
vals[27] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[28] = psql.Arg(s.Version.MustGet())
|
||||
} else {
|
||||
vals[28] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
return bob.ExpressSlice(ctx, w, d, start, vals, "", ", ", "")
|
||||
}))
|
||||
}
|
||||
|
|
@ -544,9 +561,9 @@ func (s HistorySamplelocationSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery] {
|
|||
}
|
||||
|
||||
func (s HistorySamplelocationSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 28)
|
||||
exprs := make([]bob.Expression, 0, 29)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -693,6 +710,13 @@ func (s HistorySamplelocationSetter) Expressions(prefix ...string) []bob.Express
|
|||
}})
|
||||
}
|
||||
|
||||
if !s.Created.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created")...),
|
||||
psql.Arg(s.Created),
|
||||
}})
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created_date")...),
|
||||
|
|
@ -986,7 +1010,7 @@ func (o *HistorySamplelocation) Organization(mods ...bob.Mod[*dialect.SelectQuer
|
|||
}
|
||||
|
||||
func (os HistorySamplelocationSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -1004,7 +1028,7 @@ func (os HistorySamplelocationSlice) Organization(mods ...bob.Mod[*dialect.Selec
|
|||
|
||||
func attachHistorySamplelocationOrganization0(ctx context.Context, exec bob.Executor, count int, historySamplelocation0 *HistorySamplelocation, organization1 *Organization) (*HistorySamplelocation, error) {
|
||||
setter := &HistorySamplelocationSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := historySamplelocation0.Update(ctx, exec, setter)
|
||||
|
|
@ -1051,7 +1075,7 @@ func (historySamplelocation0 *HistorySamplelocation) AttachOrganization(ctx cont
|
|||
}
|
||||
|
||||
type historySamplelocationWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Accessdesc psql.WhereNullMod[Q, string]
|
||||
Active psql.WhereNullMod[Q, int16]
|
||||
Comments psql.WhereNullMod[Q, string]
|
||||
|
|
@ -1072,6 +1096,7 @@ type historySamplelocationWhere[Q psql.Filterable] struct {
|
|||
Usetype psql.WhereNullMod[Q, string]
|
||||
Zone psql.WhereNullMod[Q, string]
|
||||
Zone2 psql.WhereNullMod[Q, string]
|
||||
Created psql.WhereNullMod[Q, time.Time]
|
||||
CreatedDate psql.WhereNullMod[Q, int64]
|
||||
CreatedUser psql.WhereNullMod[Q, string]
|
||||
GeometryX psql.WhereNullMod[Q, float64]
|
||||
|
|
@ -1087,7 +1112,7 @@ func (historySamplelocationWhere[Q]) AliasedAs(alias string) historySamplelocati
|
|||
|
||||
func buildHistorySamplelocationWhere[Q psql.Filterable](cols historySamplelocationColumns) historySamplelocationWhere[Q] {
|
||||
return historySamplelocationWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Accessdesc: psql.WhereNull[Q, string](cols.Accessdesc),
|
||||
Active: psql.WhereNull[Q, int16](cols.Active),
|
||||
Comments: psql.WhereNull[Q, string](cols.Comments),
|
||||
|
|
@ -1108,6 +1133,7 @@ func buildHistorySamplelocationWhere[Q psql.Filterable](cols historySamplelocati
|
|||
Usetype: psql.WhereNull[Q, string](cols.Usetype),
|
||||
Zone: psql.WhereNull[Q, string](cols.Zone),
|
||||
Zone2: psql.WhereNull[Q, string](cols.Zone2),
|
||||
Created: psql.WhereNull[Q, time.Time](cols.Created),
|
||||
CreatedDate: psql.WhereNull[Q, int64](cols.CreatedDate),
|
||||
CreatedUser: psql.WhereNull[Q, string](cols.CreatedUser),
|
||||
GeometryX: psql.WhereNull[Q, float64](cols.GeometryX),
|
||||
|
|
@ -1219,11 +1245,8 @@ func (os HistorySamplelocationSlice) LoadOrganization(ctx context.Context, exec
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"time"
|
||||
|
||||
"github.com/aarondl/opt/null"
|
||||
"github.com/aarondl/opt/omit"
|
||||
|
|
@ -25,96 +26,97 @@ import (
|
|||
|
||||
// HistoryServicerequest is an object representing the database table.
|
||||
type HistoryServicerequest struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
Accepted null.Val[int16] `db:"accepted" `
|
||||
Acceptedby null.Val[string] `db:"acceptedby" `
|
||||
Accepteddate null.Val[int64] `db:"accepteddate" `
|
||||
Allowed null.Val[string] `db:"allowed" `
|
||||
Assignedtech null.Val[string] `db:"assignedtech" `
|
||||
Clraddr1 null.Val[string] `db:"clraddr1" `
|
||||
Clraddr2 null.Val[string] `db:"clraddr2" `
|
||||
Clranon null.Val[int16] `db:"clranon" `
|
||||
Clrcity null.Val[string] `db:"clrcity" `
|
||||
Clrcompany null.Val[string] `db:"clrcompany" `
|
||||
Clrcontpref null.Val[string] `db:"clrcontpref" `
|
||||
Clremail null.Val[string] `db:"clremail" `
|
||||
Clrfname null.Val[string] `db:"clrfname" `
|
||||
Clrother null.Val[string] `db:"clrother" `
|
||||
Clrphone1 null.Val[string] `db:"clrphone1" `
|
||||
Clrphone2 null.Val[string] `db:"clrphone2" `
|
||||
Clrstate null.Val[string] `db:"clrstate" `
|
||||
Clrzip null.Val[string] `db:"clrzip" `
|
||||
Comments null.Val[string] `db:"comments" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Datetimeclosed null.Val[int64] `db:"datetimeclosed" `
|
||||
Duedate null.Val[int64] `db:"duedate" `
|
||||
Entrytech null.Val[string] `db:"entrytech" `
|
||||
Estcompletedate null.Val[int64] `db:"estcompletedate" `
|
||||
Externalerror null.Val[string] `db:"externalerror" `
|
||||
Externalid null.Val[string] `db:"externalid" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
Editor null.Val[string] `db:"editor" `
|
||||
Firstresponsedate null.Val[int64] `db:"firstresponsedate" `
|
||||
Globalid null.Val[string] `db:"globalid" `
|
||||
Issuesreported null.Val[string] `db:"issuesreported" `
|
||||
Jurisdiction null.Val[string] `db:"jurisdiction" `
|
||||
Nextaction null.Val[string] `db:"nextaction" `
|
||||
Notificationtimestamp null.Val[string] `db:"notificationtimestamp" `
|
||||
Notified null.Val[int16] `db:"notified" `
|
||||
Notifieddate null.Val[int64] `db:"notifieddate" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
Pointlocid null.Val[string] `db:"pointlocid" `
|
||||
Priority null.Val[string] `db:"priority" `
|
||||
Recdatetime null.Val[int64] `db:"recdatetime" `
|
||||
Recordstatus null.Val[int16] `db:"recordstatus" `
|
||||
Rejectedby null.Val[string] `db:"rejectedby" `
|
||||
Rejecteddate null.Val[int64] `db:"rejecteddate" `
|
||||
Rejectedreason null.Val[string] `db:"rejectedreason" `
|
||||
Reqaddr1 null.Val[string] `db:"reqaddr1" `
|
||||
Reqaddr2 null.Val[string] `db:"reqaddr2" `
|
||||
Reqcity null.Val[string] `db:"reqcity" `
|
||||
Reqcompany null.Val[string] `db:"reqcompany" `
|
||||
Reqcrossst null.Val[string] `db:"reqcrossst" `
|
||||
Reqdescr null.Val[string] `db:"reqdescr" `
|
||||
Reqfldnotes null.Val[string] `db:"reqfldnotes" `
|
||||
Reqmapgrid null.Val[string] `db:"reqmapgrid" `
|
||||
Reqnotesforcust null.Val[string] `db:"reqnotesforcust" `
|
||||
Reqnotesfortech null.Val[string] `db:"reqnotesfortech" `
|
||||
Reqpermission null.Val[int16] `db:"reqpermission" `
|
||||
Reqprogramactions null.Val[string] `db:"reqprogramactions" `
|
||||
Reqstate null.Val[string] `db:"reqstate" `
|
||||
Reqsubdiv null.Val[string] `db:"reqsubdiv" `
|
||||
Reqtarget null.Val[string] `db:"reqtarget" `
|
||||
Reqzip null.Val[string] `db:"reqzip" `
|
||||
Responsedaycount null.Val[int16] `db:"responsedaycount" `
|
||||
Reviewed null.Val[int16] `db:"reviewed" `
|
||||
Reviewedby null.Val[string] `db:"reviewedby" `
|
||||
Revieweddate null.Val[int64] `db:"revieweddate" `
|
||||
Scheduled null.Val[int16] `db:"scheduled" `
|
||||
Scheduleddate null.Val[int64] `db:"scheduleddate" `
|
||||
Source null.Val[string] `db:"source" `
|
||||
SRNumber null.Val[int64] `db:"sr_number" `
|
||||
Status null.Val[string] `db:"status" `
|
||||
Supervisor null.Val[string] `db:"supervisor" `
|
||||
Techclosed null.Val[string] `db:"techclosed" `
|
||||
Validx null.Val[string] `db:"validx" `
|
||||
Validy null.Val[string] `db:"validy" `
|
||||
Xvalue null.Val[string] `db:"xvalue" `
|
||||
Yvalue null.Val[string] `db:"yvalue" `
|
||||
Zone null.Val[string] `db:"zone" `
|
||||
Zone2 null.Val[string] `db:"zone2" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Dog null.Val[int64] `db:"dog" `
|
||||
Spanish null.Val[int64] `db:"spanish" `
|
||||
ScheduleNotes null.Val[string] `db:"schedule_notes" `
|
||||
SchedulePeriod null.Val[string] `db:"schedule_period" `
|
||||
Version int32 `db:"version,pk" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Accepted null.Val[int16] `db:"accepted" `
|
||||
Acceptedby null.Val[string] `db:"acceptedby" `
|
||||
Accepteddate null.Val[int64] `db:"accepteddate" `
|
||||
Allowed null.Val[string] `db:"allowed" `
|
||||
Assignedtech null.Val[string] `db:"assignedtech" `
|
||||
Clraddr1 null.Val[string] `db:"clraddr1" `
|
||||
Clraddr2 null.Val[string] `db:"clraddr2" `
|
||||
Clranon null.Val[int16] `db:"clranon" `
|
||||
Clrcity null.Val[string] `db:"clrcity" `
|
||||
Clrcompany null.Val[string] `db:"clrcompany" `
|
||||
Clrcontpref null.Val[string] `db:"clrcontpref" `
|
||||
Clremail null.Val[string] `db:"clremail" `
|
||||
Clrfname null.Val[string] `db:"clrfname" `
|
||||
Clrother null.Val[string] `db:"clrother" `
|
||||
Clrphone1 null.Val[string] `db:"clrphone1" `
|
||||
Clrphone2 null.Val[string] `db:"clrphone2" `
|
||||
Clrstate null.Val[string] `db:"clrstate" `
|
||||
Clrzip null.Val[string] `db:"clrzip" `
|
||||
Comments null.Val[string] `db:"comments" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Datetimeclosed null.Val[int64] `db:"datetimeclosed" `
|
||||
Duedate null.Val[int64] `db:"duedate" `
|
||||
Entrytech null.Val[string] `db:"entrytech" `
|
||||
Estcompletedate null.Val[int64] `db:"estcompletedate" `
|
||||
Externalerror null.Val[string] `db:"externalerror" `
|
||||
Externalid null.Val[string] `db:"externalid" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
Editor null.Val[string] `db:"editor" `
|
||||
Firstresponsedate null.Val[int64] `db:"firstresponsedate" `
|
||||
Globalid null.Val[string] `db:"globalid" `
|
||||
Issuesreported null.Val[string] `db:"issuesreported" `
|
||||
Jurisdiction null.Val[string] `db:"jurisdiction" `
|
||||
Nextaction null.Val[string] `db:"nextaction" `
|
||||
Notificationtimestamp null.Val[string] `db:"notificationtimestamp" `
|
||||
Notified null.Val[int16] `db:"notified" `
|
||||
Notifieddate null.Val[int64] `db:"notifieddate" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
Pointlocid null.Val[string] `db:"pointlocid" `
|
||||
Priority null.Val[string] `db:"priority" `
|
||||
Recdatetime null.Val[int64] `db:"recdatetime" `
|
||||
Recordstatus null.Val[int16] `db:"recordstatus" `
|
||||
Rejectedby null.Val[string] `db:"rejectedby" `
|
||||
Rejecteddate null.Val[int64] `db:"rejecteddate" `
|
||||
Rejectedreason null.Val[string] `db:"rejectedreason" `
|
||||
Reqaddr1 null.Val[string] `db:"reqaddr1" `
|
||||
Reqaddr2 null.Val[string] `db:"reqaddr2" `
|
||||
Reqcity null.Val[string] `db:"reqcity" `
|
||||
Reqcompany null.Val[string] `db:"reqcompany" `
|
||||
Reqcrossst null.Val[string] `db:"reqcrossst" `
|
||||
Reqdescr null.Val[string] `db:"reqdescr" `
|
||||
Reqfldnotes null.Val[string] `db:"reqfldnotes" `
|
||||
Reqmapgrid null.Val[string] `db:"reqmapgrid" `
|
||||
Reqnotesforcust null.Val[string] `db:"reqnotesforcust" `
|
||||
Reqnotesfortech null.Val[string] `db:"reqnotesfortech" `
|
||||
Reqpermission null.Val[int16] `db:"reqpermission" `
|
||||
Reqprogramactions null.Val[string] `db:"reqprogramactions" `
|
||||
Reqstate null.Val[string] `db:"reqstate" `
|
||||
Reqsubdiv null.Val[string] `db:"reqsubdiv" `
|
||||
Reqtarget null.Val[string] `db:"reqtarget" `
|
||||
Reqzip null.Val[string] `db:"reqzip" `
|
||||
Responsedaycount null.Val[int16] `db:"responsedaycount" `
|
||||
Reviewed null.Val[int16] `db:"reviewed" `
|
||||
Reviewedby null.Val[string] `db:"reviewedby" `
|
||||
Revieweddate null.Val[int64] `db:"revieweddate" `
|
||||
Scheduled null.Val[int16] `db:"scheduled" `
|
||||
Scheduleddate null.Val[int64] `db:"scheduleddate" `
|
||||
Source null.Val[string] `db:"source" `
|
||||
SRNumber null.Val[int64] `db:"sr_number" `
|
||||
Status null.Val[string] `db:"status" `
|
||||
Supervisor null.Val[string] `db:"supervisor" `
|
||||
Techclosed null.Val[string] `db:"techclosed" `
|
||||
Validx null.Val[string] `db:"validx" `
|
||||
Validy null.Val[string] `db:"validy" `
|
||||
Xvalue null.Val[string] `db:"xvalue" `
|
||||
Yvalue null.Val[string] `db:"yvalue" `
|
||||
Zone null.Val[string] `db:"zone" `
|
||||
Zone2 null.Val[string] `db:"zone2" `
|
||||
Created null.Val[time.Time] `db:"created" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Dog null.Val[int64] `db:"dog" `
|
||||
Spanish null.Val[int64] `db:"spanish" `
|
||||
ScheduleNotes null.Val[string] `db:"schedule_notes" `
|
||||
SchedulePeriod null.Val[string] `db:"schedule_period" `
|
||||
Version int32 `db:"version,pk" `
|
||||
|
||||
R historyServicerequestR `db:"-" `
|
||||
}
|
||||
|
|
@ -137,7 +139,7 @@ type historyServicerequestR struct {
|
|||
func buildHistoryServicerequestColumns(alias string) historyServicerequestColumns {
|
||||
return historyServicerequestColumns{
|
||||
ColumnsExpr: expr.NewColumnsExpr(
|
||||
"organization_id", "accepted", "acceptedby", "accepteddate", "allowed", "assignedtech", "clraddr1", "clraddr2", "clranon", "clrcity", "clrcompany", "clrcontpref", "clremail", "clrfname", "clrother", "clrphone1", "clrphone2", "clrstate", "clrzip", "comments", "creationdate", "creator", "datetimeclosed", "duedate", "entrytech", "estcompletedate", "externalerror", "externalid", "editdate", "editor", "firstresponsedate", "globalid", "issuesreported", "jurisdiction", "nextaction", "notificationtimestamp", "notified", "notifieddate", "objectid", "pointlocid", "priority", "recdatetime", "recordstatus", "rejectedby", "rejecteddate", "rejectedreason", "reqaddr1", "reqaddr2", "reqcity", "reqcompany", "reqcrossst", "reqdescr", "reqfldnotes", "reqmapgrid", "reqnotesforcust", "reqnotesfortech", "reqpermission", "reqprogramactions", "reqstate", "reqsubdiv", "reqtarget", "reqzip", "responsedaycount", "reviewed", "reviewedby", "revieweddate", "scheduled", "scheduleddate", "source", "sr_number", "status", "supervisor", "techclosed", "validx", "validy", "xvalue", "yvalue", "zone", "zone2", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "dog", "spanish", "schedule_notes", "schedule_period", "version",
|
||||
"organization_id", "accepted", "acceptedby", "accepteddate", "allowed", "assignedtech", "clraddr1", "clraddr2", "clranon", "clrcity", "clrcompany", "clrcontpref", "clremail", "clrfname", "clrother", "clrphone1", "clrphone2", "clrstate", "clrzip", "comments", "creationdate", "creator", "datetimeclosed", "duedate", "entrytech", "estcompletedate", "externalerror", "externalid", "editdate", "editor", "firstresponsedate", "globalid", "issuesreported", "jurisdiction", "nextaction", "notificationtimestamp", "notified", "notifieddate", "objectid", "pointlocid", "priority", "recdatetime", "recordstatus", "rejectedby", "rejecteddate", "rejectedreason", "reqaddr1", "reqaddr2", "reqcity", "reqcompany", "reqcrossst", "reqdescr", "reqfldnotes", "reqmapgrid", "reqnotesforcust", "reqnotesfortech", "reqpermission", "reqprogramactions", "reqstate", "reqsubdiv", "reqtarget", "reqzip", "responsedaycount", "reviewed", "reviewedby", "revieweddate", "scheduled", "scheduleddate", "source", "sr_number", "status", "supervisor", "techclosed", "validx", "validy", "xvalue", "yvalue", "zone", "zone2", "created", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "dog", "spanish", "schedule_notes", "schedule_period", "version",
|
||||
).WithParent("history_servicerequest"),
|
||||
tableAlias: alias,
|
||||
OrganizationID: psql.Quote(alias, "organization_id"),
|
||||
|
|
@ -219,6 +221,7 @@ func buildHistoryServicerequestColumns(alias string) historyServicerequestColumn
|
|||
Yvalue: psql.Quote(alias, "yvalue"),
|
||||
Zone: psql.Quote(alias, "zone"),
|
||||
Zone2: psql.Quote(alias, "zone2"),
|
||||
Created: psql.Quote(alias, "created"),
|
||||
CreatedDate: psql.Quote(alias, "created_date"),
|
||||
CreatedUser: psql.Quote(alias, "created_user"),
|
||||
GeometryX: psql.Quote(alias, "geometry_x"),
|
||||
|
|
@ -315,6 +318,7 @@ type historyServicerequestColumns struct {
|
|||
Yvalue psql.Expression
|
||||
Zone psql.Expression
|
||||
Zone2 psql.Expression
|
||||
Created psql.Expression
|
||||
CreatedDate psql.Expression
|
||||
CreatedUser psql.Expression
|
||||
GeometryX psql.Expression
|
||||
|
|
@ -340,101 +344,102 @@ func (historyServicerequestColumns) AliasedAs(alias string) historyServicereques
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type HistoryServicerequestSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
Accepted omitnull.Val[int16] `db:"accepted" `
|
||||
Acceptedby omitnull.Val[string] `db:"acceptedby" `
|
||||
Accepteddate omitnull.Val[int64] `db:"accepteddate" `
|
||||
Allowed omitnull.Val[string] `db:"allowed" `
|
||||
Assignedtech omitnull.Val[string] `db:"assignedtech" `
|
||||
Clraddr1 omitnull.Val[string] `db:"clraddr1" `
|
||||
Clraddr2 omitnull.Val[string] `db:"clraddr2" `
|
||||
Clranon omitnull.Val[int16] `db:"clranon" `
|
||||
Clrcity omitnull.Val[string] `db:"clrcity" `
|
||||
Clrcompany omitnull.Val[string] `db:"clrcompany" `
|
||||
Clrcontpref omitnull.Val[string] `db:"clrcontpref" `
|
||||
Clremail omitnull.Val[string] `db:"clremail" `
|
||||
Clrfname omitnull.Val[string] `db:"clrfname" `
|
||||
Clrother omitnull.Val[string] `db:"clrother" `
|
||||
Clrphone1 omitnull.Val[string] `db:"clrphone1" `
|
||||
Clrphone2 omitnull.Val[string] `db:"clrphone2" `
|
||||
Clrstate omitnull.Val[string] `db:"clrstate" `
|
||||
Clrzip omitnull.Val[string] `db:"clrzip" `
|
||||
Comments omitnull.Val[string] `db:"comments" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Datetimeclosed omitnull.Val[int64] `db:"datetimeclosed" `
|
||||
Duedate omitnull.Val[int64] `db:"duedate" `
|
||||
Entrytech omitnull.Val[string] `db:"entrytech" `
|
||||
Estcompletedate omitnull.Val[int64] `db:"estcompletedate" `
|
||||
Externalerror omitnull.Val[string] `db:"externalerror" `
|
||||
Externalid omitnull.Val[string] `db:"externalid" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
Editor omitnull.Val[string] `db:"editor" `
|
||||
Firstresponsedate omitnull.Val[int64] `db:"firstresponsedate" `
|
||||
Globalid omitnull.Val[string] `db:"globalid" `
|
||||
Issuesreported omitnull.Val[string] `db:"issuesreported" `
|
||||
Jurisdiction omitnull.Val[string] `db:"jurisdiction" `
|
||||
Nextaction omitnull.Val[string] `db:"nextaction" `
|
||||
Notificationtimestamp omitnull.Val[string] `db:"notificationtimestamp" `
|
||||
Notified omitnull.Val[int16] `db:"notified" `
|
||||
Notifieddate omitnull.Val[int64] `db:"notifieddate" `
|
||||
Objectid omit.Val[int32] `db:"objectid,pk" `
|
||||
Pointlocid omitnull.Val[string] `db:"pointlocid" `
|
||||
Priority omitnull.Val[string] `db:"priority" `
|
||||
Recdatetime omitnull.Val[int64] `db:"recdatetime" `
|
||||
Recordstatus omitnull.Val[int16] `db:"recordstatus" `
|
||||
Rejectedby omitnull.Val[string] `db:"rejectedby" `
|
||||
Rejecteddate omitnull.Val[int64] `db:"rejecteddate" `
|
||||
Rejectedreason omitnull.Val[string] `db:"rejectedreason" `
|
||||
Reqaddr1 omitnull.Val[string] `db:"reqaddr1" `
|
||||
Reqaddr2 omitnull.Val[string] `db:"reqaddr2" `
|
||||
Reqcity omitnull.Val[string] `db:"reqcity" `
|
||||
Reqcompany omitnull.Val[string] `db:"reqcompany" `
|
||||
Reqcrossst omitnull.Val[string] `db:"reqcrossst" `
|
||||
Reqdescr omitnull.Val[string] `db:"reqdescr" `
|
||||
Reqfldnotes omitnull.Val[string] `db:"reqfldnotes" `
|
||||
Reqmapgrid omitnull.Val[string] `db:"reqmapgrid" `
|
||||
Reqnotesforcust omitnull.Val[string] `db:"reqnotesforcust" `
|
||||
Reqnotesfortech omitnull.Val[string] `db:"reqnotesfortech" `
|
||||
Reqpermission omitnull.Val[int16] `db:"reqpermission" `
|
||||
Reqprogramactions omitnull.Val[string] `db:"reqprogramactions" `
|
||||
Reqstate omitnull.Val[string] `db:"reqstate" `
|
||||
Reqsubdiv omitnull.Val[string] `db:"reqsubdiv" `
|
||||
Reqtarget omitnull.Val[string] `db:"reqtarget" `
|
||||
Reqzip omitnull.Val[string] `db:"reqzip" `
|
||||
Responsedaycount omitnull.Val[int16] `db:"responsedaycount" `
|
||||
Reviewed omitnull.Val[int16] `db:"reviewed" `
|
||||
Reviewedby omitnull.Val[string] `db:"reviewedby" `
|
||||
Revieweddate omitnull.Val[int64] `db:"revieweddate" `
|
||||
Scheduled omitnull.Val[int16] `db:"scheduled" `
|
||||
Scheduleddate omitnull.Val[int64] `db:"scheduleddate" `
|
||||
Source omitnull.Val[string] `db:"source" `
|
||||
SRNumber omitnull.Val[int64] `db:"sr_number" `
|
||||
Status omitnull.Val[string] `db:"status" `
|
||||
Supervisor omitnull.Val[string] `db:"supervisor" `
|
||||
Techclosed omitnull.Val[string] `db:"techclosed" `
|
||||
Validx omitnull.Val[string] `db:"validx" `
|
||||
Validy omitnull.Val[string] `db:"validy" `
|
||||
Xvalue omitnull.Val[string] `db:"xvalue" `
|
||||
Yvalue omitnull.Val[string] `db:"yvalue" `
|
||||
Zone omitnull.Val[string] `db:"zone" `
|
||||
Zone2 omitnull.Val[string] `db:"zone2" `
|
||||
CreatedDate omitnull.Val[int64] `db:"created_date" `
|
||||
CreatedUser omitnull.Val[string] `db:"created_user" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Dog omitnull.Val[int64] `db:"dog" `
|
||||
Spanish omitnull.Val[int64] `db:"spanish" `
|
||||
ScheduleNotes omitnull.Val[string] `db:"schedule_notes" `
|
||||
SchedulePeriod omitnull.Val[string] `db:"schedule_period" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Accepted omitnull.Val[int16] `db:"accepted" `
|
||||
Acceptedby omitnull.Val[string] `db:"acceptedby" `
|
||||
Accepteddate omitnull.Val[int64] `db:"accepteddate" `
|
||||
Allowed omitnull.Val[string] `db:"allowed" `
|
||||
Assignedtech omitnull.Val[string] `db:"assignedtech" `
|
||||
Clraddr1 omitnull.Val[string] `db:"clraddr1" `
|
||||
Clraddr2 omitnull.Val[string] `db:"clraddr2" `
|
||||
Clranon omitnull.Val[int16] `db:"clranon" `
|
||||
Clrcity omitnull.Val[string] `db:"clrcity" `
|
||||
Clrcompany omitnull.Val[string] `db:"clrcompany" `
|
||||
Clrcontpref omitnull.Val[string] `db:"clrcontpref" `
|
||||
Clremail omitnull.Val[string] `db:"clremail" `
|
||||
Clrfname omitnull.Val[string] `db:"clrfname" `
|
||||
Clrother omitnull.Val[string] `db:"clrother" `
|
||||
Clrphone1 omitnull.Val[string] `db:"clrphone1" `
|
||||
Clrphone2 omitnull.Val[string] `db:"clrphone2" `
|
||||
Clrstate omitnull.Val[string] `db:"clrstate" `
|
||||
Clrzip omitnull.Val[string] `db:"clrzip" `
|
||||
Comments omitnull.Val[string] `db:"comments" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Datetimeclosed omitnull.Val[int64] `db:"datetimeclosed" `
|
||||
Duedate omitnull.Val[int64] `db:"duedate" `
|
||||
Entrytech omitnull.Val[string] `db:"entrytech" `
|
||||
Estcompletedate omitnull.Val[int64] `db:"estcompletedate" `
|
||||
Externalerror omitnull.Val[string] `db:"externalerror" `
|
||||
Externalid omitnull.Val[string] `db:"externalid" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
Editor omitnull.Val[string] `db:"editor" `
|
||||
Firstresponsedate omitnull.Val[int64] `db:"firstresponsedate" `
|
||||
Globalid omitnull.Val[string] `db:"globalid" `
|
||||
Issuesreported omitnull.Val[string] `db:"issuesreported" `
|
||||
Jurisdiction omitnull.Val[string] `db:"jurisdiction" `
|
||||
Nextaction omitnull.Val[string] `db:"nextaction" `
|
||||
Notificationtimestamp omitnull.Val[string] `db:"notificationtimestamp" `
|
||||
Notified omitnull.Val[int16] `db:"notified" `
|
||||
Notifieddate omitnull.Val[int64] `db:"notifieddate" `
|
||||
Objectid omit.Val[int32] `db:"objectid,pk" `
|
||||
Pointlocid omitnull.Val[string] `db:"pointlocid" `
|
||||
Priority omitnull.Val[string] `db:"priority" `
|
||||
Recdatetime omitnull.Val[int64] `db:"recdatetime" `
|
||||
Recordstatus omitnull.Val[int16] `db:"recordstatus" `
|
||||
Rejectedby omitnull.Val[string] `db:"rejectedby" `
|
||||
Rejecteddate omitnull.Val[int64] `db:"rejecteddate" `
|
||||
Rejectedreason omitnull.Val[string] `db:"rejectedreason" `
|
||||
Reqaddr1 omitnull.Val[string] `db:"reqaddr1" `
|
||||
Reqaddr2 omitnull.Val[string] `db:"reqaddr2" `
|
||||
Reqcity omitnull.Val[string] `db:"reqcity" `
|
||||
Reqcompany omitnull.Val[string] `db:"reqcompany" `
|
||||
Reqcrossst omitnull.Val[string] `db:"reqcrossst" `
|
||||
Reqdescr omitnull.Val[string] `db:"reqdescr" `
|
||||
Reqfldnotes omitnull.Val[string] `db:"reqfldnotes" `
|
||||
Reqmapgrid omitnull.Val[string] `db:"reqmapgrid" `
|
||||
Reqnotesforcust omitnull.Val[string] `db:"reqnotesforcust" `
|
||||
Reqnotesfortech omitnull.Val[string] `db:"reqnotesfortech" `
|
||||
Reqpermission omitnull.Val[int16] `db:"reqpermission" `
|
||||
Reqprogramactions omitnull.Val[string] `db:"reqprogramactions" `
|
||||
Reqstate omitnull.Val[string] `db:"reqstate" `
|
||||
Reqsubdiv omitnull.Val[string] `db:"reqsubdiv" `
|
||||
Reqtarget omitnull.Val[string] `db:"reqtarget" `
|
||||
Reqzip omitnull.Val[string] `db:"reqzip" `
|
||||
Responsedaycount omitnull.Val[int16] `db:"responsedaycount" `
|
||||
Reviewed omitnull.Val[int16] `db:"reviewed" `
|
||||
Reviewedby omitnull.Val[string] `db:"reviewedby" `
|
||||
Revieweddate omitnull.Val[int64] `db:"revieweddate" `
|
||||
Scheduled omitnull.Val[int16] `db:"scheduled" `
|
||||
Scheduleddate omitnull.Val[int64] `db:"scheduleddate" `
|
||||
Source omitnull.Val[string] `db:"source" `
|
||||
SRNumber omitnull.Val[int64] `db:"sr_number" `
|
||||
Status omitnull.Val[string] `db:"status" `
|
||||
Supervisor omitnull.Val[string] `db:"supervisor" `
|
||||
Techclosed omitnull.Val[string] `db:"techclosed" `
|
||||
Validx omitnull.Val[string] `db:"validx" `
|
||||
Validy omitnull.Val[string] `db:"validy" `
|
||||
Xvalue omitnull.Val[string] `db:"xvalue" `
|
||||
Yvalue omitnull.Val[string] `db:"yvalue" `
|
||||
Zone omitnull.Val[string] `db:"zone" `
|
||||
Zone2 omitnull.Val[string] `db:"zone2" `
|
||||
Created omitnull.Val[time.Time] `db:"created" `
|
||||
CreatedDate omitnull.Val[int64] `db:"created_date" `
|
||||
CreatedUser omitnull.Val[string] `db:"created_user" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Dog omitnull.Val[int64] `db:"dog" `
|
||||
Spanish omitnull.Val[int64] `db:"spanish" `
|
||||
ScheduleNotes omitnull.Val[string] `db:"schedule_notes" `
|
||||
SchedulePeriod omitnull.Val[string] `db:"schedule_period" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
}
|
||||
|
||||
func (s HistoryServicerequestSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 90)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals := make([]string, 0, 91)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Accepted.IsUnset() {
|
||||
|
|
@ -671,6 +676,9 @@ func (s HistoryServicerequestSetter) SetColumns() []string {
|
|||
if !s.Zone2.IsUnset() {
|
||||
vals = append(vals, "zone2")
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
vals = append(vals, "created")
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals = append(vals, "created_date")
|
||||
}
|
||||
|
|
@ -708,8 +716,8 @@ func (s HistoryServicerequestSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s HistoryServicerequestSetter) Overwrite(t *HistoryServicerequest) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Accepted.IsUnset() {
|
||||
t.Accepted = s.Accepted.MustGetNull()
|
||||
|
|
@ -945,6 +953,9 @@ func (s HistoryServicerequestSetter) Overwrite(t *HistoryServicerequest) {
|
|||
if !s.Zone2.IsUnset() {
|
||||
t.Zone2 = s.Zone2.MustGetNull()
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
t.Created = s.Created.MustGetNull()
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
t.CreatedDate = s.CreatedDate.MustGetNull()
|
||||
}
|
||||
|
|
@ -986,9 +997,9 @@ func (s *HistoryServicerequestSetter) Apply(q *dialect.InsertQuery) {
|
|||
})
|
||||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 90)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
vals := make([]bob.Expression, 91)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -1461,72 +1472,78 @@ func (s *HistoryServicerequestSetter) Apply(q *dialect.InsertQuery) {
|
|||
vals[78] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[79] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
if !s.Created.IsUnset() {
|
||||
vals[79] = psql.Arg(s.Created.MustGetNull())
|
||||
} else {
|
||||
vals[79] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[80] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[80] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
} else {
|
||||
vals[80] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[81] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[81] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
} else {
|
||||
vals[81] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[82] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[82] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
} else {
|
||||
vals[82] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[83] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[83] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
} else {
|
||||
vals[83] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[84] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[84] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
} else {
|
||||
vals[84] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.Dog.IsUnset() {
|
||||
vals[85] = psql.Arg(s.Dog.MustGetNull())
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[85] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
} else {
|
||||
vals[85] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.Spanish.IsUnset() {
|
||||
vals[86] = psql.Arg(s.Spanish.MustGetNull())
|
||||
if !s.Dog.IsUnset() {
|
||||
vals[86] = psql.Arg(s.Dog.MustGetNull())
|
||||
} else {
|
||||
vals[86] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.ScheduleNotes.IsUnset() {
|
||||
vals[87] = psql.Arg(s.ScheduleNotes.MustGetNull())
|
||||
if !s.Spanish.IsUnset() {
|
||||
vals[87] = psql.Arg(s.Spanish.MustGetNull())
|
||||
} else {
|
||||
vals[87] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.SchedulePeriod.IsUnset() {
|
||||
vals[88] = psql.Arg(s.SchedulePeriod.MustGetNull())
|
||||
if !s.ScheduleNotes.IsUnset() {
|
||||
vals[88] = psql.Arg(s.ScheduleNotes.MustGetNull())
|
||||
} else {
|
||||
vals[88] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[89] = psql.Arg(s.Version.MustGet())
|
||||
if !s.SchedulePeriod.IsUnset() {
|
||||
vals[89] = psql.Arg(s.SchedulePeriod.MustGetNull())
|
||||
} else {
|
||||
vals[89] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[90] = psql.Arg(s.Version.MustGet())
|
||||
} else {
|
||||
vals[90] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
return bob.ExpressSlice(ctx, w, d, start, vals, "", ", ", "")
|
||||
}))
|
||||
}
|
||||
|
|
@ -1536,9 +1553,9 @@ func (s HistoryServicerequestSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery] {
|
|||
}
|
||||
|
||||
func (s HistoryServicerequestSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 90)
|
||||
exprs := make([]bob.Expression, 0, 91)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -2091,6 +2108,13 @@ func (s HistoryServicerequestSetter) Expressions(prefix ...string) []bob.Express
|
|||
}})
|
||||
}
|
||||
|
||||
if !s.Created.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created")...),
|
||||
psql.Arg(s.Created),
|
||||
}})
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created_date")...),
|
||||
|
|
@ -2412,7 +2436,7 @@ func (o *HistoryServicerequest) Organization(mods ...bob.Mod[*dialect.SelectQuer
|
|||
}
|
||||
|
||||
func (os HistoryServicerequestSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -2430,7 +2454,7 @@ func (os HistoryServicerequestSlice) Organization(mods ...bob.Mod[*dialect.Selec
|
|||
|
||||
func attachHistoryServicerequestOrganization0(ctx context.Context, exec bob.Executor, count int, historyServicerequest0 *HistoryServicerequest, organization1 *Organization) (*HistoryServicerequest, error) {
|
||||
setter := &HistoryServicerequestSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := historyServicerequest0.Update(ctx, exec, setter)
|
||||
|
|
@ -2477,7 +2501,7 @@ func (historyServicerequest0 *HistoryServicerequest) AttachOrganization(ctx cont
|
|||
}
|
||||
|
||||
type historyServicerequestWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Accepted psql.WhereNullMod[Q, int16]
|
||||
Acceptedby psql.WhereNullMod[Q, string]
|
||||
Accepteddate psql.WhereNullMod[Q, int64]
|
||||
|
|
@ -2556,6 +2580,7 @@ type historyServicerequestWhere[Q psql.Filterable] struct {
|
|||
Yvalue psql.WhereNullMod[Q, string]
|
||||
Zone psql.WhereNullMod[Q, string]
|
||||
Zone2 psql.WhereNullMod[Q, string]
|
||||
Created psql.WhereNullMod[Q, time.Time]
|
||||
CreatedDate psql.WhereNullMod[Q, int64]
|
||||
CreatedUser psql.WhereNullMod[Q, string]
|
||||
GeometryX psql.WhereNullMod[Q, float64]
|
||||
|
|
@ -2575,7 +2600,7 @@ func (historyServicerequestWhere[Q]) AliasedAs(alias string) historyServicereque
|
|||
|
||||
func buildHistoryServicerequestWhere[Q psql.Filterable](cols historyServicerequestColumns) historyServicerequestWhere[Q] {
|
||||
return historyServicerequestWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Accepted: psql.WhereNull[Q, int16](cols.Accepted),
|
||||
Acceptedby: psql.WhereNull[Q, string](cols.Acceptedby),
|
||||
Accepteddate: psql.WhereNull[Q, int64](cols.Accepteddate),
|
||||
|
|
@ -2654,6 +2679,7 @@ func buildHistoryServicerequestWhere[Q psql.Filterable](cols historyServicereque
|
|||
Yvalue: psql.WhereNull[Q, string](cols.Yvalue),
|
||||
Zone: psql.WhereNull[Q, string](cols.Zone),
|
||||
Zone2: psql.WhereNull[Q, string](cols.Zone2),
|
||||
Created: psql.WhereNull[Q, time.Time](cols.Created),
|
||||
CreatedDate: psql.WhereNull[Q, int64](cols.CreatedDate),
|
||||
CreatedUser: psql.WhereNull[Q, string](cols.CreatedUser),
|
||||
GeometryX: psql.WhereNull[Q, float64](cols.GeometryX),
|
||||
|
|
@ -2769,11 +2795,8 @@ func (os HistoryServicerequestSlice) LoadOrganization(ctx context.Context, exec
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"time"
|
||||
|
||||
"github.com/aarondl/opt/null"
|
||||
"github.com/aarondl/opt/omit"
|
||||
|
|
@ -25,39 +26,40 @@ import (
|
|||
|
||||
// HistorySpeciesabundance is an object representing the database table.
|
||||
type HistorySpeciesabundance struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
Bloodedfem null.Val[int16] `db:"bloodedfem" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Eggs null.Val[int16] `db:"eggs" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
Editor null.Val[string] `db:"editor" `
|
||||
Females null.Val[int64] `db:"females" `
|
||||
Gravidfem null.Val[int16] `db:"gravidfem" `
|
||||
Globalid null.Val[string] `db:"globalid" `
|
||||
Larvae null.Val[int16] `db:"larvae" `
|
||||
Males null.Val[int16] `db:"males" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
Poolstogen null.Val[int16] `db:"poolstogen" `
|
||||
Processed null.Val[int16] `db:"processed" `
|
||||
Pupae null.Val[int16] `db:"pupae" `
|
||||
Species null.Val[string] `db:"species" `
|
||||
Total null.Val[int64] `db:"total" `
|
||||
TrapdataID null.Val[string] `db:"trapdata_id" `
|
||||
Unknown null.Val[int16] `db:"unknown" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Globalzscore null.Val[float64] `db:"globalzscore" `
|
||||
H3R7 null.Val[string] `db:"h3r7" `
|
||||
H3R8 null.Val[string] `db:"h3r8" `
|
||||
R7score null.Val[float64] `db:"r7score" `
|
||||
R8score null.Val[float64] `db:"r8score" `
|
||||
Yearweek null.Val[int64] `db:"yearweek" `
|
||||
Version int32 `db:"version,pk" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Bloodedfem null.Val[int16] `db:"bloodedfem" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Eggs null.Val[int16] `db:"eggs" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
Editor null.Val[string] `db:"editor" `
|
||||
Females null.Val[int64] `db:"females" `
|
||||
Gravidfem null.Val[int16] `db:"gravidfem" `
|
||||
Globalid null.Val[string] `db:"globalid" `
|
||||
Larvae null.Val[int16] `db:"larvae" `
|
||||
Males null.Val[int16] `db:"males" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
Poolstogen null.Val[int16] `db:"poolstogen" `
|
||||
Processed null.Val[int16] `db:"processed" `
|
||||
Pupae null.Val[int16] `db:"pupae" `
|
||||
Species null.Val[string] `db:"species" `
|
||||
Total null.Val[int64] `db:"total" `
|
||||
TrapdataID null.Val[string] `db:"trapdata_id" `
|
||||
Unknown null.Val[int16] `db:"unknown" `
|
||||
Created null.Val[time.Time] `db:"created" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Globalzscore null.Val[float64] `db:"globalzscore" `
|
||||
H3R7 null.Val[string] `db:"h3r7" `
|
||||
H3R8 null.Val[string] `db:"h3r8" `
|
||||
R7score null.Val[float64] `db:"r7score" `
|
||||
R8score null.Val[float64] `db:"r8score" `
|
||||
Yearweek null.Val[int64] `db:"yearweek" `
|
||||
Version int32 `db:"version,pk" `
|
||||
|
||||
R historySpeciesabundanceR `db:"-" `
|
||||
}
|
||||
|
|
@ -80,7 +82,7 @@ type historySpeciesabundanceR struct {
|
|||
func buildHistorySpeciesabundanceColumns(alias string) historySpeciesabundanceColumns {
|
||||
return historySpeciesabundanceColumns{
|
||||
ColumnsExpr: expr.NewColumnsExpr(
|
||||
"organization_id", "bloodedfem", "creationdate", "creator", "eggs", "editdate", "editor", "females", "gravidfem", "globalid", "larvae", "males", "objectid", "poolstogen", "processed", "pupae", "species", "total", "trapdata_id", "unknown", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "globalzscore", "h3r7", "h3r8", "r7score", "r8score", "yearweek", "version",
|
||||
"organization_id", "bloodedfem", "creationdate", "creator", "eggs", "editdate", "editor", "females", "gravidfem", "globalid", "larvae", "males", "objectid", "poolstogen", "processed", "pupae", "species", "total", "trapdata_id", "unknown", "created", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "globalzscore", "h3r7", "h3r8", "r7score", "r8score", "yearweek", "version",
|
||||
).WithParent("history_speciesabundance"),
|
||||
tableAlias: alias,
|
||||
OrganizationID: psql.Quote(alias, "organization_id"),
|
||||
|
|
@ -103,6 +105,7 @@ func buildHistorySpeciesabundanceColumns(alias string) historySpeciesabundanceCo
|
|||
Total: psql.Quote(alias, "total"),
|
||||
TrapdataID: psql.Quote(alias, "trapdata_id"),
|
||||
Unknown: psql.Quote(alias, "unknown"),
|
||||
Created: psql.Quote(alias, "created"),
|
||||
CreatedDate: psql.Quote(alias, "created_date"),
|
||||
CreatedUser: psql.Quote(alias, "created_user"),
|
||||
GeometryX: psql.Quote(alias, "geometry_x"),
|
||||
|
|
@ -142,6 +145,7 @@ type historySpeciesabundanceColumns struct {
|
|||
Total psql.Expression
|
||||
TrapdataID psql.Expression
|
||||
Unknown psql.Expression
|
||||
Created psql.Expression
|
||||
CreatedDate psql.Expression
|
||||
CreatedUser psql.Expression
|
||||
GeometryX psql.Expression
|
||||
|
|
@ -169,44 +173,45 @@ func (historySpeciesabundanceColumns) AliasedAs(alias string) historySpeciesabun
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type HistorySpeciesabundanceSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
Bloodedfem omitnull.Val[int16] `db:"bloodedfem" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Eggs omitnull.Val[int16] `db:"eggs" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
Editor omitnull.Val[string] `db:"editor" `
|
||||
Females omitnull.Val[int64] `db:"females" `
|
||||
Gravidfem omitnull.Val[int16] `db:"gravidfem" `
|
||||
Globalid omitnull.Val[string] `db:"globalid" `
|
||||
Larvae omitnull.Val[int16] `db:"larvae" `
|
||||
Males omitnull.Val[int16] `db:"males" `
|
||||
Objectid omit.Val[int32] `db:"objectid,pk" `
|
||||
Poolstogen omitnull.Val[int16] `db:"poolstogen" `
|
||||
Processed omitnull.Val[int16] `db:"processed" `
|
||||
Pupae omitnull.Val[int16] `db:"pupae" `
|
||||
Species omitnull.Val[string] `db:"species" `
|
||||
Total omitnull.Val[int64] `db:"total" `
|
||||
TrapdataID omitnull.Val[string] `db:"trapdata_id" `
|
||||
Unknown omitnull.Val[int16] `db:"unknown" `
|
||||
CreatedDate omitnull.Val[int64] `db:"created_date" `
|
||||
CreatedUser omitnull.Val[string] `db:"created_user" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Globalzscore omitnull.Val[float64] `db:"globalzscore" `
|
||||
H3R7 omitnull.Val[string] `db:"h3r7" `
|
||||
H3R8 omitnull.Val[string] `db:"h3r8" `
|
||||
R7score omitnull.Val[float64] `db:"r7score" `
|
||||
R8score omitnull.Val[float64] `db:"r8score" `
|
||||
Yearweek omitnull.Val[int64] `db:"yearweek" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Bloodedfem omitnull.Val[int16] `db:"bloodedfem" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Eggs omitnull.Val[int16] `db:"eggs" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
Editor omitnull.Val[string] `db:"editor" `
|
||||
Females omitnull.Val[int64] `db:"females" `
|
||||
Gravidfem omitnull.Val[int16] `db:"gravidfem" `
|
||||
Globalid omitnull.Val[string] `db:"globalid" `
|
||||
Larvae omitnull.Val[int16] `db:"larvae" `
|
||||
Males omitnull.Val[int16] `db:"males" `
|
||||
Objectid omit.Val[int32] `db:"objectid,pk" `
|
||||
Poolstogen omitnull.Val[int16] `db:"poolstogen" `
|
||||
Processed omitnull.Val[int16] `db:"processed" `
|
||||
Pupae omitnull.Val[int16] `db:"pupae" `
|
||||
Species omitnull.Val[string] `db:"species" `
|
||||
Total omitnull.Val[int64] `db:"total" `
|
||||
TrapdataID omitnull.Val[string] `db:"trapdata_id" `
|
||||
Unknown omitnull.Val[int16] `db:"unknown" `
|
||||
Created omitnull.Val[time.Time] `db:"created" `
|
||||
CreatedDate omitnull.Val[int64] `db:"created_date" `
|
||||
CreatedUser omitnull.Val[string] `db:"created_user" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Globalzscore omitnull.Val[float64] `db:"globalzscore" `
|
||||
H3R7 omitnull.Val[string] `db:"h3r7" `
|
||||
H3R8 omitnull.Val[string] `db:"h3r8" `
|
||||
R7score omitnull.Val[float64] `db:"r7score" `
|
||||
R8score omitnull.Val[float64] `db:"r8score" `
|
||||
Yearweek omitnull.Val[int64] `db:"yearweek" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
}
|
||||
|
||||
func (s HistorySpeciesabundanceSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 33)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals := make([]string, 0, 34)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Bloodedfem.IsUnset() {
|
||||
|
|
@ -266,6 +271,9 @@ func (s HistorySpeciesabundanceSetter) SetColumns() []string {
|
|||
if !s.Unknown.IsUnset() {
|
||||
vals = append(vals, "unknown")
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
vals = append(vals, "created")
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals = append(vals, "created_date")
|
||||
}
|
||||
|
|
@ -309,8 +317,8 @@ func (s HistorySpeciesabundanceSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s HistorySpeciesabundanceSetter) Overwrite(t *HistorySpeciesabundance) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Bloodedfem.IsUnset() {
|
||||
t.Bloodedfem = s.Bloodedfem.MustGetNull()
|
||||
|
|
@ -369,6 +377,9 @@ func (s HistorySpeciesabundanceSetter) Overwrite(t *HistorySpeciesabundance) {
|
|||
if !s.Unknown.IsUnset() {
|
||||
t.Unknown = s.Unknown.MustGetNull()
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
t.Created = s.Created.MustGetNull()
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
t.CreatedDate = s.CreatedDate.MustGetNull()
|
||||
}
|
||||
|
|
@ -416,9 +427,9 @@ func (s *HistorySpeciesabundanceSetter) Apply(q *dialect.InsertQuery) {
|
|||
})
|
||||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 33)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
vals := make([]bob.Expression, 34)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -537,84 +548,90 @@ func (s *HistorySpeciesabundanceSetter) Apply(q *dialect.InsertQuery) {
|
|||
vals[19] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[20] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
if !s.Created.IsUnset() {
|
||||
vals[20] = psql.Arg(s.Created.MustGetNull())
|
||||
} else {
|
||||
vals[20] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[21] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[21] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
} else {
|
||||
vals[21] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[22] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[22] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
} else {
|
||||
vals[22] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[23] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[23] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
} else {
|
||||
vals[23] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[24] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[24] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
} else {
|
||||
vals[24] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[25] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[25] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
} else {
|
||||
vals[25] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.Globalzscore.IsUnset() {
|
||||
vals[26] = psql.Arg(s.Globalzscore.MustGetNull())
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[26] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
} else {
|
||||
vals[26] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.H3R7.IsUnset() {
|
||||
vals[27] = psql.Arg(s.H3R7.MustGetNull())
|
||||
if !s.Globalzscore.IsUnset() {
|
||||
vals[27] = psql.Arg(s.Globalzscore.MustGetNull())
|
||||
} else {
|
||||
vals[27] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.H3R8.IsUnset() {
|
||||
vals[28] = psql.Arg(s.H3R8.MustGetNull())
|
||||
if !s.H3R7.IsUnset() {
|
||||
vals[28] = psql.Arg(s.H3R7.MustGetNull())
|
||||
} else {
|
||||
vals[28] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.R7score.IsUnset() {
|
||||
vals[29] = psql.Arg(s.R7score.MustGetNull())
|
||||
if !s.H3R8.IsUnset() {
|
||||
vals[29] = psql.Arg(s.H3R8.MustGetNull())
|
||||
} else {
|
||||
vals[29] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.R8score.IsUnset() {
|
||||
vals[30] = psql.Arg(s.R8score.MustGetNull())
|
||||
if !s.R7score.IsUnset() {
|
||||
vals[30] = psql.Arg(s.R7score.MustGetNull())
|
||||
} else {
|
||||
vals[30] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.Yearweek.IsUnset() {
|
||||
vals[31] = psql.Arg(s.Yearweek.MustGetNull())
|
||||
if !s.R8score.IsUnset() {
|
||||
vals[31] = psql.Arg(s.R8score.MustGetNull())
|
||||
} else {
|
||||
vals[31] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[32] = psql.Arg(s.Version.MustGet())
|
||||
if !s.Yearweek.IsUnset() {
|
||||
vals[32] = psql.Arg(s.Yearweek.MustGetNull())
|
||||
} else {
|
||||
vals[32] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[33] = psql.Arg(s.Version.MustGet())
|
||||
} else {
|
||||
vals[33] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
return bob.ExpressSlice(ctx, w, d, start, vals, "", ", ", "")
|
||||
}))
|
||||
}
|
||||
|
|
@ -624,9 +641,9 @@ func (s HistorySpeciesabundanceSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery]
|
|||
}
|
||||
|
||||
func (s HistorySpeciesabundanceSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 33)
|
||||
exprs := make([]bob.Expression, 0, 34)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -766,6 +783,13 @@ func (s HistorySpeciesabundanceSetter) Expressions(prefix ...string) []bob.Expre
|
|||
}})
|
||||
}
|
||||
|
||||
if !s.Created.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created")...),
|
||||
psql.Arg(s.Created),
|
||||
}})
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created_date")...),
|
||||
|
|
@ -1101,7 +1125,7 @@ func (o *HistorySpeciesabundance) Organization(mods ...bob.Mod[*dialect.SelectQu
|
|||
}
|
||||
|
||||
func (os HistorySpeciesabundanceSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -1119,7 +1143,7 @@ func (os HistorySpeciesabundanceSlice) Organization(mods ...bob.Mod[*dialect.Sel
|
|||
|
||||
func attachHistorySpeciesabundanceOrganization0(ctx context.Context, exec bob.Executor, count int, historySpeciesabundance0 *HistorySpeciesabundance, organization1 *Organization) (*HistorySpeciesabundance, error) {
|
||||
setter := &HistorySpeciesabundanceSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := historySpeciesabundance0.Update(ctx, exec, setter)
|
||||
|
|
@ -1166,7 +1190,7 @@ func (historySpeciesabundance0 *HistorySpeciesabundance) AttachOrganization(ctx
|
|||
}
|
||||
|
||||
type historySpeciesabundanceWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Bloodedfem psql.WhereNullMod[Q, int16]
|
||||
Creationdate psql.WhereNullMod[Q, int64]
|
||||
Creator psql.WhereNullMod[Q, string]
|
||||
|
|
@ -1186,6 +1210,7 @@ type historySpeciesabundanceWhere[Q psql.Filterable] struct {
|
|||
Total psql.WhereNullMod[Q, int64]
|
||||
TrapdataID psql.WhereNullMod[Q, string]
|
||||
Unknown psql.WhereNullMod[Q, int16]
|
||||
Created psql.WhereNullMod[Q, time.Time]
|
||||
CreatedDate psql.WhereNullMod[Q, int64]
|
||||
CreatedUser psql.WhereNullMod[Q, string]
|
||||
GeometryX psql.WhereNullMod[Q, float64]
|
||||
|
|
@ -1207,7 +1232,7 @@ func (historySpeciesabundanceWhere[Q]) AliasedAs(alias string) historySpeciesabu
|
|||
|
||||
func buildHistorySpeciesabundanceWhere[Q psql.Filterable](cols historySpeciesabundanceColumns) historySpeciesabundanceWhere[Q] {
|
||||
return historySpeciesabundanceWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Bloodedfem: psql.WhereNull[Q, int16](cols.Bloodedfem),
|
||||
Creationdate: psql.WhereNull[Q, int64](cols.Creationdate),
|
||||
Creator: psql.WhereNull[Q, string](cols.Creator),
|
||||
|
|
@ -1227,6 +1252,7 @@ func buildHistorySpeciesabundanceWhere[Q psql.Filterable](cols historySpeciesabu
|
|||
Total: psql.WhereNull[Q, int64](cols.Total),
|
||||
TrapdataID: psql.WhereNull[Q, string](cols.TrapdataID),
|
||||
Unknown: psql.WhereNull[Q, int16](cols.Unknown),
|
||||
Created: psql.WhereNull[Q, time.Time](cols.Created),
|
||||
CreatedDate: psql.WhereNull[Q, int64](cols.CreatedDate),
|
||||
CreatedUser: psql.WhereNull[Q, string](cols.CreatedUser),
|
||||
GeometryX: psql.WhereNull[Q, float64](cols.GeometryX),
|
||||
|
|
@ -1344,11 +1370,8 @@ func (os HistorySpeciesabundanceSlice) LoadOrganization(ctx context.Context, exe
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"time"
|
||||
|
||||
"github.com/aarondl/opt/null"
|
||||
"github.com/aarondl/opt/omit"
|
||||
|
|
@ -25,29 +26,30 @@ import (
|
|||
|
||||
// HistoryStormdrain is an object representing the database table.
|
||||
type HistoryStormdrain struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
Editor null.Val[string] `db:"editor" `
|
||||
Globalid null.Val[string] `db:"globalid" `
|
||||
Jurisdiction null.Val[string] `db:"jurisdiction" `
|
||||
Lastaction null.Val[string] `db:"lastaction" `
|
||||
Laststatus null.Val[string] `db:"laststatus" `
|
||||
Lasttreatdate null.Val[int64] `db:"lasttreatdate" `
|
||||
Nexttreatmentdate null.Val[int64] `db:"nexttreatmentdate" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
Symbology null.Val[string] `db:"symbology" `
|
||||
Type null.Val[string] `db:"type" `
|
||||
Zone null.Val[string] `db:"zone" `
|
||||
Zone2 null.Val[string] `db:"zone2" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Version int32 `db:"version,pk" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
Editor null.Val[string] `db:"editor" `
|
||||
Globalid null.Val[string] `db:"globalid" `
|
||||
Jurisdiction null.Val[string] `db:"jurisdiction" `
|
||||
Lastaction null.Val[string] `db:"lastaction" `
|
||||
Laststatus null.Val[string] `db:"laststatus" `
|
||||
Lasttreatdate null.Val[int64] `db:"lasttreatdate" `
|
||||
Nexttreatmentdate null.Val[int64] `db:"nexttreatmentdate" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
Symbology null.Val[string] `db:"symbology" `
|
||||
Type null.Val[string] `db:"type" `
|
||||
Zone null.Val[string] `db:"zone" `
|
||||
Zone2 null.Val[string] `db:"zone2" `
|
||||
Created null.Val[time.Time] `db:"created" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Version int32 `db:"version,pk" `
|
||||
|
||||
R historyStormdrainR `db:"-" `
|
||||
}
|
||||
|
|
@ -70,7 +72,7 @@ type historyStormdrainR struct {
|
|||
func buildHistoryStormdrainColumns(alias string) historyStormdrainColumns {
|
||||
return historyStormdrainColumns{
|
||||
ColumnsExpr: expr.NewColumnsExpr(
|
||||
"organization_id", "creationdate", "creator", "editdate", "editor", "globalid", "jurisdiction", "lastaction", "laststatus", "lasttreatdate", "nexttreatmentdate", "objectid", "symbology", "type", "zone", "zone2", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "version",
|
||||
"organization_id", "creationdate", "creator", "editdate", "editor", "globalid", "jurisdiction", "lastaction", "laststatus", "lasttreatdate", "nexttreatmentdate", "objectid", "symbology", "type", "zone", "zone2", "created", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "version",
|
||||
).WithParent("history_stormdrain"),
|
||||
tableAlias: alias,
|
||||
OrganizationID: psql.Quote(alias, "organization_id"),
|
||||
|
|
@ -89,6 +91,7 @@ func buildHistoryStormdrainColumns(alias string) historyStormdrainColumns {
|
|||
Type: psql.Quote(alias, "type"),
|
||||
Zone: psql.Quote(alias, "zone"),
|
||||
Zone2: psql.Quote(alias, "zone2"),
|
||||
Created: psql.Quote(alias, "created"),
|
||||
CreatedDate: psql.Quote(alias, "created_date"),
|
||||
CreatedUser: psql.Quote(alias, "created_user"),
|
||||
GeometryX: psql.Quote(alias, "geometry_x"),
|
||||
|
|
@ -118,6 +121,7 @@ type historyStormdrainColumns struct {
|
|||
Type psql.Expression
|
||||
Zone psql.Expression
|
||||
Zone2 psql.Expression
|
||||
Created psql.Expression
|
||||
CreatedDate psql.Expression
|
||||
CreatedUser psql.Expression
|
||||
GeometryX psql.Expression
|
||||
|
|
@ -139,34 +143,35 @@ func (historyStormdrainColumns) AliasedAs(alias string) historyStormdrainColumns
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type HistoryStormdrainSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
Editor omitnull.Val[string] `db:"editor" `
|
||||
Globalid omitnull.Val[string] `db:"globalid" `
|
||||
Jurisdiction omitnull.Val[string] `db:"jurisdiction" `
|
||||
Lastaction omitnull.Val[string] `db:"lastaction" `
|
||||
Laststatus omitnull.Val[string] `db:"laststatus" `
|
||||
Lasttreatdate omitnull.Val[int64] `db:"lasttreatdate" `
|
||||
Nexttreatmentdate omitnull.Val[int64] `db:"nexttreatmentdate" `
|
||||
Objectid omit.Val[int32] `db:"objectid,pk" `
|
||||
Symbology omitnull.Val[string] `db:"symbology" `
|
||||
Type omitnull.Val[string] `db:"type" `
|
||||
Zone omitnull.Val[string] `db:"zone" `
|
||||
Zone2 omitnull.Val[string] `db:"zone2" `
|
||||
CreatedDate omitnull.Val[int64] `db:"created_date" `
|
||||
CreatedUser omitnull.Val[string] `db:"created_user" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
Editor omitnull.Val[string] `db:"editor" `
|
||||
Globalid omitnull.Val[string] `db:"globalid" `
|
||||
Jurisdiction omitnull.Val[string] `db:"jurisdiction" `
|
||||
Lastaction omitnull.Val[string] `db:"lastaction" `
|
||||
Laststatus omitnull.Val[string] `db:"laststatus" `
|
||||
Lasttreatdate omitnull.Val[int64] `db:"lasttreatdate" `
|
||||
Nexttreatmentdate omitnull.Val[int64] `db:"nexttreatmentdate" `
|
||||
Objectid omit.Val[int32] `db:"objectid,pk" `
|
||||
Symbology omitnull.Val[string] `db:"symbology" `
|
||||
Type omitnull.Val[string] `db:"type" `
|
||||
Zone omitnull.Val[string] `db:"zone" `
|
||||
Zone2 omitnull.Val[string] `db:"zone2" `
|
||||
Created omitnull.Val[time.Time] `db:"created" `
|
||||
CreatedDate omitnull.Val[int64] `db:"created_date" `
|
||||
CreatedUser omitnull.Val[string] `db:"created_user" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
}
|
||||
|
||||
func (s HistoryStormdrainSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 23)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals := make([]string, 0, 24)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Creationdate.IsUnset() {
|
||||
|
|
@ -214,6 +219,9 @@ func (s HistoryStormdrainSetter) SetColumns() []string {
|
|||
if !s.Zone2.IsUnset() {
|
||||
vals = append(vals, "zone2")
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
vals = append(vals, "created")
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals = append(vals, "created_date")
|
||||
}
|
||||
|
|
@ -239,8 +247,8 @@ func (s HistoryStormdrainSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s HistoryStormdrainSetter) Overwrite(t *HistoryStormdrain) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Creationdate.IsUnset() {
|
||||
t.Creationdate = s.Creationdate.MustGetNull()
|
||||
|
|
@ -287,6 +295,9 @@ func (s HistoryStormdrainSetter) Overwrite(t *HistoryStormdrain) {
|
|||
if !s.Zone2.IsUnset() {
|
||||
t.Zone2 = s.Zone2.MustGetNull()
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
t.Created = s.Created.MustGetNull()
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
t.CreatedDate = s.CreatedDate.MustGetNull()
|
||||
}
|
||||
|
|
@ -316,9 +327,9 @@ func (s *HistoryStormdrainSetter) Apply(q *dialect.InsertQuery) {
|
|||
})
|
||||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 23)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
vals := make([]bob.Expression, 24)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -413,48 +424,54 @@ func (s *HistoryStormdrainSetter) Apply(q *dialect.InsertQuery) {
|
|||
vals[15] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[16] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
if !s.Created.IsUnset() {
|
||||
vals[16] = psql.Arg(s.Created.MustGetNull())
|
||||
} else {
|
||||
vals[16] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[17] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[17] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
} else {
|
||||
vals[17] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[18] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[18] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
} else {
|
||||
vals[18] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[19] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[19] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
} else {
|
||||
vals[19] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[20] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[20] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
} else {
|
||||
vals[20] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[21] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[21] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
} else {
|
||||
vals[21] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[22] = psql.Arg(s.Version.MustGet())
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[22] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
} else {
|
||||
vals[22] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[23] = psql.Arg(s.Version.MustGet())
|
||||
} else {
|
||||
vals[23] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
return bob.ExpressSlice(ctx, w, d, start, vals, "", ", ", "")
|
||||
}))
|
||||
}
|
||||
|
|
@ -464,9 +481,9 @@ func (s HistoryStormdrainSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery] {
|
|||
}
|
||||
|
||||
func (s HistoryStormdrainSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 23)
|
||||
exprs := make([]bob.Expression, 0, 24)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -578,6 +595,13 @@ func (s HistoryStormdrainSetter) Expressions(prefix ...string) []bob.Expression
|
|||
}})
|
||||
}
|
||||
|
||||
if !s.Created.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created")...),
|
||||
psql.Arg(s.Created),
|
||||
}})
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created_date")...),
|
||||
|
|
@ -871,7 +895,7 @@ func (o *HistoryStormdrain) Organization(mods ...bob.Mod[*dialect.SelectQuery])
|
|||
}
|
||||
|
||||
func (os HistoryStormdrainSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -889,7 +913,7 @@ func (os HistoryStormdrainSlice) Organization(mods ...bob.Mod[*dialect.SelectQue
|
|||
|
||||
func attachHistoryStormdrainOrganization0(ctx context.Context, exec bob.Executor, count int, historyStormdrain0 *HistoryStormdrain, organization1 *Organization) (*HistoryStormdrain, error) {
|
||||
setter := &HistoryStormdrainSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := historyStormdrain0.Update(ctx, exec, setter)
|
||||
|
|
@ -936,7 +960,7 @@ func (historyStormdrain0 *HistoryStormdrain) AttachOrganization(ctx context.Cont
|
|||
}
|
||||
|
||||
type historyStormdrainWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Creationdate psql.WhereNullMod[Q, int64]
|
||||
Creator psql.WhereNullMod[Q, string]
|
||||
Editdate psql.WhereNullMod[Q, int64]
|
||||
|
|
@ -952,6 +976,7 @@ type historyStormdrainWhere[Q psql.Filterable] struct {
|
|||
Type psql.WhereNullMod[Q, string]
|
||||
Zone psql.WhereNullMod[Q, string]
|
||||
Zone2 psql.WhereNullMod[Q, string]
|
||||
Created psql.WhereNullMod[Q, time.Time]
|
||||
CreatedDate psql.WhereNullMod[Q, int64]
|
||||
CreatedUser psql.WhereNullMod[Q, string]
|
||||
GeometryX psql.WhereNullMod[Q, float64]
|
||||
|
|
@ -967,7 +992,7 @@ func (historyStormdrainWhere[Q]) AliasedAs(alias string) historyStormdrainWhere[
|
|||
|
||||
func buildHistoryStormdrainWhere[Q psql.Filterable](cols historyStormdrainColumns) historyStormdrainWhere[Q] {
|
||||
return historyStormdrainWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Creationdate: psql.WhereNull[Q, int64](cols.Creationdate),
|
||||
Creator: psql.WhereNull[Q, string](cols.Creator),
|
||||
Editdate: psql.WhereNull[Q, int64](cols.Editdate),
|
||||
|
|
@ -983,6 +1008,7 @@ func buildHistoryStormdrainWhere[Q psql.Filterable](cols historyStormdrainColumn
|
|||
Type: psql.WhereNull[Q, string](cols.Type),
|
||||
Zone: psql.WhereNull[Q, string](cols.Zone),
|
||||
Zone2: psql.WhereNull[Q, string](cols.Zone2),
|
||||
Created: psql.WhereNull[Q, time.Time](cols.Created),
|
||||
CreatedDate: psql.WhereNull[Q, int64](cols.CreatedDate),
|
||||
CreatedUser: psql.WhereNull[Q, string](cols.CreatedUser),
|
||||
GeometryX: psql.WhereNull[Q, float64](cols.GeometryX),
|
||||
|
|
@ -1094,11 +1120,8 @@ func (os HistoryStormdrainSlice) LoadOrganization(ctx context.Context, exec bob.
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"time"
|
||||
|
||||
"github.com/aarondl/opt/null"
|
||||
"github.com/aarondl/opt/omit"
|
||||
|
|
@ -25,38 +26,39 @@ import (
|
|||
|
||||
// HistoryTimecard is an object representing the database table.
|
||||
type HistoryTimecard struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
Activity null.Val[string] `db:"activity" `
|
||||
Comments null.Val[string] `db:"comments" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Enddatetime null.Val[int64] `db:"enddatetime" `
|
||||
Equiptype null.Val[string] `db:"equiptype" `
|
||||
Externalid null.Val[string] `db:"externalid" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
Editor null.Val[string] `db:"editor" `
|
||||
Fieldtech null.Val[string] `db:"fieldtech" `
|
||||
Globalid null.Val[string] `db:"globalid" `
|
||||
Lclocid null.Val[string] `db:"lclocid" `
|
||||
Linelocid null.Val[string] `db:"linelocid" `
|
||||
Locationname null.Val[string] `db:"locationname" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
Pointlocid null.Val[string] `db:"pointlocid" `
|
||||
Polygonlocid null.Val[string] `db:"polygonlocid" `
|
||||
Samplelocid null.Val[string] `db:"samplelocid" `
|
||||
Srid null.Val[string] `db:"srid" `
|
||||
Startdatetime null.Val[int64] `db:"startdatetime" `
|
||||
Traplocid null.Val[string] `db:"traplocid" `
|
||||
Zone null.Val[string] `db:"zone" `
|
||||
Zone2 null.Val[string] `db:"zone2" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Rodentlocid null.Val[string] `db:"rodentlocid" `
|
||||
Version int32 `db:"version,pk" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Activity null.Val[string] `db:"activity" `
|
||||
Comments null.Val[string] `db:"comments" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Enddatetime null.Val[int64] `db:"enddatetime" `
|
||||
Equiptype null.Val[string] `db:"equiptype" `
|
||||
Externalid null.Val[string] `db:"externalid" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
Editor null.Val[string] `db:"editor" `
|
||||
Fieldtech null.Val[string] `db:"fieldtech" `
|
||||
Globalid null.Val[string] `db:"globalid" `
|
||||
Lclocid null.Val[string] `db:"lclocid" `
|
||||
Linelocid null.Val[string] `db:"linelocid" `
|
||||
Locationname null.Val[string] `db:"locationname" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
Pointlocid null.Val[string] `db:"pointlocid" `
|
||||
Polygonlocid null.Val[string] `db:"polygonlocid" `
|
||||
Samplelocid null.Val[string] `db:"samplelocid" `
|
||||
Srid null.Val[string] `db:"srid" `
|
||||
Startdatetime null.Val[int64] `db:"startdatetime" `
|
||||
Traplocid null.Val[string] `db:"traplocid" `
|
||||
Zone null.Val[string] `db:"zone" `
|
||||
Zone2 null.Val[string] `db:"zone2" `
|
||||
Created null.Val[time.Time] `db:"created" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Rodentlocid null.Val[string] `db:"rodentlocid" `
|
||||
Version int32 `db:"version,pk" `
|
||||
|
||||
R historyTimecardR `db:"-" `
|
||||
}
|
||||
|
|
@ -79,7 +81,7 @@ type historyTimecardR struct {
|
|||
func buildHistoryTimecardColumns(alias string) historyTimecardColumns {
|
||||
return historyTimecardColumns{
|
||||
ColumnsExpr: expr.NewColumnsExpr(
|
||||
"organization_id", "activity", "comments", "creationdate", "creator", "enddatetime", "equiptype", "externalid", "editdate", "editor", "fieldtech", "globalid", "lclocid", "linelocid", "locationname", "objectid", "pointlocid", "polygonlocid", "samplelocid", "srid", "startdatetime", "traplocid", "zone", "zone2", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "rodentlocid", "version",
|
||||
"organization_id", "activity", "comments", "creationdate", "creator", "enddatetime", "equiptype", "externalid", "editdate", "editor", "fieldtech", "globalid", "lclocid", "linelocid", "locationname", "objectid", "pointlocid", "polygonlocid", "samplelocid", "srid", "startdatetime", "traplocid", "zone", "zone2", "created", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "rodentlocid", "version",
|
||||
).WithParent("history_timecard"),
|
||||
tableAlias: alias,
|
||||
OrganizationID: psql.Quote(alias, "organization_id"),
|
||||
|
|
@ -106,6 +108,7 @@ func buildHistoryTimecardColumns(alias string) historyTimecardColumns {
|
|||
Traplocid: psql.Quote(alias, "traplocid"),
|
||||
Zone: psql.Quote(alias, "zone"),
|
||||
Zone2: psql.Quote(alias, "zone2"),
|
||||
Created: psql.Quote(alias, "created"),
|
||||
CreatedDate: psql.Quote(alias, "created_date"),
|
||||
CreatedUser: psql.Quote(alias, "created_user"),
|
||||
GeometryX: psql.Quote(alias, "geometry_x"),
|
||||
|
|
@ -144,6 +147,7 @@ type historyTimecardColumns struct {
|
|||
Traplocid psql.Expression
|
||||
Zone psql.Expression
|
||||
Zone2 psql.Expression
|
||||
Created psql.Expression
|
||||
CreatedDate psql.Expression
|
||||
CreatedUser psql.Expression
|
||||
GeometryX psql.Expression
|
||||
|
|
@ -166,43 +170,44 @@ func (historyTimecardColumns) AliasedAs(alias string) historyTimecardColumns {
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type HistoryTimecardSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
Activity omitnull.Val[string] `db:"activity" `
|
||||
Comments omitnull.Val[string] `db:"comments" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Enddatetime omitnull.Val[int64] `db:"enddatetime" `
|
||||
Equiptype omitnull.Val[string] `db:"equiptype" `
|
||||
Externalid omitnull.Val[string] `db:"externalid" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
Editor omitnull.Val[string] `db:"editor" `
|
||||
Fieldtech omitnull.Val[string] `db:"fieldtech" `
|
||||
Globalid omitnull.Val[string] `db:"globalid" `
|
||||
Lclocid omitnull.Val[string] `db:"lclocid" `
|
||||
Linelocid omitnull.Val[string] `db:"linelocid" `
|
||||
Locationname omitnull.Val[string] `db:"locationname" `
|
||||
Objectid omit.Val[int32] `db:"objectid,pk" `
|
||||
Pointlocid omitnull.Val[string] `db:"pointlocid" `
|
||||
Polygonlocid omitnull.Val[string] `db:"polygonlocid" `
|
||||
Samplelocid omitnull.Val[string] `db:"samplelocid" `
|
||||
Srid omitnull.Val[string] `db:"srid" `
|
||||
Startdatetime omitnull.Val[int64] `db:"startdatetime" `
|
||||
Traplocid omitnull.Val[string] `db:"traplocid" `
|
||||
Zone omitnull.Val[string] `db:"zone" `
|
||||
Zone2 omitnull.Val[string] `db:"zone2" `
|
||||
CreatedDate omitnull.Val[int64] `db:"created_date" `
|
||||
CreatedUser omitnull.Val[string] `db:"created_user" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Rodentlocid omitnull.Val[string] `db:"rodentlocid" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Activity omitnull.Val[string] `db:"activity" `
|
||||
Comments omitnull.Val[string] `db:"comments" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Enddatetime omitnull.Val[int64] `db:"enddatetime" `
|
||||
Equiptype omitnull.Val[string] `db:"equiptype" `
|
||||
Externalid omitnull.Val[string] `db:"externalid" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
Editor omitnull.Val[string] `db:"editor" `
|
||||
Fieldtech omitnull.Val[string] `db:"fieldtech" `
|
||||
Globalid omitnull.Val[string] `db:"globalid" `
|
||||
Lclocid omitnull.Val[string] `db:"lclocid" `
|
||||
Linelocid omitnull.Val[string] `db:"linelocid" `
|
||||
Locationname omitnull.Val[string] `db:"locationname" `
|
||||
Objectid omit.Val[int32] `db:"objectid,pk" `
|
||||
Pointlocid omitnull.Val[string] `db:"pointlocid" `
|
||||
Polygonlocid omitnull.Val[string] `db:"polygonlocid" `
|
||||
Samplelocid omitnull.Val[string] `db:"samplelocid" `
|
||||
Srid omitnull.Val[string] `db:"srid" `
|
||||
Startdatetime omitnull.Val[int64] `db:"startdatetime" `
|
||||
Traplocid omitnull.Val[string] `db:"traplocid" `
|
||||
Zone omitnull.Val[string] `db:"zone" `
|
||||
Zone2 omitnull.Val[string] `db:"zone2" `
|
||||
Created omitnull.Val[time.Time] `db:"created" `
|
||||
CreatedDate omitnull.Val[int64] `db:"created_date" `
|
||||
CreatedUser omitnull.Val[string] `db:"created_user" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Rodentlocid omitnull.Val[string] `db:"rodentlocid" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
}
|
||||
|
||||
func (s HistoryTimecardSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 32)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals := make([]string, 0, 33)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Activity.IsUnset() {
|
||||
|
|
@ -274,6 +279,9 @@ func (s HistoryTimecardSetter) SetColumns() []string {
|
|||
if !s.Zone2.IsUnset() {
|
||||
vals = append(vals, "zone2")
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
vals = append(vals, "created")
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals = append(vals, "created_date")
|
||||
}
|
||||
|
|
@ -302,8 +310,8 @@ func (s HistoryTimecardSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s HistoryTimecardSetter) Overwrite(t *HistoryTimecard) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Activity.IsUnset() {
|
||||
t.Activity = s.Activity.MustGetNull()
|
||||
|
|
@ -374,6 +382,9 @@ func (s HistoryTimecardSetter) Overwrite(t *HistoryTimecard) {
|
|||
if !s.Zone2.IsUnset() {
|
||||
t.Zone2 = s.Zone2.MustGetNull()
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
t.Created = s.Created.MustGetNull()
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
t.CreatedDate = s.CreatedDate.MustGetNull()
|
||||
}
|
||||
|
|
@ -406,9 +417,9 @@ func (s *HistoryTimecardSetter) Apply(q *dialect.InsertQuery) {
|
|||
})
|
||||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 32)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
vals := make([]bob.Expression, 33)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -551,54 +562,60 @@ func (s *HistoryTimecardSetter) Apply(q *dialect.InsertQuery) {
|
|||
vals[23] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[24] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
if !s.Created.IsUnset() {
|
||||
vals[24] = psql.Arg(s.Created.MustGetNull())
|
||||
} else {
|
||||
vals[24] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[25] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[25] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
} else {
|
||||
vals[25] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[26] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[26] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
} else {
|
||||
vals[26] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[27] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[27] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
} else {
|
||||
vals[27] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[28] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[28] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
} else {
|
||||
vals[28] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[29] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[29] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
} else {
|
||||
vals[29] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.Rodentlocid.IsUnset() {
|
||||
vals[30] = psql.Arg(s.Rodentlocid.MustGetNull())
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[30] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
} else {
|
||||
vals[30] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[31] = psql.Arg(s.Version.MustGet())
|
||||
if !s.Rodentlocid.IsUnset() {
|
||||
vals[31] = psql.Arg(s.Rodentlocid.MustGetNull())
|
||||
} else {
|
||||
vals[31] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[32] = psql.Arg(s.Version.MustGet())
|
||||
} else {
|
||||
vals[32] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
return bob.ExpressSlice(ctx, w, d, start, vals, "", ", ", "")
|
||||
}))
|
||||
}
|
||||
|
|
@ -608,9 +625,9 @@ func (s HistoryTimecardSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery] {
|
|||
}
|
||||
|
||||
func (s HistoryTimecardSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 32)
|
||||
exprs := make([]bob.Expression, 0, 33)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -778,6 +795,13 @@ func (s HistoryTimecardSetter) Expressions(prefix ...string) []bob.Expression {
|
|||
}})
|
||||
}
|
||||
|
||||
if !s.Created.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created")...),
|
||||
psql.Arg(s.Created),
|
||||
}})
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created_date")...),
|
||||
|
|
@ -1078,7 +1102,7 @@ func (o *HistoryTimecard) Organization(mods ...bob.Mod[*dialect.SelectQuery]) Or
|
|||
}
|
||||
|
||||
func (os HistoryTimecardSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -1096,7 +1120,7 @@ func (os HistoryTimecardSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery
|
|||
|
||||
func attachHistoryTimecardOrganization0(ctx context.Context, exec bob.Executor, count int, historyTimecard0 *HistoryTimecard, organization1 *Organization) (*HistoryTimecard, error) {
|
||||
setter := &HistoryTimecardSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := historyTimecard0.Update(ctx, exec, setter)
|
||||
|
|
@ -1143,7 +1167,7 @@ func (historyTimecard0 *HistoryTimecard) AttachOrganization(ctx context.Context,
|
|||
}
|
||||
|
||||
type historyTimecardWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Activity psql.WhereNullMod[Q, string]
|
||||
Comments psql.WhereNullMod[Q, string]
|
||||
Creationdate psql.WhereNullMod[Q, int64]
|
||||
|
|
@ -1167,6 +1191,7 @@ type historyTimecardWhere[Q psql.Filterable] struct {
|
|||
Traplocid psql.WhereNullMod[Q, string]
|
||||
Zone psql.WhereNullMod[Q, string]
|
||||
Zone2 psql.WhereNullMod[Q, string]
|
||||
Created psql.WhereNullMod[Q, time.Time]
|
||||
CreatedDate psql.WhereNullMod[Q, int64]
|
||||
CreatedUser psql.WhereNullMod[Q, string]
|
||||
GeometryX psql.WhereNullMod[Q, float64]
|
||||
|
|
@ -1183,7 +1208,7 @@ func (historyTimecardWhere[Q]) AliasedAs(alias string) historyTimecardWhere[Q] {
|
|||
|
||||
func buildHistoryTimecardWhere[Q psql.Filterable](cols historyTimecardColumns) historyTimecardWhere[Q] {
|
||||
return historyTimecardWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Activity: psql.WhereNull[Q, string](cols.Activity),
|
||||
Comments: psql.WhereNull[Q, string](cols.Comments),
|
||||
Creationdate: psql.WhereNull[Q, int64](cols.Creationdate),
|
||||
|
|
@ -1207,6 +1232,7 @@ func buildHistoryTimecardWhere[Q psql.Filterable](cols historyTimecardColumns) h
|
|||
Traplocid: psql.WhereNull[Q, string](cols.Traplocid),
|
||||
Zone: psql.WhereNull[Q, string](cols.Zone),
|
||||
Zone2: psql.WhereNull[Q, string](cols.Zone2),
|
||||
Created: psql.WhereNull[Q, time.Time](cols.Created),
|
||||
CreatedDate: psql.WhereNull[Q, int64](cols.CreatedDate),
|
||||
CreatedUser: psql.WhereNull[Q, string](cols.CreatedUser),
|
||||
GeometryX: psql.WhereNull[Q, float64](cols.GeometryX),
|
||||
|
|
@ -1319,11 +1345,8 @@ func (os HistoryTimecardSlice) LoadOrganization(ctx context.Context, exec bob.Ex
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"time"
|
||||
|
||||
"github.com/aarondl/opt/null"
|
||||
"github.com/aarondl/opt/omit"
|
||||
|
|
@ -25,52 +26,53 @@ import (
|
|||
|
||||
// HistoryTrapdatum is an object representing the database table.
|
||||
type HistoryTrapdatum struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
Avetemp null.Val[float64] `db:"avetemp" `
|
||||
Comments null.Val[string] `db:"comments" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Enddatetime null.Val[int64] `db:"enddatetime" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
Editor null.Val[string] `db:"editor" `
|
||||
Fieldtech null.Val[string] `db:"fieldtech" `
|
||||
Field null.Val[int64] `db:"field" `
|
||||
Gatewaysync null.Val[int16] `db:"gatewaysync" `
|
||||
Globalid null.Val[string] `db:"globalid" `
|
||||
Idbytech null.Val[string] `db:"idbytech" `
|
||||
Locationname null.Val[string] `db:"locationname" `
|
||||
LocID null.Val[string] `db:"loc_id" `
|
||||
LR null.Val[int16] `db:"lr" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
Processed null.Val[int16] `db:"processed" `
|
||||
Raingauge null.Val[float64] `db:"raingauge" `
|
||||
Recordstatus null.Val[int16] `db:"recordstatus" `
|
||||
Reviewed null.Val[int16] `db:"reviewed" `
|
||||
Reviewedby null.Val[string] `db:"reviewedby" `
|
||||
Revieweddate null.Val[int64] `db:"revieweddate" `
|
||||
Sitecond null.Val[string] `db:"sitecond" `
|
||||
Sortbytech null.Val[string] `db:"sortbytech" `
|
||||
Srid null.Val[string] `db:"srid" `
|
||||
Startdatetime null.Val[int64] `db:"startdatetime" `
|
||||
Trapactivitytype null.Val[string] `db:"trapactivitytype" `
|
||||
Trapcondition null.Val[string] `db:"trapcondition" `
|
||||
Trapnights null.Val[int16] `db:"trapnights" `
|
||||
Traptype null.Val[string] `db:"traptype" `
|
||||
Voltage null.Val[float64] `db:"voltage" `
|
||||
Winddir null.Val[string] `db:"winddir" `
|
||||
Windspeed null.Val[float64] `db:"windspeed" `
|
||||
Zone null.Val[string] `db:"zone" `
|
||||
Zone2 null.Val[string] `db:"zone2" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Lure null.Val[string] `db:"lure" `
|
||||
Vectorsurvtrapdataid null.Val[string] `db:"vectorsurvtrapdataid" `
|
||||
Vectorsurvtraplocationid null.Val[string] `db:"vectorsurvtraplocationid" `
|
||||
Version int32 `db:"version,pk" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Avetemp null.Val[float64] `db:"avetemp" `
|
||||
Comments null.Val[string] `db:"comments" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Enddatetime null.Val[int64] `db:"enddatetime" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
Editor null.Val[string] `db:"editor" `
|
||||
Fieldtech null.Val[string] `db:"fieldtech" `
|
||||
Field null.Val[int64] `db:"field" `
|
||||
Gatewaysync null.Val[int16] `db:"gatewaysync" `
|
||||
Globalid null.Val[string] `db:"globalid" `
|
||||
Idbytech null.Val[string] `db:"idbytech" `
|
||||
Locationname null.Val[string] `db:"locationname" `
|
||||
LocID null.Val[string] `db:"loc_id" `
|
||||
LR null.Val[int16] `db:"lr" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
Processed null.Val[int16] `db:"processed" `
|
||||
Raingauge null.Val[float64] `db:"raingauge" `
|
||||
Recordstatus null.Val[int16] `db:"recordstatus" `
|
||||
Reviewed null.Val[int16] `db:"reviewed" `
|
||||
Reviewedby null.Val[string] `db:"reviewedby" `
|
||||
Revieweddate null.Val[int64] `db:"revieweddate" `
|
||||
Sitecond null.Val[string] `db:"sitecond" `
|
||||
Sortbytech null.Val[string] `db:"sortbytech" `
|
||||
Srid null.Val[string] `db:"srid" `
|
||||
Startdatetime null.Val[int64] `db:"startdatetime" `
|
||||
Trapactivitytype null.Val[string] `db:"trapactivitytype" `
|
||||
Trapcondition null.Val[string] `db:"trapcondition" `
|
||||
Trapnights null.Val[int16] `db:"trapnights" `
|
||||
Traptype null.Val[string] `db:"traptype" `
|
||||
Voltage null.Val[float64] `db:"voltage" `
|
||||
Winddir null.Val[string] `db:"winddir" `
|
||||
Windspeed null.Val[float64] `db:"windspeed" `
|
||||
Zone null.Val[string] `db:"zone" `
|
||||
Zone2 null.Val[string] `db:"zone2" `
|
||||
Created null.Val[time.Time] `db:"created" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Lure null.Val[string] `db:"lure" `
|
||||
Vectorsurvtrapdataid null.Val[string] `db:"vectorsurvtrapdataid" `
|
||||
Vectorsurvtraplocationid null.Val[string] `db:"vectorsurvtraplocationid" `
|
||||
Version int32 `db:"version,pk" `
|
||||
|
||||
R historyTrapdatumR `db:"-" `
|
||||
}
|
||||
|
|
@ -93,7 +95,7 @@ type historyTrapdatumR struct {
|
|||
func buildHistoryTrapdatumColumns(alias string) historyTrapdatumColumns {
|
||||
return historyTrapdatumColumns{
|
||||
ColumnsExpr: expr.NewColumnsExpr(
|
||||
"organization_id", "avetemp", "comments", "creationdate", "creator", "enddatetime", "editdate", "editor", "fieldtech", "field", "gatewaysync", "globalid", "idbytech", "locationname", "loc_id", "lr", "objectid", "processed", "raingauge", "recordstatus", "reviewed", "reviewedby", "revieweddate", "sitecond", "sortbytech", "srid", "startdatetime", "trapactivitytype", "trapcondition", "trapnights", "traptype", "voltage", "winddir", "windspeed", "zone", "zone2", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "lure", "vectorsurvtrapdataid", "vectorsurvtraplocationid", "version",
|
||||
"organization_id", "avetemp", "comments", "creationdate", "creator", "enddatetime", "editdate", "editor", "fieldtech", "field", "gatewaysync", "globalid", "idbytech", "locationname", "loc_id", "lr", "objectid", "processed", "raingauge", "recordstatus", "reviewed", "reviewedby", "revieweddate", "sitecond", "sortbytech", "srid", "startdatetime", "trapactivitytype", "trapcondition", "trapnights", "traptype", "voltage", "winddir", "windspeed", "zone", "zone2", "created", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "lure", "vectorsurvtrapdataid", "vectorsurvtraplocationid", "version",
|
||||
).WithParent("history_trapdata"),
|
||||
tableAlias: alias,
|
||||
OrganizationID: psql.Quote(alias, "organization_id"),
|
||||
|
|
@ -132,6 +134,7 @@ func buildHistoryTrapdatumColumns(alias string) historyTrapdatumColumns {
|
|||
Windspeed: psql.Quote(alias, "windspeed"),
|
||||
Zone: psql.Quote(alias, "zone"),
|
||||
Zone2: psql.Quote(alias, "zone2"),
|
||||
Created: psql.Quote(alias, "created"),
|
||||
CreatedDate: psql.Quote(alias, "created_date"),
|
||||
CreatedUser: psql.Quote(alias, "created_user"),
|
||||
GeometryX: psql.Quote(alias, "geometry_x"),
|
||||
|
|
@ -184,6 +187,7 @@ type historyTrapdatumColumns struct {
|
|||
Windspeed psql.Expression
|
||||
Zone psql.Expression
|
||||
Zone2 psql.Expression
|
||||
Created psql.Expression
|
||||
CreatedDate psql.Expression
|
||||
CreatedUser psql.Expression
|
||||
GeometryX psql.Expression
|
||||
|
|
@ -208,57 +212,58 @@ func (historyTrapdatumColumns) AliasedAs(alias string) historyTrapdatumColumns {
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type HistoryTrapdatumSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
Avetemp omitnull.Val[float64] `db:"avetemp" `
|
||||
Comments omitnull.Val[string] `db:"comments" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Enddatetime omitnull.Val[int64] `db:"enddatetime" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
Editor omitnull.Val[string] `db:"editor" `
|
||||
Fieldtech omitnull.Val[string] `db:"fieldtech" `
|
||||
Field omitnull.Val[int64] `db:"field" `
|
||||
Gatewaysync omitnull.Val[int16] `db:"gatewaysync" `
|
||||
Globalid omitnull.Val[string] `db:"globalid" `
|
||||
Idbytech omitnull.Val[string] `db:"idbytech" `
|
||||
Locationname omitnull.Val[string] `db:"locationname" `
|
||||
LocID omitnull.Val[string] `db:"loc_id" `
|
||||
LR omitnull.Val[int16] `db:"lr" `
|
||||
Objectid omit.Val[int32] `db:"objectid,pk" `
|
||||
Processed omitnull.Val[int16] `db:"processed" `
|
||||
Raingauge omitnull.Val[float64] `db:"raingauge" `
|
||||
Recordstatus omitnull.Val[int16] `db:"recordstatus" `
|
||||
Reviewed omitnull.Val[int16] `db:"reviewed" `
|
||||
Reviewedby omitnull.Val[string] `db:"reviewedby" `
|
||||
Revieweddate omitnull.Val[int64] `db:"revieweddate" `
|
||||
Sitecond omitnull.Val[string] `db:"sitecond" `
|
||||
Sortbytech omitnull.Val[string] `db:"sortbytech" `
|
||||
Srid omitnull.Val[string] `db:"srid" `
|
||||
Startdatetime omitnull.Val[int64] `db:"startdatetime" `
|
||||
Trapactivitytype omitnull.Val[string] `db:"trapactivitytype" `
|
||||
Trapcondition omitnull.Val[string] `db:"trapcondition" `
|
||||
Trapnights omitnull.Val[int16] `db:"trapnights" `
|
||||
Traptype omitnull.Val[string] `db:"traptype" `
|
||||
Voltage omitnull.Val[float64] `db:"voltage" `
|
||||
Winddir omitnull.Val[string] `db:"winddir" `
|
||||
Windspeed omitnull.Val[float64] `db:"windspeed" `
|
||||
Zone omitnull.Val[string] `db:"zone" `
|
||||
Zone2 omitnull.Val[string] `db:"zone2" `
|
||||
CreatedDate omitnull.Val[int64] `db:"created_date" `
|
||||
CreatedUser omitnull.Val[string] `db:"created_user" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Lure omitnull.Val[string] `db:"lure" `
|
||||
Vectorsurvtrapdataid omitnull.Val[string] `db:"vectorsurvtrapdataid" `
|
||||
Vectorsurvtraplocationid omitnull.Val[string] `db:"vectorsurvtraplocationid" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Avetemp omitnull.Val[float64] `db:"avetemp" `
|
||||
Comments omitnull.Val[string] `db:"comments" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Enddatetime omitnull.Val[int64] `db:"enddatetime" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
Editor omitnull.Val[string] `db:"editor" `
|
||||
Fieldtech omitnull.Val[string] `db:"fieldtech" `
|
||||
Field omitnull.Val[int64] `db:"field" `
|
||||
Gatewaysync omitnull.Val[int16] `db:"gatewaysync" `
|
||||
Globalid omitnull.Val[string] `db:"globalid" `
|
||||
Idbytech omitnull.Val[string] `db:"idbytech" `
|
||||
Locationname omitnull.Val[string] `db:"locationname" `
|
||||
LocID omitnull.Val[string] `db:"loc_id" `
|
||||
LR omitnull.Val[int16] `db:"lr" `
|
||||
Objectid omit.Val[int32] `db:"objectid,pk" `
|
||||
Processed omitnull.Val[int16] `db:"processed" `
|
||||
Raingauge omitnull.Val[float64] `db:"raingauge" `
|
||||
Recordstatus omitnull.Val[int16] `db:"recordstatus" `
|
||||
Reviewed omitnull.Val[int16] `db:"reviewed" `
|
||||
Reviewedby omitnull.Val[string] `db:"reviewedby" `
|
||||
Revieweddate omitnull.Val[int64] `db:"revieweddate" `
|
||||
Sitecond omitnull.Val[string] `db:"sitecond" `
|
||||
Sortbytech omitnull.Val[string] `db:"sortbytech" `
|
||||
Srid omitnull.Val[string] `db:"srid" `
|
||||
Startdatetime omitnull.Val[int64] `db:"startdatetime" `
|
||||
Trapactivitytype omitnull.Val[string] `db:"trapactivitytype" `
|
||||
Trapcondition omitnull.Val[string] `db:"trapcondition" `
|
||||
Trapnights omitnull.Val[int16] `db:"trapnights" `
|
||||
Traptype omitnull.Val[string] `db:"traptype" `
|
||||
Voltage omitnull.Val[float64] `db:"voltage" `
|
||||
Winddir omitnull.Val[string] `db:"winddir" `
|
||||
Windspeed omitnull.Val[float64] `db:"windspeed" `
|
||||
Zone omitnull.Val[string] `db:"zone" `
|
||||
Zone2 omitnull.Val[string] `db:"zone2" `
|
||||
Created omitnull.Val[time.Time] `db:"created" `
|
||||
CreatedDate omitnull.Val[int64] `db:"created_date" `
|
||||
CreatedUser omitnull.Val[string] `db:"created_user" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Lure omitnull.Val[string] `db:"lure" `
|
||||
Vectorsurvtrapdataid omitnull.Val[string] `db:"vectorsurvtrapdataid" `
|
||||
Vectorsurvtraplocationid omitnull.Val[string] `db:"vectorsurvtraplocationid" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
}
|
||||
|
||||
func (s HistoryTrapdatumSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 46)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals := make([]string, 0, 47)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Avetemp.IsUnset() {
|
||||
|
|
@ -366,6 +371,9 @@ func (s HistoryTrapdatumSetter) SetColumns() []string {
|
|||
if !s.Zone2.IsUnset() {
|
||||
vals = append(vals, "zone2")
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
vals = append(vals, "created")
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals = append(vals, "created_date")
|
||||
}
|
||||
|
|
@ -400,8 +408,8 @@ func (s HistoryTrapdatumSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s HistoryTrapdatumSetter) Overwrite(t *HistoryTrapdatum) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Avetemp.IsUnset() {
|
||||
t.Avetemp = s.Avetemp.MustGetNull()
|
||||
|
|
@ -508,6 +516,9 @@ func (s HistoryTrapdatumSetter) Overwrite(t *HistoryTrapdatum) {
|
|||
if !s.Zone2.IsUnset() {
|
||||
t.Zone2 = s.Zone2.MustGetNull()
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
t.Created = s.Created.MustGetNull()
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
t.CreatedDate = s.CreatedDate.MustGetNull()
|
||||
}
|
||||
|
|
@ -546,9 +557,9 @@ func (s *HistoryTrapdatumSetter) Apply(q *dialect.InsertQuery) {
|
|||
})
|
||||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 46)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
vals := make([]bob.Expression, 47)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -763,66 +774,72 @@ func (s *HistoryTrapdatumSetter) Apply(q *dialect.InsertQuery) {
|
|||
vals[35] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[36] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
if !s.Created.IsUnset() {
|
||||
vals[36] = psql.Arg(s.Created.MustGetNull())
|
||||
} else {
|
||||
vals[36] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[37] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[37] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
} else {
|
||||
vals[37] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[38] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[38] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
} else {
|
||||
vals[38] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[39] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[39] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
} else {
|
||||
vals[39] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[40] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[40] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
} else {
|
||||
vals[40] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[41] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[41] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
} else {
|
||||
vals[41] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.Lure.IsUnset() {
|
||||
vals[42] = psql.Arg(s.Lure.MustGetNull())
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[42] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
} else {
|
||||
vals[42] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.Vectorsurvtrapdataid.IsUnset() {
|
||||
vals[43] = psql.Arg(s.Vectorsurvtrapdataid.MustGetNull())
|
||||
if !s.Lure.IsUnset() {
|
||||
vals[43] = psql.Arg(s.Lure.MustGetNull())
|
||||
} else {
|
||||
vals[43] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.Vectorsurvtraplocationid.IsUnset() {
|
||||
vals[44] = psql.Arg(s.Vectorsurvtraplocationid.MustGetNull())
|
||||
if !s.Vectorsurvtrapdataid.IsUnset() {
|
||||
vals[44] = psql.Arg(s.Vectorsurvtrapdataid.MustGetNull())
|
||||
} else {
|
||||
vals[44] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[45] = psql.Arg(s.Version.MustGet())
|
||||
if !s.Vectorsurvtraplocationid.IsUnset() {
|
||||
vals[45] = psql.Arg(s.Vectorsurvtraplocationid.MustGetNull())
|
||||
} else {
|
||||
vals[45] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[46] = psql.Arg(s.Version.MustGet())
|
||||
} else {
|
||||
vals[46] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
return bob.ExpressSlice(ctx, w, d, start, vals, "", ", ", "")
|
||||
}))
|
||||
}
|
||||
|
|
@ -832,9 +849,9 @@ func (s HistoryTrapdatumSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery] {
|
|||
}
|
||||
|
||||
func (s HistoryTrapdatumSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 46)
|
||||
exprs := make([]bob.Expression, 0, 47)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -1086,6 +1103,13 @@ func (s HistoryTrapdatumSetter) Expressions(prefix ...string) []bob.Expression {
|
|||
}})
|
||||
}
|
||||
|
||||
if !s.Created.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created")...),
|
||||
psql.Arg(s.Created),
|
||||
}})
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created_date")...),
|
||||
|
|
@ -1400,7 +1424,7 @@ func (o *HistoryTrapdatum) Organization(mods ...bob.Mod[*dialect.SelectQuery]) O
|
|||
}
|
||||
|
||||
func (os HistoryTrapdatumSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -1418,7 +1442,7 @@ func (os HistoryTrapdatumSlice) Organization(mods ...bob.Mod[*dialect.SelectQuer
|
|||
|
||||
func attachHistoryTrapdatumOrganization0(ctx context.Context, exec bob.Executor, count int, historyTrapdatum0 *HistoryTrapdatum, organization1 *Organization) (*HistoryTrapdatum, error) {
|
||||
setter := &HistoryTrapdatumSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := historyTrapdatum0.Update(ctx, exec, setter)
|
||||
|
|
@ -1465,7 +1489,7 @@ func (historyTrapdatum0 *HistoryTrapdatum) AttachOrganization(ctx context.Contex
|
|||
}
|
||||
|
||||
type historyTrapdatumWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Avetemp psql.WhereNullMod[Q, float64]
|
||||
Comments psql.WhereNullMod[Q, string]
|
||||
Creationdate psql.WhereNullMod[Q, int64]
|
||||
|
|
@ -1501,6 +1525,7 @@ type historyTrapdatumWhere[Q psql.Filterable] struct {
|
|||
Windspeed psql.WhereNullMod[Q, float64]
|
||||
Zone psql.WhereNullMod[Q, string]
|
||||
Zone2 psql.WhereNullMod[Q, string]
|
||||
Created psql.WhereNullMod[Q, time.Time]
|
||||
CreatedDate psql.WhereNullMod[Q, int64]
|
||||
CreatedUser psql.WhereNullMod[Q, string]
|
||||
GeometryX psql.WhereNullMod[Q, float64]
|
||||
|
|
@ -1519,7 +1544,7 @@ func (historyTrapdatumWhere[Q]) AliasedAs(alias string) historyTrapdatumWhere[Q]
|
|||
|
||||
func buildHistoryTrapdatumWhere[Q psql.Filterable](cols historyTrapdatumColumns) historyTrapdatumWhere[Q] {
|
||||
return historyTrapdatumWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Avetemp: psql.WhereNull[Q, float64](cols.Avetemp),
|
||||
Comments: psql.WhereNull[Q, string](cols.Comments),
|
||||
Creationdate: psql.WhereNull[Q, int64](cols.Creationdate),
|
||||
|
|
@ -1555,6 +1580,7 @@ func buildHistoryTrapdatumWhere[Q psql.Filterable](cols historyTrapdatumColumns)
|
|||
Windspeed: psql.WhereNull[Q, float64](cols.Windspeed),
|
||||
Zone: psql.WhereNull[Q, string](cols.Zone),
|
||||
Zone2: psql.WhereNull[Q, string](cols.Zone2),
|
||||
Created: psql.WhereNull[Q, time.Time](cols.Created),
|
||||
CreatedDate: psql.WhereNull[Q, int64](cols.CreatedDate),
|
||||
CreatedUser: psql.WhereNull[Q, string](cols.CreatedUser),
|
||||
GeometryX: psql.WhereNull[Q, float64](cols.GeometryX),
|
||||
|
|
@ -1669,11 +1695,8 @@ func (os HistoryTrapdatumSlice) LoadOrganization(ctx context.Context, exec bob.E
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"time"
|
||||
|
||||
"github.com/aarondl/opt/null"
|
||||
"github.com/aarondl/opt/omit"
|
||||
|
|
@ -25,40 +26,41 @@ import (
|
|||
|
||||
// HistoryTraplocation is an object representing the database table.
|
||||
type HistoryTraplocation struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
Accessdesc null.Val[string] `db:"accessdesc" `
|
||||
Active null.Val[int16] `db:"active" `
|
||||
Comments null.Val[string] `db:"comments" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Description null.Val[string] `db:"description" `
|
||||
Externalid null.Val[string] `db:"externalid" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
Editor null.Val[string] `db:"editor" `
|
||||
Gatewaysync null.Val[int16] `db:"gatewaysync" `
|
||||
Globalid null.Val[string] `db:"globalid" `
|
||||
Habitat null.Val[string] `db:"habitat" `
|
||||
Locationnumber null.Val[int64] `db:"locationnumber" `
|
||||
Name null.Val[string] `db:"name" `
|
||||
Nextactiondatescheduled null.Val[int64] `db:"nextactiondatescheduled" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
Priority null.Val[string] `db:"priority" `
|
||||
Usetype null.Val[string] `db:"usetype" `
|
||||
Zone null.Val[string] `db:"zone" `
|
||||
Zone2 null.Val[string] `db:"zone2" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Route null.Val[int64] `db:"route" `
|
||||
RouteOrder null.Val[int64] `db:"route_order" `
|
||||
SetDow null.Val[int64] `db:"set_dow" `
|
||||
Vectorsurvsiteid null.Val[string] `db:"vectorsurvsiteid" `
|
||||
H3R7 null.Val[string] `db:"h3r7" `
|
||||
H3R8 null.Val[string] `db:"h3r8" `
|
||||
Version int32 `db:"version,pk" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Accessdesc null.Val[string] `db:"accessdesc" `
|
||||
Active null.Val[int16] `db:"active" `
|
||||
Comments null.Val[string] `db:"comments" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Description null.Val[string] `db:"description" `
|
||||
Externalid null.Val[string] `db:"externalid" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
Editor null.Val[string] `db:"editor" `
|
||||
Gatewaysync null.Val[int16] `db:"gatewaysync" `
|
||||
Globalid null.Val[string] `db:"globalid" `
|
||||
Habitat null.Val[string] `db:"habitat" `
|
||||
Locationnumber null.Val[int64] `db:"locationnumber" `
|
||||
Name null.Val[string] `db:"name" `
|
||||
Nextactiondatescheduled null.Val[int64] `db:"nextactiondatescheduled" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
Priority null.Val[string] `db:"priority" `
|
||||
Usetype null.Val[string] `db:"usetype" `
|
||||
Zone null.Val[string] `db:"zone" `
|
||||
Zone2 null.Val[string] `db:"zone2" `
|
||||
Created null.Val[time.Time] `db:"created" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Route null.Val[int64] `db:"route" `
|
||||
RouteOrder null.Val[int64] `db:"route_order" `
|
||||
SetDow null.Val[int64] `db:"set_dow" `
|
||||
Vectorsurvsiteid null.Val[string] `db:"vectorsurvsiteid" `
|
||||
H3R7 null.Val[string] `db:"h3r7" `
|
||||
H3R8 null.Val[string] `db:"h3r8" `
|
||||
Version int32 `db:"version,pk" `
|
||||
|
||||
R historyTraplocationR `db:"-" `
|
||||
}
|
||||
|
|
@ -81,7 +83,7 @@ type historyTraplocationR struct {
|
|||
func buildHistoryTraplocationColumns(alias string) historyTraplocationColumns {
|
||||
return historyTraplocationColumns{
|
||||
ColumnsExpr: expr.NewColumnsExpr(
|
||||
"organization_id", "accessdesc", "active", "comments", "creationdate", "creator", "description", "externalid", "editdate", "editor", "gatewaysync", "globalid", "habitat", "locationnumber", "name", "nextactiondatescheduled", "objectid", "priority", "usetype", "zone", "zone2", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "route", "route_order", "set_dow", "vectorsurvsiteid", "h3r7", "h3r8", "version",
|
||||
"organization_id", "accessdesc", "active", "comments", "creationdate", "creator", "description", "externalid", "editdate", "editor", "gatewaysync", "globalid", "habitat", "locationnumber", "name", "nextactiondatescheduled", "objectid", "priority", "usetype", "zone", "zone2", "created", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "route", "route_order", "set_dow", "vectorsurvsiteid", "h3r7", "h3r8", "version",
|
||||
).WithParent("history_traplocation"),
|
||||
tableAlias: alias,
|
||||
OrganizationID: psql.Quote(alias, "organization_id"),
|
||||
|
|
@ -105,6 +107,7 @@ func buildHistoryTraplocationColumns(alias string) historyTraplocationColumns {
|
|||
Usetype: psql.Quote(alias, "usetype"),
|
||||
Zone: psql.Quote(alias, "zone"),
|
||||
Zone2: psql.Quote(alias, "zone2"),
|
||||
Created: psql.Quote(alias, "created"),
|
||||
CreatedDate: psql.Quote(alias, "created_date"),
|
||||
CreatedUser: psql.Quote(alias, "created_user"),
|
||||
GeometryX: psql.Quote(alias, "geometry_x"),
|
||||
|
|
@ -145,6 +148,7 @@ type historyTraplocationColumns struct {
|
|||
Usetype psql.Expression
|
||||
Zone psql.Expression
|
||||
Zone2 psql.Expression
|
||||
Created psql.Expression
|
||||
CreatedDate psql.Expression
|
||||
CreatedUser psql.Expression
|
||||
GeometryX psql.Expression
|
||||
|
|
@ -172,45 +176,46 @@ func (historyTraplocationColumns) AliasedAs(alias string) historyTraplocationCol
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type HistoryTraplocationSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
Accessdesc omitnull.Val[string] `db:"accessdesc" `
|
||||
Active omitnull.Val[int16] `db:"active" `
|
||||
Comments omitnull.Val[string] `db:"comments" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Description omitnull.Val[string] `db:"description" `
|
||||
Externalid omitnull.Val[string] `db:"externalid" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
Editor omitnull.Val[string] `db:"editor" `
|
||||
Gatewaysync omitnull.Val[int16] `db:"gatewaysync" `
|
||||
Globalid omitnull.Val[string] `db:"globalid" `
|
||||
Habitat omitnull.Val[string] `db:"habitat" `
|
||||
Locationnumber omitnull.Val[int64] `db:"locationnumber" `
|
||||
Name omitnull.Val[string] `db:"name" `
|
||||
Nextactiondatescheduled omitnull.Val[int64] `db:"nextactiondatescheduled" `
|
||||
Objectid omit.Val[int32] `db:"objectid,pk" `
|
||||
Priority omitnull.Val[string] `db:"priority" `
|
||||
Usetype omitnull.Val[string] `db:"usetype" `
|
||||
Zone omitnull.Val[string] `db:"zone" `
|
||||
Zone2 omitnull.Val[string] `db:"zone2" `
|
||||
CreatedDate omitnull.Val[int64] `db:"created_date" `
|
||||
CreatedUser omitnull.Val[string] `db:"created_user" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Route omitnull.Val[int64] `db:"route" `
|
||||
RouteOrder omitnull.Val[int64] `db:"route_order" `
|
||||
SetDow omitnull.Val[int64] `db:"set_dow" `
|
||||
Vectorsurvsiteid omitnull.Val[string] `db:"vectorsurvsiteid" `
|
||||
H3R7 omitnull.Val[string] `db:"h3r7" `
|
||||
H3R8 omitnull.Val[string] `db:"h3r8" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Accessdesc omitnull.Val[string] `db:"accessdesc" `
|
||||
Active omitnull.Val[int16] `db:"active" `
|
||||
Comments omitnull.Val[string] `db:"comments" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Description omitnull.Val[string] `db:"description" `
|
||||
Externalid omitnull.Val[string] `db:"externalid" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
Editor omitnull.Val[string] `db:"editor" `
|
||||
Gatewaysync omitnull.Val[int16] `db:"gatewaysync" `
|
||||
Globalid omitnull.Val[string] `db:"globalid" `
|
||||
Habitat omitnull.Val[string] `db:"habitat" `
|
||||
Locationnumber omitnull.Val[int64] `db:"locationnumber" `
|
||||
Name omitnull.Val[string] `db:"name" `
|
||||
Nextactiondatescheduled omitnull.Val[int64] `db:"nextactiondatescheduled" `
|
||||
Objectid omit.Val[int32] `db:"objectid,pk" `
|
||||
Priority omitnull.Val[string] `db:"priority" `
|
||||
Usetype omitnull.Val[string] `db:"usetype" `
|
||||
Zone omitnull.Val[string] `db:"zone" `
|
||||
Zone2 omitnull.Val[string] `db:"zone2" `
|
||||
Created omitnull.Val[time.Time] `db:"created" `
|
||||
CreatedDate omitnull.Val[int64] `db:"created_date" `
|
||||
CreatedUser omitnull.Val[string] `db:"created_user" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Route omitnull.Val[int64] `db:"route" `
|
||||
RouteOrder omitnull.Val[int64] `db:"route_order" `
|
||||
SetDow omitnull.Val[int64] `db:"set_dow" `
|
||||
Vectorsurvsiteid omitnull.Val[string] `db:"vectorsurvsiteid" `
|
||||
H3R7 omitnull.Val[string] `db:"h3r7" `
|
||||
H3R8 omitnull.Val[string] `db:"h3r8" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
}
|
||||
|
||||
func (s HistoryTraplocationSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 34)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals := make([]string, 0, 35)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Accessdesc.IsUnset() {
|
||||
|
|
@ -273,6 +278,9 @@ func (s HistoryTraplocationSetter) SetColumns() []string {
|
|||
if !s.Zone2.IsUnset() {
|
||||
vals = append(vals, "zone2")
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
vals = append(vals, "created")
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals = append(vals, "created_date")
|
||||
}
|
||||
|
|
@ -316,8 +324,8 @@ func (s HistoryTraplocationSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s HistoryTraplocationSetter) Overwrite(t *HistoryTraplocation) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Accessdesc.IsUnset() {
|
||||
t.Accessdesc = s.Accessdesc.MustGetNull()
|
||||
|
|
@ -379,6 +387,9 @@ func (s HistoryTraplocationSetter) Overwrite(t *HistoryTraplocation) {
|
|||
if !s.Zone2.IsUnset() {
|
||||
t.Zone2 = s.Zone2.MustGetNull()
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
t.Created = s.Created.MustGetNull()
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
t.CreatedDate = s.CreatedDate.MustGetNull()
|
||||
}
|
||||
|
|
@ -426,9 +437,9 @@ func (s *HistoryTraplocationSetter) Apply(q *dialect.InsertQuery) {
|
|||
})
|
||||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 34)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
vals := make([]bob.Expression, 35)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -553,84 +564,90 @@ func (s *HistoryTraplocationSetter) Apply(q *dialect.InsertQuery) {
|
|||
vals[20] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[21] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
if !s.Created.IsUnset() {
|
||||
vals[21] = psql.Arg(s.Created.MustGetNull())
|
||||
} else {
|
||||
vals[21] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[22] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[22] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
} else {
|
||||
vals[22] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[23] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[23] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
} else {
|
||||
vals[23] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[24] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[24] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
} else {
|
||||
vals[24] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[25] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[25] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
} else {
|
||||
vals[25] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[26] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[26] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
} else {
|
||||
vals[26] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.Route.IsUnset() {
|
||||
vals[27] = psql.Arg(s.Route.MustGetNull())
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[27] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
} else {
|
||||
vals[27] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.RouteOrder.IsUnset() {
|
||||
vals[28] = psql.Arg(s.RouteOrder.MustGetNull())
|
||||
if !s.Route.IsUnset() {
|
||||
vals[28] = psql.Arg(s.Route.MustGetNull())
|
||||
} else {
|
||||
vals[28] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.SetDow.IsUnset() {
|
||||
vals[29] = psql.Arg(s.SetDow.MustGetNull())
|
||||
if !s.RouteOrder.IsUnset() {
|
||||
vals[29] = psql.Arg(s.RouteOrder.MustGetNull())
|
||||
} else {
|
||||
vals[29] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.Vectorsurvsiteid.IsUnset() {
|
||||
vals[30] = psql.Arg(s.Vectorsurvsiteid.MustGetNull())
|
||||
if !s.SetDow.IsUnset() {
|
||||
vals[30] = psql.Arg(s.SetDow.MustGetNull())
|
||||
} else {
|
||||
vals[30] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.H3R7.IsUnset() {
|
||||
vals[31] = psql.Arg(s.H3R7.MustGetNull())
|
||||
if !s.Vectorsurvsiteid.IsUnset() {
|
||||
vals[31] = psql.Arg(s.Vectorsurvsiteid.MustGetNull())
|
||||
} else {
|
||||
vals[31] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.H3R8.IsUnset() {
|
||||
vals[32] = psql.Arg(s.H3R8.MustGetNull())
|
||||
if !s.H3R7.IsUnset() {
|
||||
vals[32] = psql.Arg(s.H3R7.MustGetNull())
|
||||
} else {
|
||||
vals[32] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[33] = psql.Arg(s.Version.MustGet())
|
||||
if !s.H3R8.IsUnset() {
|
||||
vals[33] = psql.Arg(s.H3R8.MustGetNull())
|
||||
} else {
|
||||
vals[33] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[34] = psql.Arg(s.Version.MustGet())
|
||||
} else {
|
||||
vals[34] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
return bob.ExpressSlice(ctx, w, d, start, vals, "", ", ", "")
|
||||
}))
|
||||
}
|
||||
|
|
@ -640,9 +657,9 @@ func (s HistoryTraplocationSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery] {
|
|||
}
|
||||
|
||||
func (s HistoryTraplocationSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 34)
|
||||
exprs := make([]bob.Expression, 0, 35)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -789,6 +806,13 @@ func (s HistoryTraplocationSetter) Expressions(prefix ...string) []bob.Expressio
|
|||
}})
|
||||
}
|
||||
|
||||
if !s.Created.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created")...),
|
||||
psql.Arg(s.Created),
|
||||
}})
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created_date")...),
|
||||
|
|
@ -1124,7 +1148,7 @@ func (o *HistoryTraplocation) Organization(mods ...bob.Mod[*dialect.SelectQuery]
|
|||
}
|
||||
|
||||
func (os HistoryTraplocationSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -1142,7 +1166,7 @@ func (os HistoryTraplocationSlice) Organization(mods ...bob.Mod[*dialect.SelectQ
|
|||
|
||||
func attachHistoryTraplocationOrganization0(ctx context.Context, exec bob.Executor, count int, historyTraplocation0 *HistoryTraplocation, organization1 *Organization) (*HistoryTraplocation, error) {
|
||||
setter := &HistoryTraplocationSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := historyTraplocation0.Update(ctx, exec, setter)
|
||||
|
|
@ -1189,7 +1213,7 @@ func (historyTraplocation0 *HistoryTraplocation) AttachOrganization(ctx context.
|
|||
}
|
||||
|
||||
type historyTraplocationWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Accessdesc psql.WhereNullMod[Q, string]
|
||||
Active psql.WhereNullMod[Q, int16]
|
||||
Comments psql.WhereNullMod[Q, string]
|
||||
|
|
@ -1210,6 +1234,7 @@ type historyTraplocationWhere[Q psql.Filterable] struct {
|
|||
Usetype psql.WhereNullMod[Q, string]
|
||||
Zone psql.WhereNullMod[Q, string]
|
||||
Zone2 psql.WhereNullMod[Q, string]
|
||||
Created psql.WhereNullMod[Q, time.Time]
|
||||
CreatedDate psql.WhereNullMod[Q, int64]
|
||||
CreatedUser psql.WhereNullMod[Q, string]
|
||||
GeometryX psql.WhereNullMod[Q, float64]
|
||||
|
|
@ -1231,7 +1256,7 @@ func (historyTraplocationWhere[Q]) AliasedAs(alias string) historyTraplocationWh
|
|||
|
||||
func buildHistoryTraplocationWhere[Q psql.Filterable](cols historyTraplocationColumns) historyTraplocationWhere[Q] {
|
||||
return historyTraplocationWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Accessdesc: psql.WhereNull[Q, string](cols.Accessdesc),
|
||||
Active: psql.WhereNull[Q, int16](cols.Active),
|
||||
Comments: psql.WhereNull[Q, string](cols.Comments),
|
||||
|
|
@ -1252,6 +1277,7 @@ func buildHistoryTraplocationWhere[Q psql.Filterable](cols historyTraplocationCo
|
|||
Usetype: psql.WhereNull[Q, string](cols.Usetype),
|
||||
Zone: psql.WhereNull[Q, string](cols.Zone),
|
||||
Zone2: psql.WhereNull[Q, string](cols.Zone2),
|
||||
Created: psql.WhereNull[Q, time.Time](cols.Created),
|
||||
CreatedDate: psql.WhereNull[Q, int64](cols.CreatedDate),
|
||||
CreatedUser: psql.WhereNull[Q, string](cols.CreatedUser),
|
||||
GeometryX: psql.WhereNull[Q, float64](cols.GeometryX),
|
||||
|
|
@ -1369,11 +1395,8 @@ func (os HistoryTraplocationSlice) LoadOrganization(ctx context.Context, exec bo
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import (
|
|||
|
||||
// HistoryTreatment is an object representing the database table.
|
||||
type HistoryTreatment struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Activity null.Val[string] `db:"activity" `
|
||||
Areaunit null.Val[string] `db:"areaunit" `
|
||||
Avetemp null.Val[float64] `db:"avetemp" `
|
||||
|
|
@ -244,7 +244,7 @@ func (historyTreatmentColumns) AliasedAs(alias string) historyTreatmentColumns {
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type HistoryTreatmentSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Activity omitnull.Val[string] `db:"activity" `
|
||||
Areaunit omitnull.Val[string] `db:"areaunit" `
|
||||
Avetemp omitnull.Val[float64] `db:"avetemp" `
|
||||
|
|
@ -306,7 +306,7 @@ type HistoryTreatmentSetter struct {
|
|||
|
||||
func (s HistoryTreatmentSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 58)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Activity.IsUnset() {
|
||||
|
|
@ -484,8 +484,8 @@ func (s HistoryTreatmentSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s HistoryTreatmentSetter) Overwrite(t *HistoryTreatment) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Activity.IsUnset() {
|
||||
t.Activity = s.Activity.MustGetNull()
|
||||
|
|
@ -667,8 +667,8 @@ func (s *HistoryTreatmentSetter) Apply(q *dialect.InsertQuery) {
|
|||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 58)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -1026,7 +1026,7 @@ func (s HistoryTreatmentSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery] {
|
|||
func (s HistoryTreatmentSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 58)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -1676,7 +1676,7 @@ func (o *HistoryTreatment) Organization(mods ...bob.Mod[*dialect.SelectQuery]) O
|
|||
}
|
||||
|
||||
func (os HistoryTreatmentSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -1694,7 +1694,7 @@ func (os HistoryTreatmentSlice) Organization(mods ...bob.Mod[*dialect.SelectQuer
|
|||
|
||||
func attachHistoryTreatmentOrganization0(ctx context.Context, exec bob.Executor, count int, historyTreatment0 *HistoryTreatment, organization1 *Organization) (*HistoryTreatment, error) {
|
||||
setter := &HistoryTreatmentSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := historyTreatment0.Update(ctx, exec, setter)
|
||||
|
|
@ -1741,7 +1741,7 @@ func (historyTreatment0 *HistoryTreatment) AttachOrganization(ctx context.Contex
|
|||
}
|
||||
|
||||
type historyTreatmentWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Activity psql.WhereNullMod[Q, string]
|
||||
Areaunit psql.WhereNullMod[Q, string]
|
||||
Avetemp psql.WhereNullMod[Q, float64]
|
||||
|
|
@ -1807,7 +1807,7 @@ func (historyTreatmentWhere[Q]) AliasedAs(alias string) historyTreatmentWhere[Q]
|
|||
|
||||
func buildHistoryTreatmentWhere[Q psql.Filterable](cols historyTreatmentColumns) historyTreatmentWhere[Q] {
|
||||
return historyTreatmentWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Activity: psql.WhereNull[Q, string](cols.Activity),
|
||||
Areaunit: psql.WhereNull[Q, string](cols.Areaunit),
|
||||
Avetemp: psql.WhereNull[Q, float64](cols.Avetemp),
|
||||
|
|
@ -1969,11 +1969,8 @@ func (os HistoryTreatmentSlice) LoadOrganization(ctx context.Context, exec bob.E
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"time"
|
||||
|
||||
"github.com/aarondl/opt/null"
|
||||
"github.com/aarondl/opt/omit"
|
||||
|
|
@ -25,28 +26,29 @@ import (
|
|||
|
||||
// HistoryTreatmentarea is an object representing the database table.
|
||||
type HistoryTreatmentarea struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
Comments null.Val[string] `db:"comments" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
Editor null.Val[string] `db:"editor" `
|
||||
Globalid null.Val[string] `db:"globalid" `
|
||||
Notified null.Val[int16] `db:"notified" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
SessionID null.Val[string] `db:"session_id" `
|
||||
ShapeArea null.Val[float64] `db:"shape__area" `
|
||||
ShapeLength null.Val[float64] `db:"shape__length" `
|
||||
Treatdate null.Val[int64] `db:"treatdate" `
|
||||
TreatID null.Val[string] `db:"treat_id" `
|
||||
Type null.Val[string] `db:"type" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Version int32 `db:"version,pk" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Comments null.Val[string] `db:"comments" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
Editor null.Val[string] `db:"editor" `
|
||||
Globalid null.Val[string] `db:"globalid" `
|
||||
Notified null.Val[int16] `db:"notified" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
SessionID null.Val[string] `db:"session_id" `
|
||||
ShapeArea null.Val[float64] `db:"shape__area" `
|
||||
ShapeLength null.Val[float64] `db:"shape__length" `
|
||||
Treatdate null.Val[int64] `db:"treatdate" `
|
||||
TreatID null.Val[string] `db:"treat_id" `
|
||||
Type null.Val[string] `db:"type" `
|
||||
Created null.Val[time.Time] `db:"created" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Version int32 `db:"version,pk" `
|
||||
|
||||
R historyTreatmentareaR `db:"-" `
|
||||
}
|
||||
|
|
@ -69,7 +71,7 @@ type historyTreatmentareaR struct {
|
|||
func buildHistoryTreatmentareaColumns(alias string) historyTreatmentareaColumns {
|
||||
return historyTreatmentareaColumns{
|
||||
ColumnsExpr: expr.NewColumnsExpr(
|
||||
"organization_id", "comments", "creationdate", "creator", "editdate", "editor", "globalid", "notified", "objectid", "session_id", "shape__area", "shape__length", "treatdate", "treat_id", "type", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "version",
|
||||
"organization_id", "comments", "creationdate", "creator", "editdate", "editor", "globalid", "notified", "objectid", "session_id", "shape__area", "shape__length", "treatdate", "treat_id", "type", "created", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "version",
|
||||
).WithParent("history_treatmentarea"),
|
||||
tableAlias: alias,
|
||||
OrganizationID: psql.Quote(alias, "organization_id"),
|
||||
|
|
@ -87,6 +89,7 @@ func buildHistoryTreatmentareaColumns(alias string) historyTreatmentareaColumns
|
|||
Treatdate: psql.Quote(alias, "treatdate"),
|
||||
TreatID: psql.Quote(alias, "treat_id"),
|
||||
Type: psql.Quote(alias, "type"),
|
||||
Created: psql.Quote(alias, "created"),
|
||||
CreatedDate: psql.Quote(alias, "created_date"),
|
||||
CreatedUser: psql.Quote(alias, "created_user"),
|
||||
GeometryX: psql.Quote(alias, "geometry_x"),
|
||||
|
|
@ -115,6 +118,7 @@ type historyTreatmentareaColumns struct {
|
|||
Treatdate psql.Expression
|
||||
TreatID psql.Expression
|
||||
Type psql.Expression
|
||||
Created psql.Expression
|
||||
CreatedDate psql.Expression
|
||||
CreatedUser psql.Expression
|
||||
GeometryX psql.Expression
|
||||
|
|
@ -136,33 +140,34 @@ func (historyTreatmentareaColumns) AliasedAs(alias string) historyTreatmentareaC
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type HistoryTreatmentareaSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
Comments omitnull.Val[string] `db:"comments" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
Editor omitnull.Val[string] `db:"editor" `
|
||||
Globalid omitnull.Val[string] `db:"globalid" `
|
||||
Notified omitnull.Val[int16] `db:"notified" `
|
||||
Objectid omit.Val[int32] `db:"objectid,pk" `
|
||||
SessionID omitnull.Val[string] `db:"session_id" `
|
||||
ShapeArea omitnull.Val[float64] `db:"shape__area" `
|
||||
ShapeLength omitnull.Val[float64] `db:"shape__length" `
|
||||
Treatdate omitnull.Val[int64] `db:"treatdate" `
|
||||
TreatID omitnull.Val[string] `db:"treat_id" `
|
||||
Type omitnull.Val[string] `db:"type" `
|
||||
CreatedDate omitnull.Val[int64] `db:"created_date" `
|
||||
CreatedUser omitnull.Val[string] `db:"created_user" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Comments omitnull.Val[string] `db:"comments" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
Editor omitnull.Val[string] `db:"editor" `
|
||||
Globalid omitnull.Val[string] `db:"globalid" `
|
||||
Notified omitnull.Val[int16] `db:"notified" `
|
||||
Objectid omit.Val[int32] `db:"objectid,pk" `
|
||||
SessionID omitnull.Val[string] `db:"session_id" `
|
||||
ShapeArea omitnull.Val[float64] `db:"shape__area" `
|
||||
ShapeLength omitnull.Val[float64] `db:"shape__length" `
|
||||
Treatdate omitnull.Val[int64] `db:"treatdate" `
|
||||
TreatID omitnull.Val[string] `db:"treat_id" `
|
||||
Type omitnull.Val[string] `db:"type" `
|
||||
Created omitnull.Val[time.Time] `db:"created" `
|
||||
CreatedDate omitnull.Val[int64] `db:"created_date" `
|
||||
CreatedUser omitnull.Val[string] `db:"created_user" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
}
|
||||
|
||||
func (s HistoryTreatmentareaSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 22)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals := make([]string, 0, 23)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Comments.IsUnset() {
|
||||
|
|
@ -207,6 +212,9 @@ func (s HistoryTreatmentareaSetter) SetColumns() []string {
|
|||
if !s.Type.IsUnset() {
|
||||
vals = append(vals, "type")
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
vals = append(vals, "created")
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals = append(vals, "created_date")
|
||||
}
|
||||
|
|
@ -232,8 +240,8 @@ func (s HistoryTreatmentareaSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s HistoryTreatmentareaSetter) Overwrite(t *HistoryTreatmentarea) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Comments.IsUnset() {
|
||||
t.Comments = s.Comments.MustGetNull()
|
||||
|
|
@ -277,6 +285,9 @@ func (s HistoryTreatmentareaSetter) Overwrite(t *HistoryTreatmentarea) {
|
|||
if !s.Type.IsUnset() {
|
||||
t.Type = s.Type.MustGetNull()
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
t.Created = s.Created.MustGetNull()
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
t.CreatedDate = s.CreatedDate.MustGetNull()
|
||||
}
|
||||
|
|
@ -306,9 +317,9 @@ func (s *HistoryTreatmentareaSetter) Apply(q *dialect.InsertQuery) {
|
|||
})
|
||||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 22)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
vals := make([]bob.Expression, 23)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -397,48 +408,54 @@ func (s *HistoryTreatmentareaSetter) Apply(q *dialect.InsertQuery) {
|
|||
vals[14] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[15] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
if !s.Created.IsUnset() {
|
||||
vals[15] = psql.Arg(s.Created.MustGetNull())
|
||||
} else {
|
||||
vals[15] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[16] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[16] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
} else {
|
||||
vals[16] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[17] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[17] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
} else {
|
||||
vals[17] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[18] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[18] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
} else {
|
||||
vals[18] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[19] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[19] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
} else {
|
||||
vals[19] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[20] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[20] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
} else {
|
||||
vals[20] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[21] = psql.Arg(s.Version.MustGet())
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[21] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
} else {
|
||||
vals[21] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[22] = psql.Arg(s.Version.MustGet())
|
||||
} else {
|
||||
vals[22] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
return bob.ExpressSlice(ctx, w, d, start, vals, "", ", ", "")
|
||||
}))
|
||||
}
|
||||
|
|
@ -448,9 +465,9 @@ func (s HistoryTreatmentareaSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery] {
|
|||
}
|
||||
|
||||
func (s HistoryTreatmentareaSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 22)
|
||||
exprs := make([]bob.Expression, 0, 23)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -555,6 +572,13 @@ func (s HistoryTreatmentareaSetter) Expressions(prefix ...string) []bob.Expressi
|
|||
}})
|
||||
}
|
||||
|
||||
if !s.Created.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created")...),
|
||||
psql.Arg(s.Created),
|
||||
}})
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created_date")...),
|
||||
|
|
@ -848,7 +872,7 @@ func (o *HistoryTreatmentarea) Organization(mods ...bob.Mod[*dialect.SelectQuery
|
|||
}
|
||||
|
||||
func (os HistoryTreatmentareaSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -866,7 +890,7 @@ func (os HistoryTreatmentareaSlice) Organization(mods ...bob.Mod[*dialect.Select
|
|||
|
||||
func attachHistoryTreatmentareaOrganization0(ctx context.Context, exec bob.Executor, count int, historyTreatmentarea0 *HistoryTreatmentarea, organization1 *Organization) (*HistoryTreatmentarea, error) {
|
||||
setter := &HistoryTreatmentareaSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := historyTreatmentarea0.Update(ctx, exec, setter)
|
||||
|
|
@ -913,7 +937,7 @@ func (historyTreatmentarea0 *HistoryTreatmentarea) AttachOrganization(ctx contex
|
|||
}
|
||||
|
||||
type historyTreatmentareaWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Comments psql.WhereNullMod[Q, string]
|
||||
Creationdate psql.WhereNullMod[Q, int64]
|
||||
Creator psql.WhereNullMod[Q, string]
|
||||
|
|
@ -928,6 +952,7 @@ type historyTreatmentareaWhere[Q psql.Filterable] struct {
|
|||
Treatdate psql.WhereNullMod[Q, int64]
|
||||
TreatID psql.WhereNullMod[Q, string]
|
||||
Type psql.WhereNullMod[Q, string]
|
||||
Created psql.WhereNullMod[Q, time.Time]
|
||||
CreatedDate psql.WhereNullMod[Q, int64]
|
||||
CreatedUser psql.WhereNullMod[Q, string]
|
||||
GeometryX psql.WhereNullMod[Q, float64]
|
||||
|
|
@ -943,7 +968,7 @@ func (historyTreatmentareaWhere[Q]) AliasedAs(alias string) historyTreatmentarea
|
|||
|
||||
func buildHistoryTreatmentareaWhere[Q psql.Filterable](cols historyTreatmentareaColumns) historyTreatmentareaWhere[Q] {
|
||||
return historyTreatmentareaWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Comments: psql.WhereNull[Q, string](cols.Comments),
|
||||
Creationdate: psql.WhereNull[Q, int64](cols.Creationdate),
|
||||
Creator: psql.WhereNull[Q, string](cols.Creator),
|
||||
|
|
@ -958,6 +983,7 @@ func buildHistoryTreatmentareaWhere[Q psql.Filterable](cols historyTreatmentarea
|
|||
Treatdate: psql.WhereNull[Q, int64](cols.Treatdate),
|
||||
TreatID: psql.WhereNull[Q, string](cols.TreatID),
|
||||
Type: psql.WhereNull[Q, string](cols.Type),
|
||||
Created: psql.WhereNull[Q, time.Time](cols.Created),
|
||||
CreatedDate: psql.WhereNull[Q, int64](cols.CreatedDate),
|
||||
CreatedUser: psql.WhereNull[Q, string](cols.CreatedUser),
|
||||
GeometryX: psql.WhereNull[Q, float64](cols.GeometryX),
|
||||
|
|
@ -1069,11 +1095,8 @@ func (os HistoryTreatmentareaSlice) LoadOrganization(ctx context.Context, exec b
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"time"
|
||||
|
||||
"github.com/aarondl/opt/null"
|
||||
"github.com/aarondl/opt/omit"
|
||||
|
|
@ -25,24 +26,25 @@ import (
|
|||
|
||||
// HistoryZone is an object representing the database table.
|
||||
type HistoryZone struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
Active null.Val[int64] `db:"active" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
Editor null.Val[string] `db:"editor" `
|
||||
Globalid null.Val[string] `db:"globalid" `
|
||||
Name null.Val[string] `db:"name" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
ShapeArea null.Val[float64] `db:"shape__area" `
|
||||
ShapeLength null.Val[float64] `db:"shape__length" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Version int32 `db:"version,pk" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Active null.Val[int64] `db:"active" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
Editor null.Val[string] `db:"editor" `
|
||||
Globalid null.Val[string] `db:"globalid" `
|
||||
Name null.Val[string] `db:"name" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
ShapeArea null.Val[float64] `db:"shape__area" `
|
||||
ShapeLength null.Val[float64] `db:"shape__length" `
|
||||
Created null.Val[time.Time] `db:"created" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Version int32 `db:"version,pk" `
|
||||
|
||||
R historyZoneR `db:"-" `
|
||||
}
|
||||
|
|
@ -65,7 +67,7 @@ type historyZoneR struct {
|
|||
func buildHistoryZoneColumns(alias string) historyZoneColumns {
|
||||
return historyZoneColumns{
|
||||
ColumnsExpr: expr.NewColumnsExpr(
|
||||
"organization_id", "active", "creationdate", "creator", "editdate", "editor", "globalid", "name", "objectid", "shape__area", "shape__length", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "version",
|
||||
"organization_id", "active", "creationdate", "creator", "editdate", "editor", "globalid", "name", "objectid", "shape__area", "shape__length", "created", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "version",
|
||||
).WithParent("history_zones"),
|
||||
tableAlias: alias,
|
||||
OrganizationID: psql.Quote(alias, "organization_id"),
|
||||
|
|
@ -79,6 +81,7 @@ func buildHistoryZoneColumns(alias string) historyZoneColumns {
|
|||
Objectid: psql.Quote(alias, "objectid"),
|
||||
ShapeArea: psql.Quote(alias, "shape__area"),
|
||||
ShapeLength: psql.Quote(alias, "shape__length"),
|
||||
Created: psql.Quote(alias, "created"),
|
||||
CreatedDate: psql.Quote(alias, "created_date"),
|
||||
CreatedUser: psql.Quote(alias, "created_user"),
|
||||
GeometryX: psql.Quote(alias, "geometry_x"),
|
||||
|
|
@ -103,6 +106,7 @@ type historyZoneColumns struct {
|
|||
Objectid psql.Expression
|
||||
ShapeArea psql.Expression
|
||||
ShapeLength psql.Expression
|
||||
Created psql.Expression
|
||||
CreatedDate psql.Expression
|
||||
CreatedUser psql.Expression
|
||||
GeometryX psql.Expression
|
||||
|
|
@ -124,29 +128,30 @@ func (historyZoneColumns) AliasedAs(alias string) historyZoneColumns {
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type HistoryZoneSetter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
Active omitnull.Val[int64] `db:"active" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
Editor omitnull.Val[string] `db:"editor" `
|
||||
Globalid omitnull.Val[string] `db:"globalid" `
|
||||
Name omitnull.Val[string] `db:"name" `
|
||||
Objectid omit.Val[int32] `db:"objectid,pk" `
|
||||
ShapeArea omitnull.Val[float64] `db:"shape__area" `
|
||||
ShapeLength omitnull.Val[float64] `db:"shape__length" `
|
||||
CreatedDate omitnull.Val[int64] `db:"created_date" `
|
||||
CreatedUser omitnull.Val[string] `db:"created_user" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Active omitnull.Val[int64] `db:"active" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
Editor omitnull.Val[string] `db:"editor" `
|
||||
Globalid omitnull.Val[string] `db:"globalid" `
|
||||
Name omitnull.Val[string] `db:"name" `
|
||||
Objectid omit.Val[int32] `db:"objectid,pk" `
|
||||
ShapeArea omitnull.Val[float64] `db:"shape__area" `
|
||||
ShapeLength omitnull.Val[float64] `db:"shape__length" `
|
||||
Created omitnull.Val[time.Time] `db:"created" `
|
||||
CreatedDate omitnull.Val[int64] `db:"created_date" `
|
||||
CreatedUser omitnull.Val[string] `db:"created_user" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
}
|
||||
|
||||
func (s HistoryZoneSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 18)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals := make([]string, 0, 19)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Active.IsUnset() {
|
||||
|
|
@ -179,6 +184,9 @@ func (s HistoryZoneSetter) SetColumns() []string {
|
|||
if !s.ShapeLength.IsUnset() {
|
||||
vals = append(vals, "shape__length")
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
vals = append(vals, "created")
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals = append(vals, "created_date")
|
||||
}
|
||||
|
|
@ -204,8 +212,8 @@ func (s HistoryZoneSetter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s HistoryZoneSetter) Overwrite(t *HistoryZone) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Active.IsUnset() {
|
||||
t.Active = s.Active.MustGetNull()
|
||||
|
|
@ -237,6 +245,9 @@ func (s HistoryZoneSetter) Overwrite(t *HistoryZone) {
|
|||
if !s.ShapeLength.IsUnset() {
|
||||
t.ShapeLength = s.ShapeLength.MustGetNull()
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
t.Created = s.Created.MustGetNull()
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
t.CreatedDate = s.CreatedDate.MustGetNull()
|
||||
}
|
||||
|
|
@ -266,9 +277,9 @@ func (s *HistoryZoneSetter) Apply(q *dialect.InsertQuery) {
|
|||
})
|
||||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 18)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
vals := make([]bob.Expression, 19)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -333,48 +344,54 @@ func (s *HistoryZoneSetter) Apply(q *dialect.InsertQuery) {
|
|||
vals[10] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[11] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
if !s.Created.IsUnset() {
|
||||
vals[11] = psql.Arg(s.Created.MustGetNull())
|
||||
} else {
|
||||
vals[11] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[12] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[12] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
} else {
|
||||
vals[12] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[13] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[13] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
} else {
|
||||
vals[13] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[14] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[14] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
} else {
|
||||
vals[14] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[15] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[15] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
} else {
|
||||
vals[15] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[16] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[16] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
} else {
|
||||
vals[16] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[17] = psql.Arg(s.Version.MustGet())
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[17] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
} else {
|
||||
vals[17] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[18] = psql.Arg(s.Version.MustGet())
|
||||
} else {
|
||||
vals[18] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
return bob.ExpressSlice(ctx, w, d, start, vals, "", ", ", "")
|
||||
}))
|
||||
}
|
||||
|
|
@ -384,9 +401,9 @@ func (s HistoryZoneSetter) UpdateMod() bob.Mod[*dialect.UpdateQuery] {
|
|||
}
|
||||
|
||||
func (s HistoryZoneSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 18)
|
||||
exprs := make([]bob.Expression, 0, 19)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -463,6 +480,13 @@ func (s HistoryZoneSetter) Expressions(prefix ...string) []bob.Expression {
|
|||
}})
|
||||
}
|
||||
|
||||
if !s.Created.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created")...),
|
||||
psql.Arg(s.Created),
|
||||
}})
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created_date")...),
|
||||
|
|
@ -756,7 +780,7 @@ func (o *HistoryZone) Organization(mods ...bob.Mod[*dialect.SelectQuery]) Organi
|
|||
}
|
||||
|
||||
func (os HistoryZoneSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -774,7 +798,7 @@ func (os HistoryZoneSlice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) O
|
|||
|
||||
func attachHistoryZoneOrganization0(ctx context.Context, exec bob.Executor, count int, historyZone0 *HistoryZone, organization1 *Organization) (*HistoryZone, error) {
|
||||
setter := &HistoryZoneSetter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := historyZone0.Update(ctx, exec, setter)
|
||||
|
|
@ -821,7 +845,7 @@ func (historyZone0 *HistoryZone) AttachOrganization(ctx context.Context, exec bo
|
|||
}
|
||||
|
||||
type historyZoneWhere[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Active psql.WhereNullMod[Q, int64]
|
||||
Creationdate psql.WhereNullMod[Q, int64]
|
||||
Creator psql.WhereNullMod[Q, string]
|
||||
|
|
@ -832,6 +856,7 @@ type historyZoneWhere[Q psql.Filterable] struct {
|
|||
Objectid psql.WhereMod[Q, int32]
|
||||
ShapeArea psql.WhereNullMod[Q, float64]
|
||||
ShapeLength psql.WhereNullMod[Q, float64]
|
||||
Created psql.WhereNullMod[Q, time.Time]
|
||||
CreatedDate psql.WhereNullMod[Q, int64]
|
||||
CreatedUser psql.WhereNullMod[Q, string]
|
||||
GeometryX psql.WhereNullMod[Q, float64]
|
||||
|
|
@ -847,7 +872,7 @@ func (historyZoneWhere[Q]) AliasedAs(alias string) historyZoneWhere[Q] {
|
|||
|
||||
func buildHistoryZoneWhere[Q psql.Filterable](cols historyZoneColumns) historyZoneWhere[Q] {
|
||||
return historyZoneWhere[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Active: psql.WhereNull[Q, int64](cols.Active),
|
||||
Creationdate: psql.WhereNull[Q, int64](cols.Creationdate),
|
||||
Creator: psql.WhereNull[Q, string](cols.Creator),
|
||||
|
|
@ -858,6 +883,7 @@ func buildHistoryZoneWhere[Q psql.Filterable](cols historyZoneColumns) historyZo
|
|||
Objectid: psql.Where[Q, int32](cols.Objectid),
|
||||
ShapeArea: psql.WhereNull[Q, float64](cols.ShapeArea),
|
||||
ShapeLength: psql.WhereNull[Q, float64](cols.ShapeLength),
|
||||
Created: psql.WhereNull[Q, time.Time](cols.Created),
|
||||
CreatedDate: psql.WhereNull[Q, int64](cols.CreatedDate),
|
||||
CreatedUser: psql.WhereNull[Q, string](cols.CreatedUser),
|
||||
GeometryX: psql.WhereNull[Q, float64](cols.GeometryX),
|
||||
|
|
@ -969,11 +995,8 @@ func (os HistoryZoneSlice) LoadOrganization(ctx context.Context, exec bob.Execut
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"time"
|
||||
|
||||
"github.com/aarondl/opt/null"
|
||||
"github.com/aarondl/opt/omit"
|
||||
|
|
@ -25,23 +26,24 @@ import (
|
|||
|
||||
// HistoryZones2 is an object representing the database table.
|
||||
type HistoryZones2 struct {
|
||||
OrganizationID null.Val[int32] `db:"organization_id" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
Editor null.Val[string] `db:"editor" `
|
||||
Globalid null.Val[string] `db:"globalid" `
|
||||
Name null.Val[string] `db:"name" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
ShapeArea null.Val[float64] `db:"shape__area" `
|
||||
ShapeLength null.Val[float64] `db:"shape__length" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Version int32 `db:"version,pk" `
|
||||
OrganizationID int32 `db:"organization_id" `
|
||||
Creationdate null.Val[int64] `db:"creationdate" `
|
||||
Creator null.Val[string] `db:"creator" `
|
||||
Editdate null.Val[int64] `db:"editdate" `
|
||||
Editor null.Val[string] `db:"editor" `
|
||||
Globalid null.Val[string] `db:"globalid" `
|
||||
Name null.Val[string] `db:"name" `
|
||||
Objectid int32 `db:"objectid,pk" `
|
||||
ShapeArea null.Val[float64] `db:"shape__area" `
|
||||
ShapeLength null.Val[float64] `db:"shape__length" `
|
||||
Created null.Val[time.Time] `db:"created" `
|
||||
CreatedDate null.Val[int64] `db:"created_date" `
|
||||
CreatedUser null.Val[string] `db:"created_user" `
|
||||
GeometryX null.Val[float64] `db:"geometry_x" `
|
||||
GeometryY null.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate null.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser null.Val[string] `db:"last_edited_user" `
|
||||
Version int32 `db:"version,pk" `
|
||||
|
||||
R historyZones2R `db:"-" `
|
||||
}
|
||||
|
|
@ -64,7 +66,7 @@ type historyZones2R struct {
|
|||
func buildHistoryZones2Columns(alias string) historyZones2Columns {
|
||||
return historyZones2Columns{
|
||||
ColumnsExpr: expr.NewColumnsExpr(
|
||||
"organization_id", "creationdate", "creator", "editdate", "editor", "globalid", "name", "objectid", "shape__area", "shape__length", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "version",
|
||||
"organization_id", "creationdate", "creator", "editdate", "editor", "globalid", "name", "objectid", "shape__area", "shape__length", "created", "created_date", "created_user", "geometry_x", "geometry_y", "last_edited_date", "last_edited_user", "version",
|
||||
).WithParent("history_zones2"),
|
||||
tableAlias: alias,
|
||||
OrganizationID: psql.Quote(alias, "organization_id"),
|
||||
|
|
@ -77,6 +79,7 @@ func buildHistoryZones2Columns(alias string) historyZones2Columns {
|
|||
Objectid: psql.Quote(alias, "objectid"),
|
||||
ShapeArea: psql.Quote(alias, "shape__area"),
|
||||
ShapeLength: psql.Quote(alias, "shape__length"),
|
||||
Created: psql.Quote(alias, "created"),
|
||||
CreatedDate: psql.Quote(alias, "created_date"),
|
||||
CreatedUser: psql.Quote(alias, "created_user"),
|
||||
GeometryX: psql.Quote(alias, "geometry_x"),
|
||||
|
|
@ -100,6 +103,7 @@ type historyZones2Columns struct {
|
|||
Objectid psql.Expression
|
||||
ShapeArea psql.Expression
|
||||
ShapeLength psql.Expression
|
||||
Created psql.Expression
|
||||
CreatedDate psql.Expression
|
||||
CreatedUser psql.Expression
|
||||
GeometryX psql.Expression
|
||||
|
|
@ -121,28 +125,29 @@ func (historyZones2Columns) AliasedAs(alias string) historyZones2Columns {
|
|||
// All values are optional, and do not have to be set
|
||||
// Generated columns are not included
|
||||
type HistoryZones2Setter struct {
|
||||
OrganizationID omitnull.Val[int32] `db:"organization_id" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
Editor omitnull.Val[string] `db:"editor" `
|
||||
Globalid omitnull.Val[string] `db:"globalid" `
|
||||
Name omitnull.Val[string] `db:"name" `
|
||||
Objectid omit.Val[int32] `db:"objectid,pk" `
|
||||
ShapeArea omitnull.Val[float64] `db:"shape__area" `
|
||||
ShapeLength omitnull.Val[float64] `db:"shape__length" `
|
||||
CreatedDate omitnull.Val[int64] `db:"created_date" `
|
||||
CreatedUser omitnull.Val[string] `db:"created_user" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
OrganizationID omit.Val[int32] `db:"organization_id" `
|
||||
Creationdate omitnull.Val[int64] `db:"creationdate" `
|
||||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Editdate omitnull.Val[int64] `db:"editdate" `
|
||||
Editor omitnull.Val[string] `db:"editor" `
|
||||
Globalid omitnull.Val[string] `db:"globalid" `
|
||||
Name omitnull.Val[string] `db:"name" `
|
||||
Objectid omit.Val[int32] `db:"objectid,pk" `
|
||||
ShapeArea omitnull.Val[float64] `db:"shape__area" `
|
||||
ShapeLength omitnull.Val[float64] `db:"shape__length" `
|
||||
Created omitnull.Val[time.Time] `db:"created" `
|
||||
CreatedDate omitnull.Val[int64] `db:"created_date" `
|
||||
CreatedUser omitnull.Val[string] `db:"created_user" `
|
||||
GeometryX omitnull.Val[float64] `db:"geometry_x" `
|
||||
GeometryY omitnull.Val[float64] `db:"geometry_y" `
|
||||
LastEditedDate omitnull.Val[int64] `db:"last_edited_date" `
|
||||
LastEditedUser omitnull.Val[string] `db:"last_edited_user" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
}
|
||||
|
||||
func (s HistoryZones2Setter) SetColumns() []string {
|
||||
vals := make([]string, 0, 17)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals := make([]string, 0, 18)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals = append(vals, "organization_id")
|
||||
}
|
||||
if !s.Creationdate.IsUnset() {
|
||||
|
|
@ -172,6 +177,9 @@ func (s HistoryZones2Setter) SetColumns() []string {
|
|||
if !s.ShapeLength.IsUnset() {
|
||||
vals = append(vals, "shape__length")
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
vals = append(vals, "created")
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals = append(vals, "created_date")
|
||||
}
|
||||
|
|
@ -197,8 +205,8 @@ func (s HistoryZones2Setter) SetColumns() []string {
|
|||
}
|
||||
|
||||
func (s HistoryZones2Setter) Overwrite(t *HistoryZones2) {
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
t.OrganizationID = s.OrganizationID.MustGetNull()
|
||||
if s.OrganizationID.IsValue() {
|
||||
t.OrganizationID = s.OrganizationID.MustGet()
|
||||
}
|
||||
if !s.Creationdate.IsUnset() {
|
||||
t.Creationdate = s.Creationdate.MustGetNull()
|
||||
|
|
@ -227,6 +235,9 @@ func (s HistoryZones2Setter) Overwrite(t *HistoryZones2) {
|
|||
if !s.ShapeLength.IsUnset() {
|
||||
t.ShapeLength = s.ShapeLength.MustGetNull()
|
||||
}
|
||||
if !s.Created.IsUnset() {
|
||||
t.Created = s.Created.MustGetNull()
|
||||
}
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
t.CreatedDate = s.CreatedDate.MustGetNull()
|
||||
}
|
||||
|
|
@ -256,9 +267,9 @@ func (s *HistoryZones2Setter) Apply(q *dialect.InsertQuery) {
|
|||
})
|
||||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.Writer, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 17)
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGetNull())
|
||||
vals := make([]bob.Expression, 18)
|
||||
if s.OrganizationID.IsValue() {
|
||||
vals[0] = psql.Arg(s.OrganizationID.MustGet())
|
||||
} else {
|
||||
vals[0] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
|
@ -317,48 +328,54 @@ func (s *HistoryZones2Setter) Apply(q *dialect.InsertQuery) {
|
|||
vals[9] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[10] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
if !s.Created.IsUnset() {
|
||||
vals[10] = psql.Arg(s.Created.MustGetNull())
|
||||
} else {
|
||||
vals[10] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[11] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
vals[11] = psql.Arg(s.CreatedDate.MustGetNull())
|
||||
} else {
|
||||
vals[11] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[12] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
if !s.CreatedUser.IsUnset() {
|
||||
vals[12] = psql.Arg(s.CreatedUser.MustGetNull())
|
||||
} else {
|
||||
vals[12] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[13] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
if !s.GeometryX.IsUnset() {
|
||||
vals[13] = psql.Arg(s.GeometryX.MustGetNull())
|
||||
} else {
|
||||
vals[13] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[14] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
if !s.GeometryY.IsUnset() {
|
||||
vals[14] = psql.Arg(s.GeometryY.MustGetNull())
|
||||
} else {
|
||||
vals[14] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[15] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
if !s.LastEditedDate.IsUnset() {
|
||||
vals[15] = psql.Arg(s.LastEditedDate.MustGetNull())
|
||||
} else {
|
||||
vals[15] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[16] = psql.Arg(s.Version.MustGet())
|
||||
if !s.LastEditedUser.IsUnset() {
|
||||
vals[16] = psql.Arg(s.LastEditedUser.MustGetNull())
|
||||
} else {
|
||||
vals[16] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[17] = psql.Arg(s.Version.MustGet())
|
||||
} else {
|
||||
vals[17] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
return bob.ExpressSlice(ctx, w, d, start, vals, "", ", ", "")
|
||||
}))
|
||||
}
|
||||
|
|
@ -368,9 +385,9 @@ func (s HistoryZones2Setter) UpdateMod() bob.Mod[*dialect.UpdateQuery] {
|
|||
}
|
||||
|
||||
func (s HistoryZones2Setter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 17)
|
||||
exprs := make([]bob.Expression, 0, 18)
|
||||
|
||||
if !s.OrganizationID.IsUnset() {
|
||||
if s.OrganizationID.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "organization_id")...),
|
||||
psql.Arg(s.OrganizationID),
|
||||
|
|
@ -440,6 +457,13 @@ func (s HistoryZones2Setter) Expressions(prefix ...string) []bob.Expression {
|
|||
}})
|
||||
}
|
||||
|
||||
if !s.Created.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created")...),
|
||||
psql.Arg(s.Created),
|
||||
}})
|
||||
}
|
||||
|
||||
if !s.CreatedDate.IsUnset() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "created_date")...),
|
||||
|
|
@ -733,7 +757,7 @@ func (o *HistoryZones2) Organization(mods ...bob.Mod[*dialect.SelectQuery]) Orga
|
|||
}
|
||||
|
||||
func (os HistoryZones2Slice) Organization(mods ...bob.Mod[*dialect.SelectQuery]) OrganizationsQuery {
|
||||
pkOrganizationID := make(pgtypes.Array[null.Val[int32]], 0, len(os))
|
||||
pkOrganizationID := make(pgtypes.Array[int32], 0, len(os))
|
||||
for _, o := range os {
|
||||
if o == nil {
|
||||
continue
|
||||
|
|
@ -751,7 +775,7 @@ func (os HistoryZones2Slice) Organization(mods ...bob.Mod[*dialect.SelectQuery])
|
|||
|
||||
func attachHistoryZones2Organization0(ctx context.Context, exec bob.Executor, count int, historyZones20 *HistoryZones2, organization1 *Organization) (*HistoryZones2, error) {
|
||||
setter := &HistoryZones2Setter{
|
||||
OrganizationID: omitnull.From(organization1.ID),
|
||||
OrganizationID: omit.From(organization1.ID),
|
||||
}
|
||||
|
||||
err := historyZones20.Update(ctx, exec, setter)
|
||||
|
|
@ -798,7 +822,7 @@ func (historyZones20 *HistoryZones2) AttachOrganization(ctx context.Context, exe
|
|||
}
|
||||
|
||||
type historyZones2Where[Q psql.Filterable] struct {
|
||||
OrganizationID psql.WhereNullMod[Q, int32]
|
||||
OrganizationID psql.WhereMod[Q, int32]
|
||||
Creationdate psql.WhereNullMod[Q, int64]
|
||||
Creator psql.WhereNullMod[Q, string]
|
||||
Editdate psql.WhereNullMod[Q, int64]
|
||||
|
|
@ -808,6 +832,7 @@ type historyZones2Where[Q psql.Filterable] struct {
|
|||
Objectid psql.WhereMod[Q, int32]
|
||||
ShapeArea psql.WhereNullMod[Q, float64]
|
||||
ShapeLength psql.WhereNullMod[Q, float64]
|
||||
Created psql.WhereNullMod[Q, time.Time]
|
||||
CreatedDate psql.WhereNullMod[Q, int64]
|
||||
CreatedUser psql.WhereNullMod[Q, string]
|
||||
GeometryX psql.WhereNullMod[Q, float64]
|
||||
|
|
@ -823,7 +848,7 @@ func (historyZones2Where[Q]) AliasedAs(alias string) historyZones2Where[Q] {
|
|||
|
||||
func buildHistoryZones2Where[Q psql.Filterable](cols historyZones2Columns) historyZones2Where[Q] {
|
||||
return historyZones2Where[Q]{
|
||||
OrganizationID: psql.WhereNull[Q, int32](cols.OrganizationID),
|
||||
OrganizationID: psql.Where[Q, int32](cols.OrganizationID),
|
||||
Creationdate: psql.WhereNull[Q, int64](cols.Creationdate),
|
||||
Creator: psql.WhereNull[Q, string](cols.Creator),
|
||||
Editdate: psql.WhereNull[Q, int64](cols.Editdate),
|
||||
|
|
@ -833,6 +858,7 @@ func buildHistoryZones2Where[Q psql.Filterable](cols historyZones2Columns) histo
|
|||
Objectid: psql.Where[Q, int32](cols.Objectid),
|
||||
ShapeArea: psql.WhereNull[Q, float64](cols.ShapeArea),
|
||||
ShapeLength: psql.WhereNull[Q, float64](cols.ShapeLength),
|
||||
Created: psql.WhereNull[Q, time.Time](cols.Created),
|
||||
CreatedDate: psql.WhereNull[Q, int64](cols.CreatedDate),
|
||||
CreatedUser: psql.WhereNull[Q, string](cols.CreatedUser),
|
||||
GeometryX: psql.WhereNull[Q, float64](cols.GeometryX),
|
||||
|
|
@ -944,11 +970,8 @@ func (os HistoryZones2Slice) LoadOrganization(ctx context.Context, exec bob.Exec
|
|||
}
|
||||
|
||||
for _, rel := range organizations {
|
||||
if !o.OrganizationID.IsValue() {
|
||||
continue
|
||||
}
|
||||
|
||||
if !(o.OrganizationID.IsValue() && o.OrganizationID.MustGet() == rel.ID) {
|
||||
if !(o.OrganizationID == rel.ID) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue