nidus-sync/db/models/bob_loaders.bob.go
Eli Ribble d06b8f7949
Add mode data to pool upload rows, move to fileupload schema
This allows users to review the data before committing it to the
database
2026-02-09 19:03:27 +00:00

327 lines
20 KiB
Go

// Code generated by BobGen psql v0.42.5. DO NOT EDIT.
// This file is meant to be re-generated in place and/or deleted at any time.
package models
import (
"context"
"database/sql"
"errors"
"fmt"
"github.com/Gleipnir-Technology/bob"
"github.com/Gleipnir-Technology/bob/dialect/psql/dialect"
"github.com/Gleipnir-Technology/bob/orm"
)
var Preload = getPreloaders()
type preloaders struct {
ArcgisUser arcgisuserPreloader
ArcgisUserPrivilege arcgisUserPrivilegePreloader
CommsEmailContact commsEmailContactPreloader
CommsEmailLog commsEmailLogPreloader
CommsEmailTemplate commsEmailTemplatePreloader
CommsPhone commsPhonePreloader
CommsTextJob commsTextJobPreloader
CommsTextLog commsTextLogPreloader
DistrictSubscriptionEmail districtSubscriptionEmailPreloader
DistrictSubscriptionPhone districtSubscriptionPhonePreloader
FieldseekerContainerrelate fieldseekerContainerrelatePreloader
FieldseekerFieldscoutinglog fieldseekerFieldscoutinglogPreloader
FieldseekerHabitatrelate fieldseekerHabitatrelatePreloader
FieldseekerInspectionsample fieldseekerInspectionsamplePreloader
FieldseekerInspectionsampledetail fieldseekerInspectionsampledetailPreloader
FieldseekerLinelocation fieldseekerLinelocationPreloader
FieldseekerLocationtracking fieldseekerLocationtrackingPreloader
FieldseekerMosquitoinspection fieldseekerMosquitoinspectionPreloader
FieldseekerPointlocation fieldseekerPointlocationPreloader
FieldseekerPolygonlocation fieldseekerPolygonlocationPreloader
FieldseekerPool fieldseekerPoolPreloader
FieldseekerPooldetail fieldseekerPooldetailPreloader
FieldseekerProposedtreatmentarea fieldseekerProposedtreatmentareaPreloader
FieldseekerQamosquitoinspection fieldseekerQamosquitoinspectionPreloader
FieldseekerRodentlocation fieldseekerRodentlocationPreloader
FieldseekerSamplecollection fieldseekerSamplecollectionPreloader
FieldseekerSamplelocation fieldseekerSamplelocationPreloader
FieldseekerServicerequest fieldseekerServicerequestPreloader
FieldseekerSpeciesabundance fieldseekerSpeciesabundancePreloader
FieldseekerStormdrain fieldseekerStormdrainPreloader
FieldseekerTimecard fieldseekerTimecardPreloader
FieldseekerTrapdatum fieldseekerTrapdatumPreloader
FieldseekerTraplocation fieldseekerTraplocationPreloader
FieldseekerTreatment fieldseekerTreatmentPreloader
FieldseekerTreatmentarea fieldseekerTreatmentareaPreloader
FieldseekerZone fieldseekerZonePreloader
FieldseekerZones2 fieldseekerZones2Preloader
FieldseekerSync fieldseekerSyncPreloader
FileuploadCSV fileuploadCSVPreloader
FileuploadErrorCSV fileuploadErrorCSVPreloader
FileuploadErrorFile fileuploadErrorFilePreloader
FileuploadFile fileuploadFilePreloader
FileuploadPool fileuploadPoolPreloader
H3Aggregation h3AggregationPreloader
ImportDistrict importDistrictPreloader
NoteAudio noteAudioPreloader
NoteAudioBreadcrumb noteAudioBreadcrumbPreloader
NoteAudioDatum noteAudioDatumPreloader
NoteImage noteImagePreloader
NoteImageBreadcrumb noteImageBreadcrumbPreloader
NoteImageDatum noteImageDatumPreloader
Notification notificationPreloader
OauthToken oauthTokenPreloader
Organization organizationPreloader
PublicreportImage publicreportImagePreloader
PublicreportImageExif publicreportImageExifPreloader
PublicreportNotifyEmailNuisance publicreportNotifyEmailNuisancePreloader
PublicreportNotifyEmailPool publicreportNotifyEmailPoolPreloader
PublicreportNotifyPhoneNuisance publicreportNotifyPhoneNuisancePreloader
PublicreportNotifyPhonePool publicreportNotifyPhonePoolPreloader
PublicreportNuisance publicreportNuisancePreloader
PublicreportNuisanceImage publicreportNuisanceImagePreloader
PublicreportPool publicreportPoolPreloader
PublicreportPoolImage publicreportPoolImagePreloader
PublicreportQuick publicreportQuickPreloader
PublicreportQuickImage publicreportQuickImagePreloader
User userPreloader
}
func getPreloaders() preloaders {
return preloaders{
ArcgisUser: buildArcgisUserPreloader(),
ArcgisUserPrivilege: buildArcgisUserPrivilegePreloader(),
CommsEmailContact: buildCommsEmailContactPreloader(),
CommsEmailLog: buildCommsEmailLogPreloader(),
CommsEmailTemplate: buildCommsEmailTemplatePreloader(),
CommsPhone: buildCommsPhonePreloader(),
CommsTextJob: buildCommsTextJobPreloader(),
CommsTextLog: buildCommsTextLogPreloader(),
DistrictSubscriptionEmail: buildDistrictSubscriptionEmailPreloader(),
DistrictSubscriptionPhone: buildDistrictSubscriptionPhonePreloader(),
FieldseekerContainerrelate: buildFieldseekerContainerrelatePreloader(),
FieldseekerFieldscoutinglog: buildFieldseekerFieldscoutinglogPreloader(),
FieldseekerHabitatrelate: buildFieldseekerHabitatrelatePreloader(),
FieldseekerInspectionsample: buildFieldseekerInspectionsamplePreloader(),
FieldseekerInspectionsampledetail: buildFieldseekerInspectionsampledetailPreloader(),
FieldseekerLinelocation: buildFieldseekerLinelocationPreloader(),
FieldseekerLocationtracking: buildFieldseekerLocationtrackingPreloader(),
FieldseekerMosquitoinspection: buildFieldseekerMosquitoinspectionPreloader(),
FieldseekerPointlocation: buildFieldseekerPointlocationPreloader(),
FieldseekerPolygonlocation: buildFieldseekerPolygonlocationPreloader(),
FieldseekerPool: buildFieldseekerPoolPreloader(),
FieldseekerPooldetail: buildFieldseekerPooldetailPreloader(),
FieldseekerProposedtreatmentarea: buildFieldseekerProposedtreatmentareaPreloader(),
FieldseekerQamosquitoinspection: buildFieldseekerQamosquitoinspectionPreloader(),
FieldseekerRodentlocation: buildFieldseekerRodentlocationPreloader(),
FieldseekerSamplecollection: buildFieldseekerSamplecollectionPreloader(),
FieldseekerSamplelocation: buildFieldseekerSamplelocationPreloader(),
FieldseekerServicerequest: buildFieldseekerServicerequestPreloader(),
FieldseekerSpeciesabundance: buildFieldseekerSpeciesabundancePreloader(),
FieldseekerStormdrain: buildFieldseekerStormdrainPreloader(),
FieldseekerTimecard: buildFieldseekerTimecardPreloader(),
FieldseekerTrapdatum: buildFieldseekerTrapdatumPreloader(),
FieldseekerTraplocation: buildFieldseekerTraplocationPreloader(),
FieldseekerTreatment: buildFieldseekerTreatmentPreloader(),
FieldseekerTreatmentarea: buildFieldseekerTreatmentareaPreloader(),
FieldseekerZone: buildFieldseekerZonePreloader(),
FieldseekerZones2: buildFieldseekerZones2Preloader(),
FieldseekerSync: buildFieldseekerSyncPreloader(),
FileuploadCSV: buildFileuploadCSVPreloader(),
FileuploadErrorCSV: buildFileuploadErrorCSVPreloader(),
FileuploadErrorFile: buildFileuploadErrorFilePreloader(),
FileuploadFile: buildFileuploadFilePreloader(),
FileuploadPool: buildFileuploadPoolPreloader(),
H3Aggregation: buildH3AggregationPreloader(),
ImportDistrict: buildImportDistrictPreloader(),
NoteAudio: buildNoteAudioPreloader(),
NoteAudioBreadcrumb: buildNoteAudioBreadcrumbPreloader(),
NoteAudioDatum: buildNoteAudioDatumPreloader(),
NoteImage: buildNoteImagePreloader(),
NoteImageBreadcrumb: buildNoteImageBreadcrumbPreloader(),
NoteImageDatum: buildNoteImageDatumPreloader(),
Notification: buildNotificationPreloader(),
OauthToken: buildOauthTokenPreloader(),
Organization: buildOrganizationPreloader(),
PublicreportImage: buildPublicreportImagePreloader(),
PublicreportImageExif: buildPublicreportImageExifPreloader(),
PublicreportNotifyEmailNuisance: buildPublicreportNotifyEmailNuisancePreloader(),
PublicreportNotifyEmailPool: buildPublicreportNotifyEmailPoolPreloader(),
PublicreportNotifyPhoneNuisance: buildPublicreportNotifyPhoneNuisancePreloader(),
PublicreportNotifyPhonePool: buildPublicreportNotifyPhonePoolPreloader(),
PublicreportNuisance: buildPublicreportNuisancePreloader(),
PublicreportNuisanceImage: buildPublicreportNuisanceImagePreloader(),
PublicreportPool: buildPublicreportPoolPreloader(),
PublicreportPoolImage: buildPublicreportPoolImagePreloader(),
PublicreportQuick: buildPublicreportQuickPreloader(),
PublicreportQuickImage: buildPublicreportQuickImagePreloader(),
User: buildUserPreloader(),
}
}
var (
SelectThenLoad = getThenLoaders[*dialect.SelectQuery]()
InsertThenLoad = getThenLoaders[*dialect.InsertQuery]()
UpdateThenLoad = getThenLoaders[*dialect.UpdateQuery]()
)
type thenLoaders[Q orm.Loadable] struct {
ArcgisUser arcgisuserThenLoader[Q]
ArcgisUserPrivilege arcgisUserPrivilegeThenLoader[Q]
CommsEmailContact commsEmailContactThenLoader[Q]
CommsEmailLog commsEmailLogThenLoader[Q]
CommsEmailTemplate commsEmailTemplateThenLoader[Q]
CommsPhone commsPhoneThenLoader[Q]
CommsTextJob commsTextJobThenLoader[Q]
CommsTextLog commsTextLogThenLoader[Q]
DistrictSubscriptionEmail districtSubscriptionEmailThenLoader[Q]
DistrictSubscriptionPhone districtSubscriptionPhoneThenLoader[Q]
FieldseekerContainerrelate fieldseekerContainerrelateThenLoader[Q]
FieldseekerFieldscoutinglog fieldseekerFieldscoutinglogThenLoader[Q]
FieldseekerHabitatrelate fieldseekerHabitatrelateThenLoader[Q]
FieldseekerInspectionsample fieldseekerInspectionsampleThenLoader[Q]
FieldseekerInspectionsampledetail fieldseekerInspectionsampledetailThenLoader[Q]
FieldseekerLinelocation fieldseekerLinelocationThenLoader[Q]
FieldseekerLocationtracking fieldseekerLocationtrackingThenLoader[Q]
FieldseekerMosquitoinspection fieldseekerMosquitoinspectionThenLoader[Q]
FieldseekerPointlocation fieldseekerPointlocationThenLoader[Q]
FieldseekerPolygonlocation fieldseekerPolygonlocationThenLoader[Q]
FieldseekerPool fieldseekerPoolThenLoader[Q]
FieldseekerPooldetail fieldseekerPooldetailThenLoader[Q]
FieldseekerProposedtreatmentarea fieldseekerProposedtreatmentareaThenLoader[Q]
FieldseekerQamosquitoinspection fieldseekerQamosquitoinspectionThenLoader[Q]
FieldseekerRodentlocation fieldseekerRodentlocationThenLoader[Q]
FieldseekerSamplecollection fieldseekerSamplecollectionThenLoader[Q]
FieldseekerSamplelocation fieldseekerSamplelocationThenLoader[Q]
FieldseekerServicerequest fieldseekerServicerequestThenLoader[Q]
FieldseekerSpeciesabundance fieldseekerSpeciesabundanceThenLoader[Q]
FieldseekerStormdrain fieldseekerStormdrainThenLoader[Q]
FieldseekerTimecard fieldseekerTimecardThenLoader[Q]
FieldseekerTrapdatum fieldseekerTrapdatumThenLoader[Q]
FieldseekerTraplocation fieldseekerTraplocationThenLoader[Q]
FieldseekerTreatment fieldseekerTreatmentThenLoader[Q]
FieldseekerTreatmentarea fieldseekerTreatmentareaThenLoader[Q]
FieldseekerZone fieldseekerZoneThenLoader[Q]
FieldseekerZones2 fieldseekerZones2ThenLoader[Q]
FieldseekerSync fieldseekerSyncThenLoader[Q]
FileuploadCSV fileuploadCSVThenLoader[Q]
FileuploadErrorCSV fileuploadErrorCSVThenLoader[Q]
FileuploadErrorFile fileuploadErrorFileThenLoader[Q]
FileuploadFile fileuploadFileThenLoader[Q]
FileuploadPool fileuploadPoolThenLoader[Q]
H3Aggregation h3AggregationThenLoader[Q]
ImportDistrict importDistrictThenLoader[Q]
NoteAudio noteAudioThenLoader[Q]
NoteAudioBreadcrumb noteAudioBreadcrumbThenLoader[Q]
NoteAudioDatum noteAudioDatumThenLoader[Q]
NoteImage noteImageThenLoader[Q]
NoteImageBreadcrumb noteImageBreadcrumbThenLoader[Q]
NoteImageDatum noteImageDatumThenLoader[Q]
Notification notificationThenLoader[Q]
OauthToken oauthTokenThenLoader[Q]
Organization organizationThenLoader[Q]
PublicreportImage publicreportImageThenLoader[Q]
PublicreportImageExif publicreportImageExifThenLoader[Q]
PublicreportNotifyEmailNuisance publicreportNotifyEmailNuisanceThenLoader[Q]
PublicreportNotifyEmailPool publicreportNotifyEmailPoolThenLoader[Q]
PublicreportNotifyPhoneNuisance publicreportNotifyPhoneNuisanceThenLoader[Q]
PublicreportNotifyPhonePool publicreportNotifyPhonePoolThenLoader[Q]
PublicreportNuisance publicreportNuisanceThenLoader[Q]
PublicreportNuisanceImage publicreportNuisanceImageThenLoader[Q]
PublicreportPool publicreportPoolThenLoader[Q]
PublicreportPoolImage publicreportPoolImageThenLoader[Q]
PublicreportQuick publicreportQuickThenLoader[Q]
PublicreportQuickImage publicreportQuickImageThenLoader[Q]
User userThenLoader[Q]
}
func getThenLoaders[Q orm.Loadable]() thenLoaders[Q] {
return thenLoaders[Q]{
ArcgisUser: buildArcgisUserThenLoader[Q](),
ArcgisUserPrivilege: buildArcgisUserPrivilegeThenLoader[Q](),
CommsEmailContact: buildCommsEmailContactThenLoader[Q](),
CommsEmailLog: buildCommsEmailLogThenLoader[Q](),
CommsEmailTemplate: buildCommsEmailTemplateThenLoader[Q](),
CommsPhone: buildCommsPhoneThenLoader[Q](),
CommsTextJob: buildCommsTextJobThenLoader[Q](),
CommsTextLog: buildCommsTextLogThenLoader[Q](),
DistrictSubscriptionEmail: buildDistrictSubscriptionEmailThenLoader[Q](),
DistrictSubscriptionPhone: buildDistrictSubscriptionPhoneThenLoader[Q](),
FieldseekerContainerrelate: buildFieldseekerContainerrelateThenLoader[Q](),
FieldseekerFieldscoutinglog: buildFieldseekerFieldscoutinglogThenLoader[Q](),
FieldseekerHabitatrelate: buildFieldseekerHabitatrelateThenLoader[Q](),
FieldseekerInspectionsample: buildFieldseekerInspectionsampleThenLoader[Q](),
FieldseekerInspectionsampledetail: buildFieldseekerInspectionsampledetailThenLoader[Q](),
FieldseekerLinelocation: buildFieldseekerLinelocationThenLoader[Q](),
FieldseekerLocationtracking: buildFieldseekerLocationtrackingThenLoader[Q](),
FieldseekerMosquitoinspection: buildFieldseekerMosquitoinspectionThenLoader[Q](),
FieldseekerPointlocation: buildFieldseekerPointlocationThenLoader[Q](),
FieldseekerPolygonlocation: buildFieldseekerPolygonlocationThenLoader[Q](),
FieldseekerPool: buildFieldseekerPoolThenLoader[Q](),
FieldseekerPooldetail: buildFieldseekerPooldetailThenLoader[Q](),
FieldseekerProposedtreatmentarea: buildFieldseekerProposedtreatmentareaThenLoader[Q](),
FieldseekerQamosquitoinspection: buildFieldseekerQamosquitoinspectionThenLoader[Q](),
FieldseekerRodentlocation: buildFieldseekerRodentlocationThenLoader[Q](),
FieldseekerSamplecollection: buildFieldseekerSamplecollectionThenLoader[Q](),
FieldseekerSamplelocation: buildFieldseekerSamplelocationThenLoader[Q](),
FieldseekerServicerequest: buildFieldseekerServicerequestThenLoader[Q](),
FieldseekerSpeciesabundance: buildFieldseekerSpeciesabundanceThenLoader[Q](),
FieldseekerStormdrain: buildFieldseekerStormdrainThenLoader[Q](),
FieldseekerTimecard: buildFieldseekerTimecardThenLoader[Q](),
FieldseekerTrapdatum: buildFieldseekerTrapdatumThenLoader[Q](),
FieldseekerTraplocation: buildFieldseekerTraplocationThenLoader[Q](),
FieldseekerTreatment: buildFieldseekerTreatmentThenLoader[Q](),
FieldseekerTreatmentarea: buildFieldseekerTreatmentareaThenLoader[Q](),
FieldseekerZone: buildFieldseekerZoneThenLoader[Q](),
FieldseekerZones2: buildFieldseekerZones2ThenLoader[Q](),
FieldseekerSync: buildFieldseekerSyncThenLoader[Q](),
FileuploadCSV: buildFileuploadCSVThenLoader[Q](),
FileuploadErrorCSV: buildFileuploadErrorCSVThenLoader[Q](),
FileuploadErrorFile: buildFileuploadErrorFileThenLoader[Q](),
FileuploadFile: buildFileuploadFileThenLoader[Q](),
FileuploadPool: buildFileuploadPoolThenLoader[Q](),
H3Aggregation: buildH3AggregationThenLoader[Q](),
ImportDistrict: buildImportDistrictThenLoader[Q](),
NoteAudio: buildNoteAudioThenLoader[Q](),
NoteAudioBreadcrumb: buildNoteAudioBreadcrumbThenLoader[Q](),
NoteAudioDatum: buildNoteAudioDatumThenLoader[Q](),
NoteImage: buildNoteImageThenLoader[Q](),
NoteImageBreadcrumb: buildNoteImageBreadcrumbThenLoader[Q](),
NoteImageDatum: buildNoteImageDatumThenLoader[Q](),
Notification: buildNotificationThenLoader[Q](),
OauthToken: buildOauthTokenThenLoader[Q](),
Organization: buildOrganizationThenLoader[Q](),
PublicreportImage: buildPublicreportImageThenLoader[Q](),
PublicreportImageExif: buildPublicreportImageExifThenLoader[Q](),
PublicreportNotifyEmailNuisance: buildPublicreportNotifyEmailNuisanceThenLoader[Q](),
PublicreportNotifyEmailPool: buildPublicreportNotifyEmailPoolThenLoader[Q](),
PublicreportNotifyPhoneNuisance: buildPublicreportNotifyPhoneNuisanceThenLoader[Q](),
PublicreportNotifyPhonePool: buildPublicreportNotifyPhonePoolThenLoader[Q](),
PublicreportNuisance: buildPublicreportNuisanceThenLoader[Q](),
PublicreportNuisanceImage: buildPublicreportNuisanceImageThenLoader[Q](),
PublicreportPool: buildPublicreportPoolThenLoader[Q](),
PublicreportPoolImage: buildPublicreportPoolImageThenLoader[Q](),
PublicreportQuick: buildPublicreportQuickThenLoader[Q](),
PublicreportQuickImage: buildPublicreportQuickImageThenLoader[Q](),
User: buildUserThenLoader[Q](),
}
}
func thenLoadBuilder[Q orm.Loadable, T any](name string, f func(context.Context, bob.Executor, T, ...bob.Mod[*dialect.SelectQuery]) error) func(...bob.Mod[*dialect.SelectQuery]) orm.Loader[Q] {
return func(queryMods ...bob.Mod[*dialect.SelectQuery]) orm.Loader[Q] {
return func(ctx context.Context, exec bob.Executor, retrieved any) error {
loader, isLoader := retrieved.(T)
if !isLoader {
return fmt.Errorf("object %T cannot load %q", retrieved, name)
}
err := f(ctx, exec, loader, queryMods...)
// Don't cause an issue due to missing relationships
if errors.Is(err, sql.ErrNoRows) {
return nil
}
return err
}
}
}