func (userL) LoadOperations(e boil.Executor, singular bool, maybeUser interface{}) error {
	var slice []*User
	var object *User
	count := 1
	if singular {
		object = maybeUser.(*User)
	} else {
		slice = *maybeUser.(*[]*User)
		count = len(slice)
	}
	args := make([]interface{}, count)
	if singular {
		if object.R == nil {
			object.R = &userR{}
		}
		args[0] = object.ID
	} else {
		for i, obj := range slice {
			if obj.R == nil {
				obj.R = &userR{}
			}
			args[i] = obj.ID
		}
	}
	query := fmt.Sprintf(
		"select * from \"operations\" where \"user_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 operations")
	}
	defer results.Close()
	var resultSlice []*Operation
	if err = queries.Bind(results, &resultSlice); err != nil {
		return errors.Wrap(err, "failed to bind eager loaded slice operations")
	}
	if singular {
		object.R.Operations = resultSlice
		return nil
	}
	for _, foreign := range resultSlice {
		for _, local := range slice {
			if local.ID == foreign.UserID.Int64 {
				local.R.Operations = append(local.R.Operations, foreign)
				break
			}
		}
	}
	return nil
}
LoadOperations 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"
	"gopkg.in/volatiletech/null.v6"
)
type User struct {
	ID        int64       `boil:"id" json:"id" toml:"id" yaml:"id"`
	Email     string      `boil:"email" json:"email" toml:"email" yaml:"email"`
	Name      null.String `boil:"name" json:"name,omitempty" toml:"name" yaml:"name,omitempty"`
	Phone     null.String `boil:"phone" json:"phone,omitempty" toml:"phone" yaml:"phone,omitempty"`
	Comments  null.String `boil:"comments" json:"comments,omitempty" toml:"comments" yaml:"comments,omitempty"`
	CreatedAt time.Time   `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`
	UpdatedAt null.Time   `boil:"updated_at" json:"updated_at,omitempty" toml:"updated_at" yaml:"updated_at,omitempty"`
	DeletedAt null.Time   `boil:"deleted_at" json:"deleted_at,omitempty" toml:"deleted_at" yaml:"deleted_at,omitempty"`
	R *userR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L userL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}
var UserColumns = struct {
	ID        string
	Email     string
	Name      string
	Phone     string
	Comments  string
	CreatedAt string
	UpdatedAt string
	DeletedAt string
}{
	ID:        "id",
	Email:     "email",
	Name:      "name",
	Phone:     "phone",
	Comments:  "comments",
	CreatedAt: "created_at",
	UpdatedAt: "updated_at",
	DeletedAt: "deleted_at",
}
type userR struct {
	CollectionI18ns  CollectionI18nSlice
	ContentUnitI18ns ContentUnitI18nSlice
	Operations       OperationSlice
	PersonI18ns      PersonI18nSlice
	PublisherI18ns   PublisherI18nSlice
	TagI18ns         TagI18nSlice
}
type userL struct{}
var (
	userColumns               = []string{"id", "email", "name", "phone", "comments", "created_at", "updated_at", "deleted_at"}
	userColumnsWithoutDefault = []string{"email", "name", "phone", "comments", "updated_at", "deleted_at"}
	userColumnsWithDefault    = []string{"id", "created_at"}
	userPrimaryKeyColumns     = []string{"id"}
)
type (
	UserSlice []*User
	userQuery struct {
		*queries.Query
	}
)
var (
	userType                 = reflect.TypeOf(&User{})
	userMapping              = queries.MakeStructMapping(userType)
	userPrimaryKeyMapping, _ = queries.BindMapping(userType, userMapping, userPrimaryKeyColumns)
	userInsertCacheMut       sync.RWMutex
	userInsertCache          = make(map[string]insertCache)
	userUpdateCacheMut       sync.RWMutex
	userUpdateCache          = make(map[string]updateCache)
	userUpsertCacheMut       sync.RWMutex
	userUpsertCache          = make(map[string]insertCache)
)
var (
	_ = time.Second
	_ = bytes.MinRead
)
func (q userQuery) OneP() *User {
	o, err := q.One()
	if err != nil {
		panic(boil.WrapErr(err))
	}
	return o
}
func (q userQuery) One() (*User, error) {
	o := &User{}
	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 users")
	}
	return o, nil
}
func (q userQuery) AllP() UserSlice {
	o, err := q.All()
	if err != nil {
		panic(boil.WrapErr(err))
	}
	return o
}
func (q userQuery) All() (UserSlice, error) {
	var o []*User
	err := q.Bind(&o)
	if err != nil {
		return nil, errors.Wrap(err, "mdbmodels: failed to assign all query results to User slice")
	}
	return o, nil
}
func (q userQuery) CountP() int64 {
	c, err := q.Count()
	if err != nil {
		panic(boil.WrapErr(err))
	}
	return c
}
func (q userQuery) 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 users rows")
	}
	return count, nil
}
func (q userQuery) ExistsP() bool {
	e, err := q.Exists()
	if err != nil {
		panic(boil.WrapErr(err))
	}
	return e
}
func (q userQuery) 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 users exists")
	}
	return count > 0, nil
}
func (o *User) CollectionI18nsG(mods ...qm.QueryMod) collectionI18nQuery {
	return o.CollectionI18ns(boil.GetDB(), mods...)
}
func (o *User) CollectionI18ns(exec boil.Executor, mods ...qm.QueryMod) collectionI18nQuery {
	var queryMods []qm.QueryMod
	if len(mods) != 0 {
		queryMods = append(queryMods, mods...)
	}
	queryMods = append(queryMods,
		qm.Where("\"collection_i18n\".\"user_id\"=?", o.ID),
	)
	query := CollectionI18ns(exec, queryMods...)
	queries.SetFrom(query.Query, "\"collection_i18n\"")
	if len(queries.GetSelect(query.Query)) == 0 {
		queries.SetSelect(query.Query, []string{"\"collection_i18n\".*"})
	}
	return query
}
func (o *User) ContentUnitI18nsG(mods ...qm.QueryMod) contentUnitI18nQuery {
	return o.ContentUnitI18ns(boil.GetDB(), mods...)
}
func (o *User) ContentUnitI18ns(exec boil.Executor, mods ...qm.QueryMod) contentUnitI18nQuery {
	var queryMods []qm.QueryMod
	if len(mods) != 0 {
		queryMods = append(queryMods, mods...)
	}
	queryMods = append(queryMods,
		qm.Where("\"content_unit_i18n\".\"user_id\"=?", o.ID),
	)
	query := ContentUnitI18ns(exec, queryMods...)
	queries.SetFrom(query.Query, "\"content_unit_i18n\"")
	if len(queries.GetSelect(query.Query)) == 0 {
		queries.SetSelect(query.Query, []string{"\"content_unit_i18n\".*"})
	}
	return query
}
func (o *User) OperationsG(mods ...qm.QueryMod) operationQuery {
	return o.Operations(boil.GetDB(), mods...)
}
func (o *User) Operations(exec boil.Executor, mods ...qm.QueryMod) operationQuery {
	var queryMods []qm.QueryMod
	if len(mods) != 0 {
		queryMods = append(queryMods, mods...)
	}
	queryMods = append(queryMods,
		qm.Where("\"operations\".\"user_id\"=?", o.ID),
	)
	query := Operations(exec, queryMods...)
	queries.SetFrom(query.Query, "\"operations\"")
	if len(queries.GetSelect(query.Query)) == 0 {
		queries.SetSelect(query.Query, []string{"\"operations\".*"})
	}
	return query
}
func (o *User) PersonI18nsG(mods ...qm.QueryMod) personI18nQuery {
	return o.PersonI18ns(boil.GetDB(), mods...)
}
func (o *User) PersonI18ns(exec boil.Executor, mods ...qm.QueryMod) personI18nQuery {
	var queryMods []qm.QueryMod
	if len(mods) != 0 {
		queryMods = append(queryMods, mods...)
	}
	queryMods = append(queryMods,
		qm.Where("\"person_i18n\".\"user_id\"=?", o.ID),
	)
	query := PersonI18ns(exec, queryMods...)
	queries.SetFrom(query.Query, "\"person_i18n\"")
	if len(queries.GetSelect(query.Query)) == 0 {
		queries.SetSelect(query.Query, []string{"\"person_i18n\".*"})
	}
	return query
}
func (o *User) PublisherI18nsG(mods ...qm.QueryMod) publisherI18nQuery {
	return o.PublisherI18ns(boil.GetDB(), mods...)
}
func (o *User) PublisherI18ns(exec boil.Executor, mods ...qm.QueryMod) publisherI18nQuery {
	var queryMods []qm.QueryMod
	if len(mods) != 0 {
		queryMods = append(queryMods, mods...)
	}
	queryMods = append(queryMods,
		qm.Where("\"publisher_i18n\".\"user_id\"=?", o.ID),
	)
	query := PublisherI18ns(exec, queryMods...)
	queries.SetFrom(query.Query, "\"publisher_i18n\"")
	if len(queries.GetSelect(query.Query)) == 0 {
		queries.SetSelect(query.Query, []string{"\"publisher_i18n\".*"})
	}
	return query
}
func (o *User) TagI18nsG(mods ...qm.QueryMod) tagI18nQuery {
	return o.TagI18ns(boil.GetDB(), mods...)
}
func (o *User) TagI18ns(exec boil.Executor, mods ...qm.QueryMod) tagI18nQuery {
	var queryMods []qm.QueryMod
	if len(mods) != 0 {
		queryMods = append(queryMods, mods...)
	}
	queryMods = append(queryMods,
		qm.Where("\"tag_i18n\".\"user_id\"=?", o.ID),
	)
	query := TagI18ns(exec, queryMods...)
	queries.SetFrom(query.Query, "\"tag_i18n\"")
	if len(queries.GetSelect(query.Query)) == 0 {
		queries.SetSelect(query.Query, []string{"\"tag_i18n\".*"})
	}
	return query
}
func (userL) LoadCollectionI18ns(e boil.Executor, singular bool, maybeUser interface{}) error {
	var slice []*User
	var object *User
	count := 1
	if singular {
		object = maybeUser.(*User)
	} else {
		slice = *maybeUser.(*[]*User)
		count = len(slice)
	}
	args := make([]interface{}, count)
	if singular {
		if object.R == nil {
			object.R = &userR{}
		}
		args[0] = object.ID
	} else {
		for i, obj := range slice {
			if obj.R == nil {
				obj.R = &userR{}
			}
			args[i] = obj.ID
		}
	}
	query := fmt.Sprintf(
		"select * from \"collection_i18n\" where \"user_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 collection_i18n")
	}
	defer results.Close()
	var resultSlice []*CollectionI18n
	if err = queries.Bind(results, &resultSlice); err != nil {
		return errors.Wrap(err, "failed to bind eager loaded slice collection_i18n")
	}
	if singular {
		object.R.CollectionI18ns = resultSlice
		return nil
	}
	for _, foreign := range resultSlice {
		for _, local := range slice {
			if local.ID == foreign.UserID.Int64 {
				local.R.CollectionI18ns = append(local.R.CollectionI18ns, foreign)
				break
			}
		}
	}
	return nil
}
func (userL) LoadContentUnitI18ns(e boil.Executor, singular bool, maybeUser interface{}) error {
	var slice []*User
	var object *User
	count := 1
	if singular {
		object = maybeUser.(*User)
	} else {
		slice = *maybeUser.(*[]*User)
		count = len(slice)
	}
	args := make([]interface{}, count)
	if singular {
		if object.R == nil {
			object.R = &userR{}
		}
		args[0] = object.ID
	} else {
		for i, obj := range slice {
			if obj.R == nil {
				obj.R = &userR{}
			}
			args[i] = obj.ID
		}
	}
	query := fmt.Sprintf(
		"select * from \"content_unit_i18n\" where \"user_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 content_unit_i18n")
	}
	defer results.Close()
	var resultSlice []*ContentUnitI18n
	if err = queries.Bind(results, &resultSlice); err != nil {
		return errors.Wrap(err, "failed to bind eager loaded slice content_unit_i18n")
	}
	if singular {
		object.R.ContentUnitI18ns = resultSlice
		return nil
	}
	for _, foreign := range resultSlice {
		for _, local := range slice {
			if local.ID == foreign.UserID.Int64 {
				local.R.ContentUnitI18ns = append(local.R.ContentUnitI18ns, foreign)
				break
			}
		}
	}
	return nil
}