// 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 {
	Address                            addressPreloader
	CommsEmailContact                  commsEmailContactPreloader
	CommsEmailLog                      commsEmailLogPreloader
	CommsEmailTemplate                 commsEmailTemplatePreloader
	CommsMailer                        commsMailerPreloader
	CommsPhone                         commsPhonePreloader
	CommsTextJob                       commsTextJobPreloader
	CommsTextLog                       commsTextLogPreloader
	Communication                      communicationPreloader
	CommunicationLogEntry              communicationLogEntryPreloader
	ComplianceReportRequest            complianceReportRequestPreloader
	ComplianceReportRequestMailer      complianceReportRequestMailerPreloader
	DistrictSubscriptionEmail          districtSubscriptionEmailPreloader
	DistrictSubscriptionPhone          districtSubscriptionPhonePreloader
	Feature                            featurePreloader
	FeaturePool                        featurePoolPreloader
	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
	Lead                               leadPreloader
	LogImpersonation                   logImpersonationPreloader
	NoteAudio                          noteAudioPreloader
	NoteAudioBreadcrumb                noteAudioBreadcrumbPreloader
	NoteAudioDatum                     noteAudioDatumPreloader
	NoteImage                          noteImagePreloader
	NoteImageBreadcrumb                noteImageBreadcrumbPreloader
	NoteImageDatum                     noteImageDatumPreloader
	Notification                       notificationPreloader
	Organization                       organizationPreloader
	Parcel                             parcelPreloader
	PublicreportClient                 publicreportClientPreloader
	PublicreportCompliance             publicreportCompliancePreloader
	PublicreportImage                  publicreportImagePreloader
	PublicreportImageExif              publicreportImageExifPreloader
	PublicreportNotifyEmail            publicreportNotifyEmailPreloader
	PublicreportNotifyEmailNuisanceOld publicreportNotifyEmailNuisanceOldPreloader
	PublicreportNotifyEmailWaterOld    publicreportNotifyEmailWaterOldPreloader
	PublicreportNotifyPhone            publicreportNotifyPhonePreloader
	PublicreportNotifyPhoneNuisanceOld publicreportNotifyPhoneNuisanceOldPreloader
	PublicreportNotifyPhoneWaterOld    publicreportNotifyPhoneWaterOldPreloader
	PublicreportNuisance               publicreportNuisancePreloader
	PublicreportNuisanceImageOld       publicreportNuisanceImageOldPreloader
	PublicreportNuisanceOld            publicreportNuisanceOldPreloader
	PublicreportReport                 publicreportReportPreloader
	PublicreportReportImage            publicreportReportImagePreloader
	PublicreportReportLog              publicreportReportLogPreloader
	PublicreportSubscribeEmail         publicreportSubscribeEmailPreloader
	PublicreportSubscribePhone         publicreportSubscribePhonePreloader
	PublicreportWater                  publicreportWaterPreloader
	PublicreportWaterImageOld          publicreportWaterImageOldPreloader
	PublicreportWaterOld               publicreportWaterOldPreloader
	ReportText                         reportTextPreloader
	Resident                           residentPreloader
	ReviewTask                         reviewTaskPreloader
	ReviewTaskPool                     reviewTaskPoolPreloader
	Signal                             signalPreloader
	Site                               sitePreloader
	TileCachedImage                    tileCachedImagePreloader
	TileService                        tileServicePreloader
	User                               userPreloader
}

