2026-01-27 18:44:02 +00:00
|
|
|
// Code generated by BobGen psql v0.42.5. DO NOT EDIT.
|
2026-01-09 21:02:30 +00:00
|
|
|
// This file is meant to be re-generated in place and/or deleted at any time.
|
|
|
|
|
|
|
|
|
|
package sql
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
_ "embed"
|
|
|
|
|
"io"
|
|
|
|
|
"iter"
|
|
|
|
|
|
2026-01-27 18:44:02 +00:00
|
|
|
"github.com/Gleipnir-Technology/bob"
|
|
|
|
|
"github.com/Gleipnir-Technology/bob/dialect/psql"
|
|
|
|
|
"github.com/Gleipnir-Technology/bob/dialect/psql/dialect"
|
|
|
|
|
"github.com/Gleipnir-Technology/bob/orm"
|
2026-01-09 21:02:30 +00:00
|
|
|
"github.com/lib/pq"
|
|
|
|
|
"github.com/stephenafamo/scan"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
//go:embed publicreport_publicid_table.bob.sql
|
|
|
|
|
var formattedQueries_publicreport_publicid_table string
|
|
|
|
|
|
2026-03-08 02:43:00 +00:00
|
|
|
var publicreportIDTableSQL = formattedQueries_publicreport_publicid_table[157:534]
|
2026-01-09 21:02:30 +00:00
|
|
|
|
|
|
|
|
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)
|
2026-02-06 15:39:49 +00:00
|
|
|
row.ScheduleScanByIndex(2, &t.ReportIds)
|
2026-01-09 21:02:30 +00:00
|
|
|
return &t, nil
|
|
|
|
|
}, func(v any) (PublicreportIDTableRow, error) {
|
|
|
|
|
return *(v.(*PublicreportIDTableRow)), nil
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
Mod: bob.ModFunc[*dialect.SelectQuery](func(q *dialect.SelectQuery) {
|
2026-03-08 02:43:00 +00:00
|
|
|
q.AppendCTE(expressionTypArgs.subExpr(5, 221))
|
|
|
|
|
q.AppendSelect(expressionTypArgs.subExpr(231, 359))
|
|
|
|
|
q.SetTable(expressionTypArgs.subExpr(365, 377))
|
2026-01-09 21:02:30 +00:00
|
|
|
}),
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type PublicreportIDTableRow = struct {
|
|
|
|
|
ExistsSomewhere bool `db:"exists_somewhere"`
|
|
|
|
|
FoundInTables pq.StringArray `db:"found_in_tables"`
|
2026-02-06 15:39:49 +00:00
|
|
|
ReportIds pq.StringArray `db:"report_ids"`
|
2026-01-09 21:02:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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",
|
2026-02-06 15:39:49 +00:00
|
|
|
Start: 217,
|
|
|
|
|
Stop: 219,
|
2026-01-09 21:02:30 +00:00
|
|
|
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)
|
|
|
|
|
}
|