func (o *Name) doBeforeInsertHooks(ctx context.Context, exec boil.ContextExecutor) (err error) {
	if boil.HooksAreSkipped(ctx) {
		return nil
	}
	for _, hook := range nameBeforeInsertHooks {
		if err := hook(ctx, exec, o); err != nil {
			return err
		}
	}
	return nil
}
doBeforeInsertHooks executes all "before insert" hooks.
package models
import (
	"context"
	"database/sql"
	"fmt"
	"reflect"
	"strconv"
	"strings"
	"sync"
	"time"
	"github.com/friendsofgo/errors"
	"github.com/volatiletech/null"
	"github.com/volatiletech/sqlboiler/boil"
	"github.com/volatiletech/sqlboiler/queries"
	"github.com/volatiletech/sqlboiler/queries/qm"
	"github.com/volatiletech/sqlboiler/queries/qmhelper"
	"github.com/volatiletech/sqlboiler/strmangle"
	"github.com/volatiletech/sqlboiler/types"
)
type Name struct {
	Nconst             string            `boil:"nconst" json:"nconst" toml:"nconst" yaml:"nconst"`
	PrimaryName        null.String       `boil:"primary_name" json:"primary_name,omitempty" toml:"primary_name" yaml:"primary_name,omitempty"`
	BirthYear          null.String       `boil:"birth_year" json:"birth_year,omitempty" toml:"birth_year" yaml:"birth_year,omitempty"`
	DeathYear          null.String       `boil:"death_year" json:"death_year,omitempty" toml:"death_year" yaml:"death_year,omitempty"`
	PrimaryProfessions types.StringArray `boil:"primary_professions" json:"primary_professions,omitempty" toml:"primary_professions" yaml:"primary_professions,omitempty"`
	KnownForTitles     types.StringArray `boil:"known_for_titles" json:"known_for_titles,omitempty" toml:"known_for_titles" yaml:"known_for_titles,omitempty"`
	R *nameR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L nameL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}
