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.
112 lines
3.3 KiB
Go
112 lines
3.3 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 sql
|
|
|
|
import (
|
|
"context"
|
|
_ "embed"
|
|
"io"
|
|
"iter"
|
|
|
|
"github.com/lib/pq"
|
|
"github.com/stephenafamo/bob"
|
|
"github.com/stephenafamo/bob/dialect/psql"
|
|
"github.com/stephenafamo/bob/dialect/psql/dialect"
|
|
"github.com/stephenafamo/bob/orm"
|
|
"github.com/stephenafamo/scan"
|
|
)
|
|
|
|
//go:embed publicreport_publicid_table.bob.sql
|
|
var formattedQueries_publicreport_publicid_table string
|
|
|
|
var publicreportIDTableSQL = formattedQueries_publicreport_publicid_table[157:624]
|
|
|
|
type PublicreportIDTableQuery = orm.ModQuery[*dialect.SelectQuery, publicreportIDTable, PublicreportIDTableRow, []PublicreportIDTableRow, publicreportIDTableTransformer]
|
|
|
|
func PublicreportIDTable(PublicID string) *PublicreportIDTableQuery {
|
|
var expressionTypArgs publicreportIDTable
|
|
|
|
expressionTypArgs.PublicID = psql.Arg(PublicID)
|
|
|
|
return &PublicreportIDTableQuery{
|
|
Query: orm.Query[publicreportIDTable, PublicreportIDTableRow, []PublicreportIDTableRow, publicreportIDTableTransformer]{
|
|
ExecQuery: orm.ExecQuery[publicreportIDTable]{
|
|
BaseQuery: bob.BaseQuery[publicreportIDTable]{
|
|
Expression: expressionTypArgs,
|
|
Dialect: dialect.Dialect,
|
|
QueryType: bob.QueryTypeSelect,
|
|
},
|
|
},
|
|
Scanner: func(context.Context, []string) (func(*scan.Row) (any, error), func(any) (PublicreportIDTableRow, error)) {
|
|
return func(row *scan.Row) (any, error) {
|
|
var t PublicreportIDTableRow
|
|
row.ScheduleScanByIndex(0, &t.ExistsSomewhere)
|
|
row.ScheduleScanByIndex(1, &t.FoundInTables)
|
|
return &t, nil
|
|
}, func(v any) (PublicreportIDTableRow, error) {
|
|
return *(v.(*PublicreportIDTableRow)), nil
|
|
}
|
|
},
|
|
},
|
|
Mod: bob.ModFunc[*dialect.SelectQuery](func(q *dialect.SelectQuery) {
|
|
q.AppendCTE(expressionTypArgs.subExpr(5, 335))
|
|
q.AppendSelect(expressionTypArgs.subExpr(348, 449))
|
|
q.SetTable(expressionTypArgs.subExpr(455, 467))
|
|
}),
|
|
}
|
|
}
|
|
|
|
type PublicreportIDTableRow = struct {
|
|
ExistsSomewhere bool `db:"exists_somewhere"`
|
|
FoundInTables pq.StringArray `db:"found_in_tables"`
|
|
}
|
|
|
|
type publicreportIDTableTransformer = bob.SliceTransformer[PublicreportIDTableRow, []PublicreportIDTableRow]
|
|
|
|
type publicreportIDTable struct {
|
|
PublicID bob.Expression
|
|
}
|
|
|
|
func (o publicreportIDTable) args() iter.Seq[orm.ArgWithPosition] {
|
|
return func(yield func(arg orm.ArgWithPosition) bool) {
|
|
if !yield(orm.ArgWithPosition{
|
|
Name: "publicID",
|
|
Start: 112,
|
|
Stop: 114,
|
|
Expression: o.PublicID,
|
|
}) {
|
|
return
|
|
}
|
|
|
|
if !yield(orm.ArgWithPosition{
|
|
Name: "publicID",
|
|
Start: 221,
|
|
Stop: 223,
|
|
Expression: o.PublicID,
|
|
}) {
|
|
return
|
|
}
|
|
|
|
if !yield(orm.ArgWithPosition{
|
|
Name: "publicID",
|
|
Start: 331,
|
|
Stop: 333,
|
|
Expression: o.PublicID,
|
|
}) {
|
|
return
|
|
}
|
|
}
|
|
}
|
|
|
|
func (o publicreportIDTable) raw(from, to int) string {
|
|
return publicreportIDTableSQL[from:to]
|
|
}
|
|
|
|
func (o publicreportIDTable) subExpr(from, to int) bob.Expression {
|
|
return orm.ArgsToExpression(publicreportIDTableSQL, from, to, o.args())
|
|
}
|
|
|
|
func (o publicreportIDTable) WriteSQL(ctx context.Context, w io.StringWriter, d bob.Dialect, start int) ([]any, error) {
|
|
return o.subExpr(0, len(publicreportIDTableSQL)).WriteSQL(ctx, w, d, start)
|
|
}
|