nidus-sync/db/models/publicreport.report_location.bob.go
Eli Ribble 06140a9062
Remove bob submodule, add arcgis.user
I had to remove the submodule because of the go bug at
https://github.com/golang/go/issues/77196
I found the bug because of a bug in bob itself
https://github.com/stephenafamo/bob/issues/610
This was because I'm trying to save data about the Arcgis user for use
in determining if I can set up hooks to avoid the polling for data
changes.
2026-01-15 19:20:39 +00:00

122 lines
4.8 KiB
Go

// Code generated by BobGen psql v0.42.1. DO NOT EDIT.
// This file is meant to be re-generated in place and/or deleted at any time.
package models
import (
"context"
"time"
enums "github.com/Gleipnir-Technology/nidus-sync/db/enums"
"github.com/aarondl/opt/null"
"github.com/stephenafamo/bob"
"github.com/stephenafamo/bob/dialect/psql"
"github.com/stephenafamo/bob/expr"
)
// PublicreportReportLocation is an object representing the database table.
type PublicreportReportLocation struct {
ID null.Val[int64] `db:"id" `
TableName null.Val[string] `db:"table_name" `
Address null.Val[string] `db:"address" `
Created null.Val[time.Time] `db:"created" `
Location null.Val[string] `db:"location" `
PublicID null.Val[string] `db:"public_id" `
Status null.Val[enums.PublicreportReportstatustype] `db:"status" `
}
// PublicreportReportLocationSlice is an alias for a slice of pointers to PublicreportReportLocation.
// This should almost always be used instead of []*PublicreportReportLocation.
type PublicreportReportLocationSlice []*PublicreportReportLocation
// PublicreportReportLocations contains methods to work with the report_location view
var PublicreportReportLocations = psql.NewViewx[*PublicreportReportLocation, PublicreportReportLocationSlice]("publicreport", "report_location", buildPublicreportReportLocationColumns("publicreport.report_location"))
// PublicreportReportLocationsQuery is a query on the report_location view
type PublicreportReportLocationsQuery = *psql.ViewQuery[*PublicreportReportLocation, PublicreportReportLocationSlice]
func buildPublicreportReportLocationColumns(alias string) publicreportReportLocationColumns {
return publicreportReportLocationColumns{
ColumnsExpr: expr.NewColumnsExpr(
"id", "table_name", "address", "created", "location", "public_id", "status",
).WithParent("publicreport.report_location"),
tableAlias: alias,
ID: psql.Quote(alias, "id"),
TableName: psql.Quote(alias, "table_name"),
Address: psql.Quote(alias, "address"),
Created: psql.Quote(alias, "created"),
Location: psql.Quote(alias, "location"),
PublicID: psql.Quote(alias, "public_id"),
Status: psql.Quote(alias, "status"),
}
}
type publicreportReportLocationColumns struct {
expr.ColumnsExpr
tableAlias string
ID psql.Expression
TableName psql.Expression
Address psql.Expression
Created psql.Expression
Location psql.Expression
PublicID psql.Expression
Status psql.Expression
}
func (c publicreportReportLocationColumns) Alias() string {
return c.tableAlias
}
func (publicreportReportLocationColumns) AliasedAs(alias string) publicreportReportLocationColumns {
return buildPublicreportReportLocationColumns(alias)
}
// AfterQueryHook is called after PublicreportReportLocation is retrieved from the database
func (o *PublicreportReportLocation) AfterQueryHook(ctx context.Context, exec bob.Executor, queryType bob.QueryType) error {
var err error
switch queryType {
case bob.QueryTypeSelect:
ctx, err = PublicreportReportLocations.AfterSelectHooks.RunHooks(ctx, exec, PublicreportReportLocationSlice{o})
}
return err
}
// AfterQueryHook is called after PublicreportReportLocationSlice is retrieved from the database
func (o PublicreportReportLocationSlice) AfterQueryHook(ctx context.Context, exec bob.Executor, queryType bob.QueryType) error {
var err error
switch queryType {
case bob.QueryTypeSelect:
ctx, err = PublicreportReportLocations.AfterSelectHooks.RunHooks(ctx, exec, o)
}
return err
}
type publicreportReportLocationWhere[Q psql.Filterable] struct {
ID psql.WhereNullMod[Q, int64]
TableName psql.WhereNullMod[Q, string]
Address psql.WhereNullMod[Q, string]
Created psql.WhereNullMod[Q, time.Time]
Location psql.WhereNullMod[Q, string]
PublicID psql.WhereNullMod[Q, string]
Status psql.WhereNullMod[Q, enums.PublicreportReportstatustype]
}
func (publicreportReportLocationWhere[Q]) AliasedAs(alias string) publicreportReportLocationWhere[Q] {
return buildPublicreportReportLocationWhere[Q](buildPublicreportReportLocationColumns(alias))
}
func buildPublicreportReportLocationWhere[Q psql.Filterable](cols publicreportReportLocationColumns) publicreportReportLocationWhere[Q] {
return publicreportReportLocationWhere[Q]{
ID: psql.WhereNull[Q, int64](cols.ID),
TableName: psql.WhereNull[Q, string](cols.TableName),
Address: psql.WhereNull[Q, string](cols.Address),
Created: psql.WhereNull[Q, time.Time](cols.Created),
Location: psql.WhereNull[Q, string](cols.Location),
PublicID: psql.WhereNull[Q, string](cols.PublicID),
Status: psql.WhereNull[Q, enums.PublicreportReportstatustype](cols.Status),
}
}