var NameColumns = struct {
	Nconst             string
	PrimaryName        string
	BirthYear          string
	DeathYear          string
	PrimaryProfessions string
	KnownForTitles     string
}{
	Nconst:             "nconst",
	PrimaryName:        "primary_name",
	BirthYear:          "birth_year",
	DeathYear:          "death_year",
	PrimaryProfessions: "primary_professions",
	KnownForTitles:     "known_for_titles",
}
type whereHelperstring struct{ field string }
func (w whereHelperstring) EQ(x string) qm.QueryMod  { return qmhelper.Where(w.field, qmhelper.EQ, x) }
func (w whereHelperstring) NEQ(x string) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.NEQ, x) }
func (w whereHelperstring) LT(x string) qm.QueryMod  { return qmhelper.Where(w.field, qmhelper.LT, x) }
func (w whereHelperstring) LTE(x string) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.LTE, x) }
func (w whereHelperstring) GT(x string) qm.QueryMod  { return qmhelper.Where(w.field, qmhelper.GT, x) }
func (w whereHelperstring) GTE(x string) qm.QueryMod { return qmhelper.Where(w.field, qmhelper.GTE, x) }
func (w whereHelperstring) IN(slice []string) qm.QueryMod {
	values := make([]interface{}, 0, len(slice))
	for _, value := range slice {
		values = append(values, value)
	}
	return qm.WhereIn(fmt.Sprintf("%s IN ?", w.field), values...)
}
type whereHelpernull_String struct{ field string }
func (w whereHelpernull_String) EQ(x null.String) qm.QueryMod {
	return qmhelper.WhereNullEQ(w.field, false, x)
}
func (w whereHelpernull_String) NEQ(x null.String) qm.QueryMod {
	return qmhelper.WhereNullEQ(w.field, true, x)
}
func (w whereHelpernull_String) IsNull() qm.QueryMod    { return qmhelper.WhereIsNull(w.field) }
func (w whereHelpernull_String) IsNotNull() qm.QueryMod { return qmhelper.WhereIsNotNull(w.field) }
func (w whereHelpernull_String) LT(x null.String) qm.QueryMod {
	return qmhelper.Where(w.field, qmhelper.LT, x)
}
func (w whereHelpernull_String) LTE(x null.String) qm.QueryMod {
	return qmhelper.Where(w.field, qmhelper.LTE, x)
}
func (w whereHelpernull_String) GT(x null.String) qm.QueryMod {
	return qmhelper.Where(w.field, qmhelper.GT, x)
}
func (w whereHelpernull_String) GTE(x null.String) qm.QueryMod {
	return qmhelper.Where(w.field, qmhelper.GTE, x)
}
type whereHelpertypes_StringArray struct{ field string }
func (w whereHelpertypes_StringArray) EQ(x types.StringArray) qm.QueryMod {
	return qmhelper.WhereNullEQ(w.field, false, x)
}
func (w whereHelpertypes_StringArray) NEQ(x types.StringArray) qm.QueryMod {
	return qmhelper.WhereNullEQ(w.field, true, x)
}
func (w whereHelpertypes_StringArray) IsNull() qm.QueryMod { return qmhelper.WhereIsNull(w.field) }
func (w whereHelpertypes_StringArray) IsNotNull() qm.QueryMod {
	return qmhelper.WhereIsNotNull(w.field)
}
func (w whereHelpertypes_StringArray) LT(x types.StringArray) qm.QueryMod {
	return qmhelper.Where(w.field, qmhelper.LT, x)
}
func (w whereHelpertypes_StringArray) LTE(x types.StringArray) qm.QueryMod {
	return qmhelper.Where(w.field, qmhelper.LTE, x)
}
func (w whereHelpertypes_StringArray) GT(x types.StringArray) qm.QueryMod {
	return qmhelper.Where(w.field, qmhelper.GT, x)
}
func (w whereHelpertypes_StringArray) GTE(x types.StringArray) qm.QueryMod {
	return qmhelper.Where(w.field, qmhelper.GTE, x)
}
var NameWhere = struct {
	Nconst             whereHelperstring
	PrimaryName        whereHelpernull_String
	BirthYear          whereHelpernull_String
	DeathYear          whereHelpernull_String
	PrimaryProfessions whereHelpertypes_StringArray
	KnownForTitles     whereHelpertypes_StringArray
}{
	Nconst:             whereHelperstring{field: "\"names\".\"nconst\""},
	PrimaryName:        whereHelpernull_String{field: "\"names\".\"primary_name\""},
	BirthYear:          whereHelpernull_String{field: "\"names\".\"birth_year\""},
	DeathYear:          whereHelpernull_String{field: "\"names\".\"death_year\""},
	PrimaryProfessions: whereHelpertypes_StringArray{field: "\"names\".\"primary_professions\""},
	KnownForTitles:     whereHelpertypes_StringArray{field: "\"names\".\"known_for_titles\""},
}
var NameRels = struct {
}{}
type nameR struct {
}
func (*nameR) NewStruct() *nameR {
	return &nameR{}
}
type nameL struct{}
var (
	nameAllColumns            = []string{"nconst", "primary_name", "birth_year", "death_year", "primary_professions", "known_for_titles"}
	nameColumnsWithoutDefault = []string{"nconst", "primary_name", "birth_year", "primary_professions", "known_for_titles"}
	nameColumnsWithDefault    = []string{"death_year"}
	namePrimaryKeyColumns     = []string{"nconst"}
)
type (
	NameSlice []*Name
	NameHook func(context.Context, boil.ContextExecutor, *Name) error
	nameQuery struct {
		*queries.Query
	}
)
var (
	nameType                 = reflect.TypeOf(&Name{})
	nameMapping              = queries.MakeStructMapping(nameType)
	namePrimaryKeyMapping, _ = queries.BindMapping(nameType, nameMapping, namePrimaryKeyColumns)
	nameInsertCacheMut       sync.RWMutex
	nameInsertCache          = make(map[string]insertCache)
	nameUpdateCacheMut       sync.RWMutex
	nameUpdateCache          = make(map[string]updateCache)
	nameUpsertCacheMut       sync.RWMutex
	nameUpsertCache          = make(map[string]insertCache)
)
var (
	_ = time.Second
	_ = qmhelper.Where
)
var nameBeforeInsertHooks []NameHook
var nameBeforeUpdateHooks []NameHook
var nameBeforeDeleteHooks []NameHook
var nameBeforeUpsertHooks []NameHook
var nameAfterInsertHooks []NameHook
var nameAfterSelectHooks []NameHook
var nameAfterUpdateHooks []NameHook
var nameAfterDeleteHooks []NameHook
var nameAfterUpsertHooks []NameHook