Initially made it through full update with new fieldseeker schema
This commit is contained in:
parent
0904f086b2
commit
bd16f69e28
510 changed files with 13617 additions and 14851 deletions
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by BobGen psql v0.42.0. DO NOT EDIT.
|
||||
// Code generated by BobGen psql v0.0.3-0.20251202003046-49148fc66a73+dirty. DO NOT EDIT.
|
||||
// This file is meant to be re-generated in place and/or deleted at any time.
|
||||
|
||||
package models
|
||||
|
|
@ -37,6 +37,8 @@ type FieldseekerZones2 struct {
|
|||
Editor null.Val[string] `db:"editor" `
|
||||
ShapeArea null.Val[float64] `db:"shape__area" `
|
||||
ShapeLength null.Val[float64] `db:"shape__length" `
|
||||
// Tracks version changes to the row. Increases when data is modified.
|
||||
Version int32 `db:"version,pk" `
|
||||
}
|
||||
|
||||
// FieldseekerZones2Slice is an alias for a slice of pointers to FieldseekerZones2.
|
||||
|
|
@ -52,7 +54,7 @@ type FieldseekerZones2sQuery = *psql.ViewQuery[*FieldseekerZones2, FieldseekerZo
|
|||
func buildFieldseekerZones2Columns(alias string) fieldseekerZones2Columns {
|
||||
return fieldseekerZones2Columns{
|
||||
ColumnsExpr: expr.NewColumnsExpr(
|
||||
"objectid", "name", "globalid", "created_user", "created_date", "last_edited_user", "last_edited_date", "creationdate", "creator", "editdate", "editor", "shape__area", "shape__length",
|
||||
"objectid", "name", "globalid", "created_user", "created_date", "last_edited_user", "last_edited_date", "creationdate", "creator", "editdate", "editor", "shape__area", "shape__length", "version",
|
||||
).WithParent("fieldseeker.zones2"),
|
||||
tableAlias: alias,
|
||||
Objectid: psql.Quote(alias, "objectid"),
|
||||
|
|
@ -68,6 +70,7 @@ func buildFieldseekerZones2Columns(alias string) fieldseekerZones2Columns {
|
|||
Editor: psql.Quote(alias, "editor"),
|
||||
ShapeArea: psql.Quote(alias, "shape__area"),
|
||||
ShapeLength: psql.Quote(alias, "shape__length"),
|
||||
Version: psql.Quote(alias, "version"),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -87,6 +90,7 @@ type fieldseekerZones2Columns struct {
|
|||
Editor psql.Expression
|
||||
ShapeArea psql.Expression
|
||||
ShapeLength psql.Expression
|
||||
Version psql.Expression
|
||||
}
|
||||
|
||||
func (c fieldseekerZones2Columns) Alias() string {
|
||||
|
|
@ -114,10 +118,11 @@ type FieldseekerZones2Setter struct {
|
|||
Editor omitnull.Val[string] `db:"editor" `
|
||||
ShapeArea omitnull.Val[float64] `db:"shape__area" `
|
||||
ShapeLength omitnull.Val[float64] `db:"shape__length" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
}
|
||||
|
||||
func (s FieldseekerZones2Setter) SetColumns() []string {
|
||||
vals := make([]string, 0, 13)
|
||||
vals := make([]string, 0, 14)
|
||||
if s.Objectid.IsValue() {
|
||||
vals = append(vals, "objectid")
|
||||
}
|
||||
|
|
@ -157,6 +162,9 @@ func (s FieldseekerZones2Setter) SetColumns() []string {
|
|||
if !s.ShapeLength.IsUnset() {
|
||||
vals = append(vals, "shape__length")
|
||||
}
|
||||
if s.Version.IsValue() {
|
||||
vals = append(vals, "version")
|
||||
}
|
||||
return vals
|
||||
}
|
||||
|
||||
|
|
@ -200,6 +208,9 @@ func (s FieldseekerZones2Setter) Overwrite(t *FieldseekerZones2) {
|
|||
if !s.ShapeLength.IsUnset() {
|
||||
t.ShapeLength = s.ShapeLength.MustGetNull()
|
||||
}
|
||||
if s.Version.IsValue() {
|
||||
t.Version = s.Version.MustGet()
|
||||
}
|
||||
}
|
||||
|
||||
func (s *FieldseekerZones2Setter) Apply(q *dialect.InsertQuery) {
|
||||
|
|
@ -208,7 +219,7 @@ func (s *FieldseekerZones2Setter) Apply(q *dialect.InsertQuery) {
|
|||
})
|
||||
|
||||
q.AppendValues(bob.ExpressionFunc(func(ctx context.Context, w io.StringWriter, d bob.Dialect, start int) ([]any, error) {
|
||||
vals := make([]bob.Expression, 13)
|
||||
vals := make([]bob.Expression, 14)
|
||||
if s.Objectid.IsValue() {
|
||||
vals[0] = psql.Arg(s.Objectid.MustGet())
|
||||
} else {
|
||||
|
|
@ -287,6 +298,12 @@ func (s *FieldseekerZones2Setter) Apply(q *dialect.InsertQuery) {
|
|||
vals[12] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[13] = psql.Arg(s.Version.MustGet())
|
||||
} else {
|
||||
vals[13] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
return bob.ExpressSlice(ctx, w, d, start, vals, "", ", ", "")
|
||||
}))
|
||||
}
|
||||
|
|
@ -296,7 +313,7 @@ func (s FieldseekerZones2Setter) UpdateMod() bob.Mod[*dialect.UpdateQuery] {
|
|||
}
|
||||
|
||||
func (s FieldseekerZones2Setter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 13)
|
||||
exprs := make([]bob.Expression, 0, 14)
|
||||
|
||||
if s.Objectid.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
|
|
@ -389,28 +406,38 @@ func (s FieldseekerZones2Setter) Expressions(prefix ...string) []bob.Expression
|
|||
}})
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "version")...),
|
||||
psql.Arg(s.Version),
|
||||
}})
|
||||
}
|
||||
|
||||
return exprs
|
||||
}
|
||||
|
||||
// FindFieldseekerZones2 retrieves a single record by primary key
|
||||
// If cols is empty Find will return all columns.
|
||||
func FindFieldseekerZones2(ctx context.Context, exec bob.Executor, ObjectidPK int64, cols ...string) (*FieldseekerZones2, error) {
|
||||
func FindFieldseekerZones2(ctx context.Context, exec bob.Executor, ObjectidPK int64, VersionPK int32, cols ...string) (*FieldseekerZones2, error) {
|
||||
if len(cols) == 0 {
|
||||
return FieldseekerZones2s.Query(
|
||||
sm.Where(FieldseekerZones2s.Columns.Objectid.EQ(psql.Arg(ObjectidPK))),
|
||||
sm.Where(FieldseekerZones2s.Columns.Version.EQ(psql.Arg(VersionPK))),
|
||||
).One(ctx, exec)
|
||||
}
|
||||
|
||||
return FieldseekerZones2s.Query(
|
||||
sm.Where(FieldseekerZones2s.Columns.Objectid.EQ(psql.Arg(ObjectidPK))),
|
||||
sm.Where(FieldseekerZones2s.Columns.Version.EQ(psql.Arg(VersionPK))),
|
||||
sm.Columns(FieldseekerZones2s.Columns.Only(cols...)),
|
||||
).One(ctx, exec)
|
||||
}
|
||||
|
||||
// FieldseekerZones2Exists checks the presence of a single record by primary key
|
||||
func FieldseekerZones2Exists(ctx context.Context, exec bob.Executor, ObjectidPK int64) (bool, error) {
|
||||
func FieldseekerZones2Exists(ctx context.Context, exec bob.Executor, ObjectidPK int64, VersionPK int32) (bool, error) {
|
||||
return FieldseekerZones2s.Query(
|
||||
sm.Where(FieldseekerZones2s.Columns.Objectid.EQ(psql.Arg(ObjectidPK))),
|
||||
sm.Where(FieldseekerZones2s.Columns.Version.EQ(psql.Arg(VersionPK))),
|
||||
).Exists(ctx, exec)
|
||||
}
|
||||
|
||||
|
|
@ -434,11 +461,14 @@ func (o *FieldseekerZones2) AfterQueryHook(ctx context.Context, exec bob.Executo
|
|||
|
||||
// primaryKeyVals returns the primary key values of the FieldseekerZones2
|
||||
func (o *FieldseekerZones2) primaryKeyVals() bob.Expression {
|
||||
return psql.Arg(o.Objectid)
|
||||
return psql.ArgGroup(
|
||||
o.Objectid,
|
||||
o.Version,
|
||||
)
|
||||
}
|
||||
|
||||
func (o *FieldseekerZones2) pkEQ() dialect.Expression {
|
||||
return psql.Quote("fieldseeker.zones2", "objectid").EQ(bob.ExpressionFunc(func(ctx context.Context, w io.StringWriter, d bob.Dialect, start int) ([]any, error) {
|
||||
return psql.Group(psql.Quote("fieldseeker.zones2", "objectid"), psql.Quote("fieldseeker.zones2", "version")).EQ(bob.ExpressionFunc(func(ctx context.Context, w io.StringWriter, d bob.Dialect, start int) ([]any, error) {
|
||||
return o.primaryKeyVals().WriteSQL(ctx, w, d, start)
|
||||
}))
|
||||
}
|
||||
|
|
@ -465,6 +495,7 @@ func (o *FieldseekerZones2) Delete(ctx context.Context, exec bob.Executor) error
|
|||
func (o *FieldseekerZones2) Reload(ctx context.Context, exec bob.Executor) error {
|
||||
o2, err := FieldseekerZones2s.Query(
|
||||
sm.Where(FieldseekerZones2s.Columns.Objectid.EQ(psql.Arg(o.Objectid))),
|
||||
sm.Where(FieldseekerZones2s.Columns.Version.EQ(psql.Arg(o.Version))),
|
||||
).One(ctx, exec)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
@ -498,7 +529,7 @@ func (o FieldseekerZones2Slice) pkIN() dialect.Expression {
|
|||
return psql.Raw("NULL")
|
||||
}
|
||||
|
||||
return psql.Quote("fieldseeker.zones2", "objectid").In(bob.ExpressionFunc(func(ctx context.Context, w io.StringWriter, d bob.Dialect, start int) ([]any, error) {
|
||||
return psql.Group(psql.Quote("fieldseeker.zones2", "objectid"), psql.Quote("fieldseeker.zones2", "version")).In(bob.ExpressionFunc(func(ctx context.Context, w io.StringWriter, d bob.Dialect, start int) ([]any, error) {
|
||||
pkPairs := make([]bob.Expression, len(o))
|
||||
for i, row := range o {
|
||||
pkPairs[i] = row.primaryKeyVals()
|
||||
|
|
@ -516,6 +547,9 @@ func (o FieldseekerZones2Slice) copyMatchingRows(from ...*FieldseekerZones2) {
|
|||
if new.Objectid != old.Objectid {
|
||||
continue
|
||||
}
|
||||
if new.Version != old.Version {
|
||||
continue
|
||||
}
|
||||
|
||||
o[i] = new
|
||||
break
|
||||
|
|
@ -628,6 +662,7 @@ type fieldseekerZones2Where[Q psql.Filterable] struct {
|
|||
Editor psql.WhereNullMod[Q, string]
|
||||
ShapeArea psql.WhereNullMod[Q, float64]
|
||||
ShapeLength psql.WhereNullMod[Q, float64]
|
||||
Version psql.WhereMod[Q, int32]
|
||||
}
|
||||
|
||||
func (fieldseekerZones2Where[Q]) AliasedAs(alias string) fieldseekerZones2Where[Q] {
|
||||
|
|
@ -649,5 +684,6 @@ func buildFieldseekerZones2Where[Q psql.Filterable](cols fieldseekerZones2Column
|
|||
Editor: psql.WhereNull[Q, string](cols.Editor),
|
||||
ShapeArea: psql.WhereNull[Q, float64](cols.ShapeArea),
|
||||
ShapeLength: psql.WhereNull[Q, float64](cols.ShapeLength),
|
||||
Version: psql.Where[Q, int32](cols.Version),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue