func (storageL) LoadFiles(e boil.Executor, singular bool, maybeStorage interface{}) error {
	var slice []*Storage
	var object *Storage
	count := 1
	if singular {
		object = maybeStorage.(*Storage)
	} else {
		slice = *maybeStorage.(*[]*Storage)
		count = len(slice)
	}
	args := make([]interface{}, count)
	if singular {
		if object.R == nil {
			object.R = &storageR{}
		}
		args[0] = object.ID
	} else {
		for i, obj := range slice {
			if obj.R == nil {
				obj.R = &storageR{}
			}
			args[i] = obj.ID
		}
	}
	query := fmt.Sprintf(
		"select \"a\".*, \"b\".\"storage_id\" from \"files\" as \"a\" inner join \"files_storages\" as \"b\" on \"a\".\"id\" = \"b\".\"file_id\" where \"b\".\"storage_id\" in (%s)",
		strmangle.Placeholders(dialect.IndexPlaceholders, count, 1, 1),
	)
	if boil.DebugMode {
		fmt.Fprintf(boil.DebugWriter, "%s\n%v\n", query, args)
	}
	results, err := e.Query(query, args...)
	if err != nil {
		return errors.Wrap(err, "failed to eager load files")
	}
	defer results.Close()
	var resultSlice []*File
	var localJoinCols []int64
	for results.Next() {
		one := new(File)
		var localJoinCol int64
		err = results.Scan(&one.ID, &one.UID, &one.Name, &one.Size, &one.Type, &one.SubType, &one.MimeType, &one.Sha1, &one.ContentUnitID, &one.CreatedAt, &one.Language, &one.BackupCount, &one.FirstBackupTime, &one.Properties, &one.ParentID, &one.FileCreatedAt, &one.Secure, &one.Published, &one.RemovedAt, &localJoinCol)
		if err = results.Err(); err != nil {
			return errors.Wrap(err, "failed to plebian-bind eager loaded slice files")
		}
		resultSlice = append(resultSlice, one)
		localJoinCols = append(localJoinCols, localJoinCol)
	}
	if err = results.Err(); err != nil {
		return errors.Wrap(err, "failed to plebian-bind eager loaded slice files")
	}
	if singular {
		object.R.Files = resultSlice
		return nil
	}
	for i, foreign := range resultSlice {
		localJoinCol := localJoinCols[i]
		for _, local := range slice {
			if local.ID == localJoinCol {
				local.R.Files = append(local.R.Files, foreign)
				break
			}
		}
	}
	return nil
}
LoadFiles allows an eager lookup of values, cached into the
loaded structs of the objects.
package mdbmodels
import (
	"bytes"
	"database/sql"
	"fmt"
	"reflect"
	"strings"
	"sync"
	"time"
	"github.com/Bnei-Baruch/sqlboiler/boil"
	"github.com/Bnei-Baruch/sqlboiler/queries"
	"github.com/Bnei-Baruch/sqlboiler/queries/qm"
	"github.com/Bnei-Baruch/sqlboiler/strmangle"
	"github.com/pkg/errors"
)
type Storage struct {
	ID       int64  `boil:"id" json:"id" toml:"id" yaml:"id"`
	Name     string `boil:"name" json:"name" toml:"name" yaml:"name"`
	Country  string `boil:"country" json:"country" toml:"country" yaml:"country"`
	Location string `boil:"location" json:"location" toml:"location" yaml:"location"`
	Status   string `boil:"status" json:"status" toml:"status" yaml:"status"`
	Access   string `boil:"access" json:"access" toml:"access" yaml:"access"`
	R *storageR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L storageL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}
var StorageColumns = struct {
	ID       string
	Name     string
	Country  string
	Location string
	Status   string
	Access   string
}{
	ID:       "id",
	Name:     "name",
	Country:  "country",
	Location: "location",
	Status:   "status",
	Access:   "access",
}
type storageR struct {
	Files FileSlice
}
type storageL struct{}
var (
	storageColumns               = []string{"id", "name", "country", "location", "status", "access"}
	storageColumnsWithoutDefault = []string{"name", "country", "location", "status", "access"}
	storageColumnsWithDefault    = []string{"id"}
	storagePrimaryKeyColumns     = []string{"id"}
)
type (
	StorageSlice []*Storage
	storageQuery struct {
		*queries.Query
	}
)
var (
	storageType                 = reflect.TypeOf(&Storage{})
	storageMapping              = queries.MakeStructMapping(storageType)
	storagePrimaryKeyMapping, _ = queries.BindMapping(storageType, storageMapping, storagePrimaryKeyColumns)
	storageInsertCacheMut       sync.RWMutex
	storageInsertCache          = make(map[string]insertCache)
	storageUpdateCacheMut       sync.RWMutex
	storageUpdateCache          = make(map[string]updateCache)
	storageUpsertCacheMut       sync.RWMutex
	storageUpsertCache          = make(map[string]insertCache)
)
var (
	_ = time.Second
	_ = bytes.MinRead
)
func (q storageQuery) OneP() *Storage {
	o, err := q.One()
	if err != nil {
		panic(boil.WrapErr(err))
	}
	return o
}
func (q storageQuery) One() (*Storage, error) {
	o := &Storage{}
	queries.SetLimit(q.Query, 1)
	err := q.Bind(o)
	if err != nil {
		if errors.Cause(err) == sql.ErrNoRows {
			return nil, sql.ErrNoRows
		}
		return nil, errors.Wrap(err, "mdbmodels: failed to execute a one query for storages")
	}
	return o, nil
}
func (q storageQuery) AllP() StorageSlice {
	o, err := q.All()
	if err != nil {
		panic(boil.WrapErr(err))
	}
	return o
}
func (q storageQuery) All() (StorageSlice, error) {
	var o []*Storage
	err := q.Bind(&o)
	if err != nil {
		return nil, errors.Wrap(err, "mdbmodels: failed to assign all query results to Storage slice")
	}
	return o, nil
}
func (q storageQuery) CountP() int64 {
	c, err := q.Count()
	if err != nil {
		panic(boil.WrapErr(err))
	}
	return c
}
func (q storageQuery) Count() (int64, error) {
	var count int64
	queries.SetSelect(q.Query, nil)
	queries.SetCount(q.Query)
	err := q.Query.QueryRow().Scan(&count)
	if err != nil {
		return 0, errors.Wrap(err, "mdbmodels: failed to count storages rows")
	}
	return count, nil
}
func (q storageQuery) ExistsP() bool {
	e, err := q.Exists()
	if err != nil {
		panic(boil.WrapErr(err))
	}
	return e
}
func (q storageQuery) Exists() (bool, error) {
	var count int64
	queries.SetCount(q.Query)
	queries.SetLimit(q.Query, 1)
	err := q.Query.QueryRow().Scan(&count)
	if err != nil {
		return false, errors.Wrap(err, "mdbmodels: failed to check if storages exists")
	}
	return count > 0, nil
}
func (o *Storage) FilesG(mods ...qm.QueryMod) fileQuery {
	return o.Files(boil.GetDB(), mods...)
}
func (o *Storage) Files(exec boil.Executor, mods ...qm.QueryMod) fileQuery {
	var queryMods []qm.QueryMod
	if len(mods) != 0 {
		queryMods = append(queryMods, mods...)
	}
	queryMods = append(queryMods,
		qm.InnerJoin("\"files_storages\" on \"files\".\"id\" = \"files_storages\".\"file_id\""),
		qm.Where("\"files_storages\".\"storage_id\"=?", o.ID),
	)
	query := Files(exec, queryMods...)
	queries.SetFrom(query.Query, "\"files\"")
	if len(queries.GetSelect(query.Query)) == 0 {
		queries.SetSelect(query.Query, []string{"\"files\".*"})
	}
	return query
}