This is an intermediate step between shifting from the old fs_* prefixed table names to an entire fieldseeker schema. At this point we have both, and we aren't doing much with the new schema but compiling.
79 lines
2.6 KiB
Go
79 lines
2.6 KiB
Go
// Code generated by BobGen psql v0.42.0. DO NOT EDIT.
|
|
// This file is meant to be re-generated in place and/or deleted at any time.
|
|
|
|
package models
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/stephenafamo/bob"
|
|
"github.com/stephenafamo/bob/dialect/psql"
|
|
"github.com/stephenafamo/bob/expr"
|
|
)
|
|
|
|
// FieldseekerTracklog is an object representing the database table.
|
|
type FieldseekerTracklog struct{}
|
|
|
|
// FieldseekerTracklogSlice is an alias for a slice of pointers to FieldseekerTracklog.
|
|
// This should almost always be used instead of []*FieldseekerTracklog.
|
|
type FieldseekerTracklogSlice []*FieldseekerTracklog
|
|
|
|
// FieldseekerTracklogs contains methods to work with the tracklog view
|
|
var FieldseekerTracklogs = psql.NewViewx[*FieldseekerTracklog, FieldseekerTracklogSlice]("fieldseeker", "tracklog", buildFieldseekerTracklogColumns("fieldseeker.tracklog"))
|
|
|
|
// FieldseekerTracklogsQuery is a query on the tracklog view
|
|
type FieldseekerTracklogsQuery = *psql.ViewQuery[*FieldseekerTracklog, FieldseekerTracklogSlice]
|
|
|
|
func buildFieldseekerTracklogColumns(alias string) fieldseekerTracklogColumns {
|
|
return fieldseekerTracklogColumns{
|
|
ColumnsExpr: expr.NewColumnsExpr().WithParent("fieldseeker.tracklog"),
|
|
tableAlias: alias,
|
|
}
|
|
}
|
|
|
|
type fieldseekerTracklogColumns struct {
|
|
expr.ColumnsExpr
|
|
tableAlias string
|
|
}
|
|
|
|
func (c fieldseekerTracklogColumns) Alias() string {
|
|
return c.tableAlias
|
|
}
|
|
|
|
func (fieldseekerTracklogColumns) AliasedAs(alias string) fieldseekerTracklogColumns {
|
|
return buildFieldseekerTracklogColumns(alias)
|
|
}
|
|
|
|
// AfterQueryHook is called after FieldseekerTracklog is retrieved from the database
|
|
func (o *FieldseekerTracklog) AfterQueryHook(ctx context.Context, exec bob.Executor, queryType bob.QueryType) error {
|
|
var err error
|
|
|
|
switch queryType {
|
|
case bob.QueryTypeSelect:
|
|
ctx, err = FieldseekerTracklogs.AfterSelectHooks.RunHooks(ctx, exec, FieldseekerTracklogSlice{o})
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
// AfterQueryHook is called after FieldseekerTracklogSlice is retrieved from the database
|
|
func (o FieldseekerTracklogSlice) AfterQueryHook(ctx context.Context, exec bob.Executor, queryType bob.QueryType) error {
|
|
var err error
|
|
|
|
switch queryType {
|
|
case bob.QueryTypeSelect:
|
|
ctx, err = FieldseekerTracklogs.AfterSelectHooks.RunHooks(ctx, exec, o)
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type fieldseekerTracklogWhere[Q psql.Filterable] struct{}
|
|
|
|
func (fieldseekerTracklogWhere[Q]) AliasedAs(alias string) fieldseekerTracklogWhere[Q] {
|
|
return buildFieldseekerTracklogWhere[Q](buildFieldseekerTracklogColumns(alias))
|
|
}
|
|
|
|
func buildFieldseekerTracklogWhere[Q psql.Filterable](cols fieldseekerTracklogColumns) fieldseekerTracklogWhere[Q] {
|
|
return fieldseekerTracklogWhere[Q]{}
|
|
}
|