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
|
||||
|
|
@ -36,6 +36,8 @@ type FieldseekerFieldscoutinglog struct {
|
|||
Creator null.Val[string] `db:"creator" `
|
||||
Editdate null.Val[time.Time] `db:"editdate" `
|
||||
Editor null.Val[string] `db:"editor" `
|
||||
// Tracks version changes to the row. Increases when data is modified.
|
||||
Version int32 `db:"version,pk" `
|
||||
}
|
||||
|
||||
// FieldseekerFieldscoutinglogSlice is an alias for a slice of pointers to FieldseekerFieldscoutinglog.
|
||||
|
|
@ -51,7 +53,7 @@ type FieldseekerFieldscoutinglogsQuery = *psql.ViewQuery[*FieldseekerFieldscouti
|
|||
func buildFieldseekerFieldscoutinglogColumns(alias string) fieldseekerFieldscoutinglogColumns {
|
||||
return fieldseekerFieldscoutinglogColumns{
|
||||
ColumnsExpr: expr.NewColumnsExpr(
|
||||
"objectid", "status", "globalid", "created_user", "created_date", "last_edited_user", "last_edited_date", "creationdate", "creator", "editdate", "editor",
|
||||
"objectid", "status", "globalid", "created_user", "created_date", "last_edited_user", "last_edited_date", "creationdate", "creator", "editdate", "editor", "version",
|
||||
).WithParent("fieldseeker.fieldscoutinglog"),
|
||||
tableAlias: alias,
|
||||
Objectid: psql.Quote(alias, "objectid"),
|
||||
|
|
@ -65,6 +67,7 @@ func buildFieldseekerFieldscoutinglogColumns(alias string) fieldseekerFieldscout
|
|||
Creator: psql.Quote(alias, "creator"),
|
||||
Editdate: psql.Quote(alias, "editdate"),
|
||||
Editor: psql.Quote(alias, "editor"),
|
||||
Version: psql.Quote(alias, "version"),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -82,6 +85,7 @@ type fieldseekerFieldscoutinglogColumns struct {
|
|||
Creator psql.Expression
|
||||
Editdate psql.Expression
|
||||
Editor psql.Expression
|
||||
Version psql.Expression
|
||||
}
|
||||
|
||||
func (c fieldseekerFieldscoutinglogColumns) Alias() string {
|
||||
|
|
@ -107,10 +111,11 @@ type FieldseekerFieldscoutinglogSetter struct {
|
|||
Creator omitnull.Val[string] `db:"creator" `
|
||||
Editdate omitnull.Val[time.Time] `db:"editdate" `
|
||||
Editor omitnull.Val[string] `db:"editor" `
|
||||
Version omit.Val[int32] `db:"version,pk" `
|
||||
}
|
||||
|
||||
func (s FieldseekerFieldscoutinglogSetter) SetColumns() []string {
|
||||
vals := make([]string, 0, 11)
|
||||
vals := make([]string, 0, 12)
|
||||
if s.Objectid.IsValue() {
|
||||
vals = append(vals, "objectid")
|
||||
}
|
||||
|
|
@ -144,6 +149,9 @@ func (s FieldseekerFieldscoutinglogSetter) SetColumns() []string {
|
|||
if !s.Editor.IsUnset() {
|
||||
vals = append(vals, "editor")
|
||||
}
|
||||
if s.Version.IsValue() {
|
||||
vals = append(vals, "version")
|
||||
}
|
||||
return vals
|
||||
}
|
||||
|
||||
|
|
@ -181,6 +189,9 @@ func (s FieldseekerFieldscoutinglogSetter) Overwrite(t *FieldseekerFieldscouting
|
|||
if !s.Editor.IsUnset() {
|
||||
t.Editor = s.Editor.MustGetNull()
|
||||
}
|
||||
if s.Version.IsValue() {
|
||||
t.Version = s.Version.MustGet()
|
||||
}
|
||||
}
|
||||
|
||||
func (s *FieldseekerFieldscoutinglogSetter) Apply(q *dialect.InsertQuery) {
|
||||
|
|
@ -189,7 +200,7 @@ func (s *FieldseekerFieldscoutinglogSetter) 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, 11)
|
||||
vals := make([]bob.Expression, 12)
|
||||
if s.Objectid.IsValue() {
|
||||
vals[0] = psql.Arg(s.Objectid.MustGet())
|
||||
} else {
|
||||
|
|
@ -256,6 +267,12 @@ func (s *FieldseekerFieldscoutinglogSetter) Apply(q *dialect.InsertQuery) {
|
|||
vals[10] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
vals[11] = psql.Arg(s.Version.MustGet())
|
||||
} else {
|
||||
vals[11] = psql.Raw("DEFAULT")
|
||||
}
|
||||
|
||||
return bob.ExpressSlice(ctx, w, d, start, vals, "", ", ", "")
|
||||
}))
|
||||
}
|
||||
|
|
@ -265,7 +282,7 @@ func (s FieldseekerFieldscoutinglogSetter) UpdateMod() bob.Mod[*dialect.UpdateQu
|
|||
}
|
||||
|
||||
func (s FieldseekerFieldscoutinglogSetter) Expressions(prefix ...string) []bob.Expression {
|
||||
exprs := make([]bob.Expression, 0, 11)
|
||||
exprs := make([]bob.Expression, 0, 12)
|
||||
|
||||
if s.Objectid.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
|
|
@ -344,28 +361,38 @@ func (s FieldseekerFieldscoutinglogSetter) Expressions(prefix ...string) []bob.E
|
|||
}})
|
||||
}
|
||||
|
||||
if s.Version.IsValue() {
|
||||
exprs = append(exprs, expr.Join{Sep: " = ", Exprs: []bob.Expression{
|
||||
psql.Quote(append(prefix, "version")...),
|
||||
psql.Arg(s.Version),
|
||||
}})
|
||||
}
|
||||
|
||||
return exprs
|
||||
}
|
||||
|
||||
// FindFieldseekerFieldscoutinglog retrieves a single record by primary key
|
||||
// If cols is empty Find will return all columns.
|
||||
func FindFieldseekerFieldscoutinglog(ctx context.Context, exec bob.Executor, ObjectidPK int64, cols ...string) (*FieldseekerFieldscoutinglog, error) {
|
||||
func FindFieldseekerFieldscoutinglog(ctx context.Context, exec bob.Executor, ObjectidPK int64, VersionPK int32, cols ...string) (*FieldseekerFieldscoutinglog, error) {
|
||||
if len(cols) == 0 {
|
||||
return FieldseekerFieldscoutinglogs.Query(
|
||||
sm.Where(FieldseekerFieldscoutinglogs.Columns.Objectid.EQ(psql.Arg(ObjectidPK))),
|
||||
sm.Where(FieldseekerFieldscoutinglogs.Columns.Version.EQ(psql.Arg(VersionPK))),
|
||||
).One(ctx, exec)
|
||||
}
|
||||
|
||||
return FieldseekerFieldscoutinglogs.Query(
|
||||
sm.Where(FieldseekerFieldscoutinglogs.Columns.Objectid.EQ(psql.Arg(ObjectidPK))),
|
||||
sm.Where(FieldseekerFieldscoutinglogs.Columns.Version.EQ(psql.Arg(VersionPK))),
|
||||
sm.Columns(FieldseekerFieldscoutinglogs.Columns.Only(cols...)),
|
||||
).One(ctx, exec)
|
||||
}
|
||||
|
||||
// FieldseekerFieldscoutinglogExists checks the presence of a single record by primary key
|
||||
func FieldseekerFieldscoutinglogExists(ctx context.Context, exec bob.Executor, ObjectidPK int64) (bool, error) {
|
||||
func FieldseekerFieldscoutinglogExists(ctx context.Context, exec bob.Executor, ObjectidPK int64, VersionPK int32) (bool, error) {
|
||||
return FieldseekerFieldscoutinglogs.Query(
|
||||
sm.Where(FieldseekerFieldscoutinglogs.Columns.Objectid.EQ(psql.Arg(ObjectidPK))),
|
||||
sm.Where(FieldseekerFieldscoutinglogs.Columns.Version.EQ(psql.Arg(VersionPK))),
|
||||
).Exists(ctx, exec)
|
||||
}
|
||||
|
||||
|
|
@ -389,11 +416,14 @@ func (o *FieldseekerFieldscoutinglog) AfterQueryHook(ctx context.Context, exec b
|
|||
|
||||
// primaryKeyVals returns the primary key values of the FieldseekerFieldscoutinglog
|
||||
func (o *FieldseekerFieldscoutinglog) primaryKeyVals() bob.Expression {
|
||||
return psql.Arg(o.Objectid)
|
||||
return psql.ArgGroup(
|
||||
o.Objectid,
|
||||
o.Version,
|
||||
)
|
||||
}
|
||||
|
||||
func (o *FieldseekerFieldscoutinglog) pkEQ() dialect.Expression {
|
||||
return psql.Quote("fieldseeker.fieldscoutinglog", "objectid").EQ(bob.ExpressionFunc(func(ctx context.Context, w io.StringWriter, d bob.Dialect, start int) ([]any, error) {
|
||||
return psql.Group(psql.Quote("fieldseeker.fieldscoutinglog", "objectid"), psql.Quote("fieldseeker.fieldscoutinglog", "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)
|
||||
}))
|
||||
}
|
||||
|
|
@ -420,6 +450,7 @@ func (o *FieldseekerFieldscoutinglog) Delete(ctx context.Context, exec bob.Execu
|
|||
func (o *FieldseekerFieldscoutinglog) Reload(ctx context.Context, exec bob.Executor) error {
|
||||
o2, err := FieldseekerFieldscoutinglogs.Query(
|
||||
sm.Where(FieldseekerFieldscoutinglogs.Columns.Objectid.EQ(psql.Arg(o.Objectid))),
|
||||
sm.Where(FieldseekerFieldscoutinglogs.Columns.Version.EQ(psql.Arg(o.Version))),
|
||||
).One(ctx, exec)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
@ -453,7 +484,7 @@ func (o FieldseekerFieldscoutinglogSlice) pkIN() dialect.Expression {
|
|||
return psql.Raw("NULL")
|
||||
}
|
||||
|
||||
return psql.Quote("fieldseeker.fieldscoutinglog", "objectid").In(bob.ExpressionFunc(func(ctx context.Context, w io.StringWriter, d bob.Dialect, start int) ([]any, error) {
|
||||
return psql.Group(psql.Quote("fieldseeker.fieldscoutinglog", "objectid"), psql.Quote("fieldseeker.fieldscoutinglog", "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()
|
||||
|
|
@ -471,6 +502,9 @@ func (o FieldseekerFieldscoutinglogSlice) copyMatchingRows(from ...*FieldseekerF
|
|||
if new.Objectid != old.Objectid {
|
||||
continue
|
||||
}
|
||||
if new.Version != old.Version {
|
||||
continue
|
||||
}
|
||||
|
||||
o[i] = new
|
||||
break
|
||||
|
|
@ -581,6 +615,7 @@ type fieldseekerFieldscoutinglogWhere[Q psql.Filterable] struct {
|
|||
Creator psql.WhereNullMod[Q, string]
|
||||
Editdate psql.WhereNullMod[Q, time.Time]
|
||||
Editor psql.WhereNullMod[Q, string]
|
||||
Version psql.WhereMod[Q, int32]
|
||||
}
|
||||
|
||||
func (fieldseekerFieldscoutinglogWhere[Q]) AliasedAs(alias string) fieldseekerFieldscoutinglogWhere[Q] {
|
||||
|
|
@ -600,5 +635,6 @@ func buildFieldseekerFieldscoutinglogWhere[Q psql.Filterable](cols fieldseekerFi
|
|||
Creator: psql.WhereNull[Q, string](cols.Creator),
|
||||
Editdate: psql.WhereNull[Q, time.Time](cols.Editdate),
|
||||
Editor: psql.WhereNull[Q, string](cols.Editor),
|
||||
Version: psql.Where[Q, int32](cols.Version),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue