This calculates the summary information of data in h3 nodes and puts it in the database for fast lookup.
130 lines
4.8 KiB
Go
130 lines
4.8 KiB
Go
// Code generated by BobGen psql v0.41.1. 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/aarondl/opt/null"
|
|
"github.com/stephenafamo/bob"
|
|
"github.com/stephenafamo/bob/dialect/psql"
|
|
"github.com/stephenafamo/bob/expr"
|
|
)
|
|
|
|
// RasterOverview is an object representing the database table.
|
|
type RasterOverview struct {
|
|
OTableCatalog null.Val[string] `db:"o_table_catalog" `
|
|
OTableSchema null.Val[string] `db:"o_table_schema" `
|
|
OTableName null.Val[string] `db:"o_table_name" `
|
|
ORasterColumn null.Val[string] `db:"o_raster_column" `
|
|
RTableCatalog null.Val[string] `db:"r_table_catalog" `
|
|
RTableSchema null.Val[string] `db:"r_table_schema" `
|
|
RTableName null.Val[string] `db:"r_table_name" `
|
|
RRasterColumn null.Val[string] `db:"r_raster_column" `
|
|
OverviewFactor null.Val[int32] `db:"overview_factor" `
|
|
}
|
|
|
|
// RasterOverviewSlice is an alias for a slice of pointers to RasterOverview.
|
|
// This should almost always be used instead of []*RasterOverview.
|
|
type RasterOverviewSlice []*RasterOverview
|
|
|
|
// RasterOverviews contains methods to work with the raster_overviews view
|
|
var RasterOverviews = psql.NewViewx[*RasterOverview, RasterOverviewSlice]("", "raster_overviews", buildRasterOverviewColumns("raster_overviews"))
|
|
|
|
// RasterOverviewsQuery is a query on the raster_overviews view
|
|
type RasterOverviewsQuery = *psql.ViewQuery[*RasterOverview, RasterOverviewSlice]
|
|
|
|
func buildRasterOverviewColumns(alias string) rasterOverviewColumns {
|
|
return rasterOverviewColumns{
|
|
ColumnsExpr: expr.NewColumnsExpr(
|
|
"o_table_catalog", "o_table_schema", "o_table_name", "o_raster_column", "r_table_catalog", "r_table_schema", "r_table_name", "r_raster_column", "overview_factor",
|
|
).WithParent("raster_overviews"),
|
|
tableAlias: alias,
|
|
OTableCatalog: psql.Quote(alias, "o_table_catalog"),
|
|
OTableSchema: psql.Quote(alias, "o_table_schema"),
|
|
OTableName: psql.Quote(alias, "o_table_name"),
|
|
ORasterColumn: psql.Quote(alias, "o_raster_column"),
|
|
RTableCatalog: psql.Quote(alias, "r_table_catalog"),
|
|
RTableSchema: psql.Quote(alias, "r_table_schema"),
|
|
RTableName: psql.Quote(alias, "r_table_name"),
|
|
RRasterColumn: psql.Quote(alias, "r_raster_column"),
|
|
OverviewFactor: psql.Quote(alias, "overview_factor"),
|
|
}
|
|
}
|
|
|
|
type rasterOverviewColumns struct {
|
|
expr.ColumnsExpr
|
|
tableAlias string
|
|
OTableCatalog psql.Expression
|
|
OTableSchema psql.Expression
|
|
OTableName psql.Expression
|
|
ORasterColumn psql.Expression
|
|
RTableCatalog psql.Expression
|
|
RTableSchema psql.Expression
|
|
RTableName psql.Expression
|
|
RRasterColumn psql.Expression
|
|
OverviewFactor psql.Expression
|
|
}
|
|
|
|
func (c rasterOverviewColumns) Alias() string {
|
|
return c.tableAlias
|
|
}
|
|
|
|
func (rasterOverviewColumns) AliasedAs(alias string) rasterOverviewColumns {
|
|
return buildRasterOverviewColumns(alias)
|
|
}
|
|
|
|
// AfterQueryHook is called after RasterOverview is retrieved from the database
|
|
func (o *RasterOverview) AfterQueryHook(ctx context.Context, exec bob.Executor, queryType bob.QueryType) error {
|
|
var err error
|
|
|
|
switch queryType {
|
|
case bob.QueryTypeSelect:
|
|
ctx, err = RasterOverviews.AfterSelectHooks.RunHooks(ctx, exec, RasterOverviewSlice{o})
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
// AfterQueryHook is called after RasterOverviewSlice is retrieved from the database
|
|
func (o RasterOverviewSlice) AfterQueryHook(ctx context.Context, exec bob.Executor, queryType bob.QueryType) error {
|
|
var err error
|
|
|
|
switch queryType {
|
|
case bob.QueryTypeSelect:
|
|
ctx, err = RasterOverviews.AfterSelectHooks.RunHooks(ctx, exec, o)
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type rasterOverviewWhere[Q psql.Filterable] struct {
|
|
OTableCatalog psql.WhereNullMod[Q, string]
|
|
OTableSchema psql.WhereNullMod[Q, string]
|
|
OTableName psql.WhereNullMod[Q, string]
|
|
ORasterColumn psql.WhereNullMod[Q, string]
|
|
RTableCatalog psql.WhereNullMod[Q, string]
|
|
RTableSchema psql.WhereNullMod[Q, string]
|
|
RTableName psql.WhereNullMod[Q, string]
|
|
RRasterColumn psql.WhereNullMod[Q, string]
|
|
OverviewFactor psql.WhereNullMod[Q, int32]
|
|
}
|
|
|
|
func (rasterOverviewWhere[Q]) AliasedAs(alias string) rasterOverviewWhere[Q] {
|
|
return buildRasterOverviewWhere[Q](buildRasterOverviewColumns(alias))
|
|
}
|
|
|
|
func buildRasterOverviewWhere[Q psql.Filterable](cols rasterOverviewColumns) rasterOverviewWhere[Q] {
|
|
return rasterOverviewWhere[Q]{
|
|
OTableCatalog: psql.WhereNull[Q, string](cols.OTableCatalog),
|
|
OTableSchema: psql.WhereNull[Q, string](cols.OTableSchema),
|
|
OTableName: psql.WhereNull[Q, string](cols.OTableName),
|
|
ORasterColumn: psql.WhereNull[Q, string](cols.ORasterColumn),
|
|
RTableCatalog: psql.WhereNull[Q, string](cols.RTableCatalog),
|
|
RTableSchema: psql.WhereNull[Q, string](cols.RTableSchema),
|
|
RTableName: psql.WhereNull[Q, string](cols.RTableName),
|
|
RRasterColumn: psql.WhereNull[Q, string](cols.RRasterColumn),
|
|
OverviewFactor: psql.WhereNull[Q, int32](cols.OverviewFactor),
|
|
}
|
|
}
|