func getPreloaders() preloaders {
	return preloaders{
		Address:                            buildAddressPreloader(),
		CommsEmailContact:                  buildCommsEmailContactPreloader(),
		CommsEmailLog:                      buildCommsEmailLogPreloader(),
		CommsEmailTemplate:                 buildCommsEmailTemplatePreloader(),
		CommsMailer:                        buildCommsMailerPreloader(),
		CommsPhone:                         buildCommsPhonePreloader(),
		CommsTextJob:                       buildCommsTextJobPreloader(),
		CommsTextLog:                       buildCommsTextLogPreloader(),
		Communication:                      buildCommunicationPreloader(),
		CommunicationLogEntry:              buildCommunicationLogEntryPreloader(),
		ComplianceReportRequest:            buildComplianceReportRequestPreloader(),
		ComplianceReportRequestMailer:      buildComplianceReportRequestMailerPreloader(),
		DistrictSubscriptionEmail:          buildDistrictSubscriptionEmailPreloader(),
		DistrictSubscriptionPhone:          buildDistrictSubscriptionPhonePreloader(),
		Feature:                            buildFeaturePreloader(),
		FeaturePool:                        buildFeaturePoolPreloader(),
		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(),
		Lead:                               buildLeadPreloader(),
		LogImpersonation:                   buildLogImpersonationPreloader(),
		NoteAudio:                          buildNoteAudioPreloader(),
		NoteAudioBreadcrumb:                buildNoteAudioBreadcrumbPreloader(),
		NoteAudioDatum:                     buildNoteAudioDatumPreloader(),
		NoteImage:                          buildNoteImagePreloader(),
		NoteImageBreadcrumb:                buildNoteImageBreadcrumbPreloader(),
		NoteImageDatum:                     buildNoteImageDatumPreloader(),
		Notification:                       buildNotificationPreloader(),
		Organization:                       buildOrganizationPreloader(),
		Parcel:                             buildParcelPreloader(),
		PublicreportClient:                 buildPublicreportClientPreloader(),
		PublicreportCompliance:             buildPublicreportCompliancePreloader(),
		PublicreportImage:                  buildPublicreportImagePreloader(),
		PublicreportImageExif:              buildPublicreportImageExifPreloader(),
		PublicreportNotifyEmail:            buildPublicreportNotifyEmailPreloader(),
		PublicreportNotifyEmailNuisanceOld: buildPublicreportNotifyEmailNuisanceOldPreloader(),
		PublicreportNotifyEmailWaterOld:    buildPublicreportNotifyEmailWaterOldPreloader(),
		PublicreportNotifyPhone:            buildPublicreportNotifyPhonePreloader(),
		PublicreportNotifyPhoneNuisanceOld: buildPublicreportNotifyPhoneNuisanceOldPreloader(),
		PublicreportNotifyPhoneWaterOld:    buildPublicreportNotifyPhoneWaterOldPreloader(),
		PublicreportNuisance:               buildPublicreportNuisancePreloader(),
		PublicreportNuisanceImageOld:       buildPublicreportNuisanceImageOldPreloader(),
		PublicreportNuisanceOld:            buildPublicreportNuisanceOldPreloader(),
		PublicreportReport:                 buildPublicreportReportPreloader(),
		PublicreportReportImage:            buildPublicreportReportImagePreloader(),
		PublicreportReportLog:              buildPublicreportReportLogPreloader(),
		PublicreportSubscribeEmail:         buildPublicreportSubscribeEmailPreloader(),
		PublicreportSubscribePhone:         buildPublicreportSubscribePhonePreloader(),
		PublicreportWater:                  buildPublicreportWaterPreloader(),
		PublicreportWaterImageOld:          buildPublicreportWaterImageOldPreloader(),
		PublicreportWaterOld:               buildPublicreportWaterOldPreloader(),
		ReportText:                         buildReportTextPreloader(),
		Resident:                           buildResidentPreloader(),
		ReviewTask:                         buildReviewTaskPreloader(),
		ReviewTaskPool:                     buildReviewTaskPoolPreloader(),
		Signal:                             buildSignalPreloader(),
		Site:                               buildSitePreloader(),
		TileCachedImage:                    buildTileCachedImagePreloader(),
		TileService:                        buildTileServicePreloader(),
		User:                               buildUserPreloader(),
	}
}

var (
	SelectThenLoad = getThenLoaders[*dialect.SelectQuery]()
	InsertThenLoad = getThenLoaders[*dialect.InsertQuery]()
	UpdateThenLoad = getThenLoaders[*dialect.UpdateQuery]()
)

