func (o *PersonI18n) RemoveUserG(related *User) error {
	return o.RemoveUser(boil.GetDB(), related)
}
RemoveUserG relationship.
Sets o.R.User to nil.
Removes o from all passed in related items' relationships struct (Optional).
Uses the global database handle.
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 PersonI18n struct {
	PersonID         int64       `boil:"person_id" json:"person_id" toml:"person_id" yaml:"person_id"`
	Language         string      `boil:"language" json:"language" toml:"language" yaml:"language"`
	OriginalLanguage null.String `boil:"original_language" json:"original_language,omitempty" toml:"original_language" yaml:"original_language,omitempty"`
	Name             null.String `boil:"name" json:"name,omitempty" toml:"name" yaml:"name,omitempty"`
	Description      null.String `boil:"description" json:"description,omitempty" toml:"description" yaml:"description,omitempty"`
	UserID           null.Int64  `boil:"user_id" json:"user_id,omitempty" toml:"user_id" yaml:"user_id,omitempty"`
	CreatedAt        time.Time   `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`
	R *personI18nR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L personI18nL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}
var PersonI18nColumns = struct {
	PersonID         string
	Language         string
	OriginalLanguage string
	Name             string
	Description      string
	UserID           string
	CreatedAt        string
}{
	PersonID:         "person_id",
	Language:         "language",
	OriginalLanguage: "original_language",
	Name:             "name",
	Description:      "description",
	UserID:           "user_id",
	CreatedAt:        "created_at",
}
type personI18nR struct {
	Person *Person
	User   *User
}
type personI18nL struct{}
var (
	personI18nColumns               = []string{"person_id", "language", "original_language", "name", "description", "user_id", "created_at"}
	personI18nColumnsWithoutDefault = []string{"person_id", "language", "original_language", "name", "description", "user_id"}
	personI18nColumnsWithDefault    = []string{"created_at"}
	personI18nPrimaryKeyColumns     = []string{"person_id", "language"}
)
type (
	PersonI18nSlice []*PersonI18n
	personI18nQuery struct {
		*queries.Query
	}
)
var (
	personI18nType                 = reflect.TypeOf(&PersonI18n{})
	personI18nMapping              = queries.MakeStructMapping(personI18nType)
	personI18nPrimaryKeyMapping, _ = queries.BindMapping(personI18nType, personI18nMapping, personI18nPrimaryKeyColumns)
	personI18nInsertCacheMut       sync.RWMutex
	personI18nInsertCache          = make(map[string]insertCache)
	personI18nUpdateCacheMut       sync.RWMutex
	personI18nUpdateCache          = make(map[string]updateCache)
	personI18nUpsertCacheMut       sync.RWMutex
	personI18nUpsertCache          = make(map[string]insertCache)
)
var (
	_ = time.Second
	_ = bytes.MinRead
)
func (q personI18nQuery) OneP() *PersonI18n {
	o, err := q.One()
	if err != nil {
		panic(boil.WrapErr(err))
	}
	return o
}
func (q personI18nQuery) One() (*PersonI18n, error) {
	o := &PersonI18n{}
	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 person_i18n")
	}
	return o, nil
}
func (q personI18nQuery) AllP() PersonI18nSlice {
	o, err := q.All()
	if err != nil {
		panic(boil.WrapErr(err))
	}
	return o
}
func (q personI18nQuery) All() (PersonI18nSlice, error) {
	var o []*PersonI18n
	err := q.Bind(&o)
	if err != nil {
		return nil, errors.Wrap(err, "mdbmodels: failed to assign all query results to PersonI18n slice")
	}
	return o, nil
}
func (q personI18nQuery) CountP() int64 {
	c, err := q.Count()
	if err != nil {
		panic(boil.WrapErr(err))
	}
	return c
}
func (q personI18nQuery) 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 person_i18n rows")
	}
	return count, nil
}
func (q personI18nQuery) ExistsP() bool {
	e, err := q.Exists()
	if err != nil {
		panic(boil.WrapErr(err))
	}
	return e
}
func (q personI18nQuery) 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 person_i18n exists")
	}
	return count > 0, nil
}
func (o *PersonI18n) PersonG(mods ...qm.QueryMod) personQuery {
	return o.Person(boil.GetDB(), mods...)
}
func (o *PersonI18n) Person(exec boil.Executor, mods ...qm.QueryMod) personQuery {
	queryMods := []qm.QueryMod{
		qm.Where("id=?", o.PersonID),
	}
	queryMods = append(queryMods, mods...)
	query := Persons(exec, queryMods...)
	queries.SetFrom(query.Query, "\"persons\"")
	return query
}
func (o *PersonI18n) UserG(mods ...qm.QueryMod) userQuery {
	return o.User(boil.GetDB(), mods...)
}
func (o *PersonI18n) User(exec boil.Executor, mods ...qm.QueryMod) userQuery {
	queryMods := []qm.QueryMod{
		qm.Where("id=?", o.UserID),
	}
	queryMods = append(queryMods, mods...)
	query := Users(exec, queryMods...)
	queries.SetFrom(query.Query, "\"users\"")
	return query
}  
func (personI18nL) LoadPerson(e boil.Executor, singular bool, maybePersonI18n interface{}) error {
	var slice []*PersonI18n
	var object *PersonI18n
	count := 1
	if singular {
		object = maybePersonI18n.(*PersonI18n)
	} else {
		slice = *maybePersonI18n.(*[]*PersonI18n)
		count = len(slice)
	}
	args := make([]interface{}, count)
	if singular {
		if object.R == nil {
			object.R = &personI18nR{}
		}
		args[0] = object.PersonID
	} else {
		for i, obj := range slice {
			if obj.R == nil {
				obj.R = &personI18nR{}
			}
			args[i] = obj.PersonID
		}
	}
	query := fmt.Sprintf(
		"select * from \"persons\" where \"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 Person")
	}
	defer results.Close()
	var resultSlice []*Person
	if err = queries.Bind(results, &resultSlice); err != nil {
		return errors.Wrap(err, "failed to bind eager loaded slice Person")
	}
	if len(resultSlice) == 0 {
		return nil
	}
	if singular {
		object.R.Person = resultSlice[0]
		return nil
	}
	for _, local := range slice {
		for _, foreign := range resultSlice {
			if local.PersonID == foreign.ID {
				local.R.Person = foreign
				break
			}
		}
	}
	return nil
}
func (personI18nL) LoadUser(e boil.Executor, singular bool, maybePersonI18n interface{}) error {
	var slice []*PersonI18n
	var object *PersonI18n
	count := 1
	if singular {
		object = maybePersonI18n.(*PersonI18n)
	} else {
		slice = *maybePersonI18n.(*[]*PersonI18n)
		count = len(slice)
	}
	args := make([]interface{}, count)
	if singular {
		if object.R == nil {
			object.R = &personI18nR{}
		}
		args[0] = object.UserID
	} else {
		for i, obj := range slice {
			if obj.R == nil {
				obj.R = &personI18nR{}
			}
			args[i] = obj.UserID
		}
	}
	query := fmt.Sprintf(
		"select * from \"users\" where \"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 User")
	}
	defer results.Close()
	var resultSlice []*User
	if err = queries.Bind(results, &resultSlice); err != nil {
		return errors.Wrap(err, "failed to bind eager loaded slice User")
	}
	if len(resultSlice) == 0 {
		return nil
	}
	if singular {
		object.R.User = resultSlice[0]
		return nil
	}
	for _, local := range slice {
		for _, foreign := range resultSlice {
			if local.UserID.Int64 == foreign.ID {
				local.R.User = foreign
				break
			}
		}
	}
	return nil
}
func (o *PersonI18n) SetPersonG(insert bool, related *Person) error {
	return o.SetPerson(boil.GetDB(), insert, related)
}
func (o *PersonI18n) SetPersonP(exec boil.Executor, insert bool, related *Person) {
	if err := o.SetPerson(exec, insert, related); err != nil {
		panic(boil.WrapErr(err))
	}
}
func (o *PersonI18n) SetPersonGP(insert bool, related *Person) {
	if err := o.SetPerson(boil.GetDB(), insert, related); err != nil {
		panic(boil.WrapErr(err))
	}
}
func (o *PersonI18n) SetPerson(exec boil.Executor, insert bool, related *Person) error {
	var err error
	if insert {
		if err = related.Insert(exec); err != nil {
			return errors.Wrap(err, "failed to insert into foreign table")
		}
	}
	updateQuery := fmt.Sprintf(
		"UPDATE \"person_i18n\" SET %s WHERE %s",
		strmangle.SetParamNames("\"", "\"", 1, []string{"person_id"}),
		strmangle.WhereClause("\"", "\"", 2, personI18nPrimaryKeyColumns),
	)
	values := []interface{}{related.ID, o.PersonID, o.Language}
	if boil.DebugMode {
		fmt.Fprintln(boil.DebugWriter, updateQuery)
		fmt.Fprintln(boil.DebugWriter, values)
	}
	if _, err = exec.Exec(updateQuery, values...); err != nil {
		return errors.Wrap(err, "failed to update local table")
	}
	o.PersonID = related.ID
	if o.R == nil {
		o.R = &personI18nR{
			Person: related,
		}
	} else {
		o.R.Person = related
	}
	if related.R == nil {
		related.R = &personR{
			PersonI18ns: PersonI18nSlice{o},
		}
	} else {
		related.R.PersonI18ns = append(related.R.PersonI18ns, o)
	}
	return nil
}
func (o *PersonI18n) SetUserG(insert bool, related *User) error {
	return o.SetUser(boil.GetDB(), insert, related)
}
func (o *PersonI18n) SetUserP(exec boil.Executor, insert bool, related *User) {
	if err := o.SetUser(exec, insert, related); err != nil {
		panic(boil.WrapErr(err))
	}
}
func (o *PersonI18n) SetUserGP(insert bool, related *User) {
	if err := o.SetUser(boil.GetDB(), insert, related); err != nil {
		panic(boil.WrapErr(err))
	}
}
func (o *PersonI18n) SetUser(exec boil.Executor, insert bool, related *User) error {
	var err error
	if insert {
		if err = related.Insert(exec); err != nil {
			return errors.Wrap(err, "failed to insert into foreign table")
		}
	}
	updateQuery := fmt.Sprintf(
		"UPDATE \"person_i18n\" SET %s WHERE %s",
		strmangle.SetParamNames("\"", "\"", 1, []string{"user_id"}),
		strmangle.WhereClause("\"", "\"", 2, personI18nPrimaryKeyColumns),
	)
	values := []interface{}{related.ID, o.PersonID, o.Language}
	if boil.DebugMode {
		fmt.Fprintln(boil.DebugWriter, updateQuery)
		fmt.Fprintln(boil.DebugWriter, values)
	}
	if _, err = exec.Exec(updateQuery, values...); err != nil {
		return errors.Wrap(err, "failed to update local table")
	}
	o.UserID.Int64 = related.ID
	o.UserID.Valid = true
	if o.R == nil {
		o.R = &personI18nR{
			User: related,
		}
	} else {
		o.R.User = related
	}
	if related.R == nil {
		related.R = &userR{
			PersonI18ns: PersonI18nSlice{o},
		}
	} else {
		related.R.PersonI18ns = append(related.R.PersonI18ns, o)
	}
	return nil
}