type thenLoaders[Q orm.Loadable] struct {
	Address                            addressThenLoader[Q]
	CommsEmailContact                  commsEmailContactThenLoader[Q]
	CommsEmailLog                      commsEmailLogThenLoader[Q]
	CommsEmailTemplate                 commsEmailTemplateThenLoader[Q]
	CommsMailer                        commsMailerThenLoader[Q]
	CommsPhone                         commsPhoneThenLoader[Q]
	CommsTextJob                       commsTextJobThenLoader[Q]
	CommsTextLog                       commsTextLogThenLoader[Q]
	Communication                      communicationThenLoader[Q]
	CommunicationLogEntry              communicationLogEntryThenLoader[Q]
	ComplianceReportRequest            complianceReportRequestThenLoader[Q]
	ComplianceReportRequestMailer      complianceReportRequestMailerThenLoader[Q]
	DistrictSubscriptionEmail          districtSubscriptionEmailThenLoader[Q]
	DistrictSubscriptionPhone          districtSubscriptionPhoneThenLoader[Q]
	Feature                            featureThenLoader[Q]
	FeaturePool                        featurePoolThenLoader[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]
	Lead                               leadThenLoader[Q]
	LogImpersonation                   logImpersonationThenLoader[Q]
	NoteAudio                          noteAudioThenLoader[Q]
	NoteAudioBreadcrumb                noteAudioBreadcrumbThenLoader[Q]
	NoteAudioDatum                     noteAudioDatumThenLoader[Q]
	NoteImage                          noteImageThenLoader[Q]
	NoteImageBreadcrumb                noteImageBreadcrumbThenLoader[Q]
	NoteImageDatum                     noteImageDatumThenLoader[Q]
	Notification                       notificationThenLoader[Q]
	Organization                       organizationThenLoader[Q]
	Parcel                             parcelThenLoader[Q]
	PublicreportClient                 publicreportClientThenLoader[Q]
	PublicreportCompliance             publicreportComplianceThenLoader[Q]
	PublicreportImage                  publicreportImageThenLoader[Q]
	PublicreportImageExif              publicreportImageExifThenLoader[Q]
	PublicreportNotifyEmail            publicreportNotifyEmailThenLoader[Q]
	PublicreportNotifyEmailNuisanceOld publicreportNotifyEmailNuisanceOldThenLoader[Q]
	PublicreportNotifyEmailWaterOld    publicreportNotifyEmailWaterOldThenLoader[Q]
	PublicreportNotifyPhone            publicreportNotifyPhoneThenLoader[Q]
	PublicreportNotifyPhoneNuisanceOld publicreportNotifyPhoneNuisanceOldThenLoader[Q]
	PublicreportNotifyPhoneWaterOld    publicreportNotifyPhoneWaterOldThenLoader[Q]
	PublicreportNuisance               publicreportNuisanceThenLoader[Q]
	PublicreportNuisanceImageOld       publicreportNuisanceImageOldThenLoader[Q]
	PublicreportNuisanceOld            publicreportNuisanceOldThenLoader[Q]
	PublicreportReport                 publicreportReportThenLoader[Q]
	PublicreportReportImage            publicreportReportImageThenLoader[Q]
	PublicreportReportLog              publicreportReportLogThenLoader[Q]
	PublicreportSubscribeEmail         publicreportSubscribeEmailThenLoader[Q]
	PublicreportSubscribePhone         publicreportSubscribePhoneThenLoader[Q]
	PublicreportWater                  publicreportWaterThenLoader[Q]
	PublicreportWaterImageOld          publicreportWaterImageOldThenLoader[Q]
	PublicreportWaterOld               publicreportWaterOldThenLoader[Q]
	ReportText                         reportTextThenLoader[Q]
	Resident                           residentThenLoader[Q]
	ReviewTask                         reviewTaskThenLoader[Q]
	ReviewTaskPool                     reviewTaskPoolThenLoader[Q]
	Signal                             signalThenLoader[Q]
	Site                               siteThenLoader[Q]
	TileCachedImage                    tileCachedImageThenLoader[Q]
	TileService                        tileServiceThenLoader[Q]
	User                               userThenLoader[Q]
}

func getThenLoaders[Q orm.Loadable]() thenLoaders[Q] {
	return thenLoaders[Q]{
		Address:                            buildAddressThenLoader[Q](),
		CommsEmailContact:                  buildCommsEmailContactThenLoader[Q](),
		CommsEmailLog:                      buildCommsEmailLogThenLoader[Q](),
		CommsEmailTemplate:                 buildCommsEmailTemplateThenLoader[Q](),
		CommsMailer:                        buildCommsMailerThenLoader[Q](),
		CommsPhone:                         buildCommsPhoneThenLoader[Q](),
		CommsTextJob:                       buildCommsTextJobThenLoader[Q](),
		CommsTextLog:                       buildCommsTextLogThenLoader[Q](),
		Communication:                      buildCommunicationThenLoader[Q](),
		CommunicationLogEntry:              buildCommunicationLogEntryThenLoader[Q](),
		ComplianceReportRequest:            buildComplianceReportRequestThenLoader[Q](),
		ComplianceReportRequestMailer:      buildComplianceReportRequestMailerThenLoader[Q](),
		DistrictSubscriptionEmail:          buildDistrictSubscriptionEmailThenLoader[Q](),
		DistrictSubscriptionPhone:          buildDistrictSubscriptionPhoneThenLoader[Q](),
		Feature:                            buildFeatureThenLoader[Q](),
		FeaturePool:                        buildFeaturePoolThenLoader[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](),
		Lead:                               buildLeadThenLoader[Q](),
		LogImpersonation:                   buildLogImpersonationThenLoader[Q](),
		NoteAudio:                          buildNoteAudioThenLoader[Q](),
		NoteAudioBreadcrumb:                buildNoteAudioBreadcrumbThenLoader[Q](),
		NoteAudioDatum:                     buildNoteAudioDatumThenLoader[Q](),
		NoteImage:                          buildNoteImageThenLoader[Q](),
		NoteImageBreadcrumb:                buildNoteImageBreadcrumbThenLoader[Q](),
		NoteImageDatum:                     buildNoteImageDatumThenLoader[Q](),
		Notification:                       buildNotificationThenLoader[Q](),
		Organization:                       buildOrganizationThenLoader[Q](),
		Parcel:                             buildParcelThenLoader[Q](),
		PublicreportClient:                 buildPublicreportClientThenLoader[Q](),
		PublicreportCompliance:             buildPublicreportComplianceThenLoader[Q](),
		PublicreportImage:                  buildPublicreportImageThenLoader[Q](),
		PublicreportImageExif:              buildPublicreportImageExifThenLoader[Q](),
		PublicreportNotifyEmail:            buildPublicreportNotifyEmailThenLoader[Q](),
		PublicreportNotifyEmailNuisanceOld: buildPublicreportNotifyEmailNuisanceOldThenLoader[Q](),
		PublicreportNotifyEmailWaterOld:    buildPublicreportNotifyEmailWaterOldThenLoader[Q](),
		PublicreportNotifyPhone:            buildPublicreportNotifyPhoneThenLoader[Q](),
		PublicreportNotifyPhoneNuisanceOld: buildPublicreportNotifyPhoneNuisanceOldThenLoader[Q](),
		PublicreportNotifyPhoneWaterOld:    buildPublicreportNotifyPhoneWaterOldThenLoader[Q](),
		PublicreportNuisance:               buildPublicreportNuisanceThenLoader[Q](),
		PublicreportNuisanceImageOld:       buildPublicreportNuisanceImageOldThenLoader[Q](),
		PublicreportNuisanceOld:            buildPublicreportNuisanceOldThenLoader[Q](),
		PublicreportReport:                 buildPublicreportReportThenLoader[Q](),
		PublicreportReportImage:            buildPublicreportReportImageThenLoader[Q](),
		PublicreportReportLog:              buildPublicreportReportLogThenLoader[Q](),
		PublicreportSubscribeEmail:         buildPublicreportSubscribeEmailThenLoader[Q](),
		PublicreportSubscribePhone:         buildPublicreportSubscribePhoneThenLoader[Q](),
		PublicreportWater:                  buildPublicreportWaterThenLoader[Q](),
		PublicreportWaterImageOld:          buildPublicreportWaterImageOldThenLoader[Q](),
		PublicreportWaterOld:               buildPublicreportWaterOldThenLoader[Q](),
		ReportText:                         buildReportTextThenLoader[Q](),
		Resident:                           buildResidentThenLoader[Q](),
		ReviewTask:                         buildReviewTaskThenLoader[Q](),
		ReviewTaskPool:                     buildReviewTaskPoolThenLoader[Q](),
		Signal:                             buildSignalThenLoader[Q](),
		Site:                               buildSiteThenLoader[Q](),
		TileCachedImage:                    buildTileCachedImageThenLoader[Q](),
		TileService:                        buildTileServiceThenLoader[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
		}
	}
}
