func (o *TagI18n) SetTagG(insert bool, related *Tag) error {
	return o.SetTag(boil.GetDB(), insert, related)
}
SetTagG of the tag_i18n to the related item.
Sets o.R.Tag to related.
Adds o to related.R.TagI18ns.
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 TagI18n struct {
	TagID            int64       `boil:"tag_id" json:"tag_id" toml:"tag_id" yaml:"tag_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"`
	Label            null.String `boil:"label" json:"label,omitempty" toml:"label" yaml:"label,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 *tagI18nR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L tagI18nL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}
var TagI18nColumns = struct {
	TagID            string
	Language         string
	OriginalLanguage string
	Label            string
	UserID           string
	CreatedAt        string
}{
	TagID:            "tag_id",
	Language:         "language",
	OriginalLanguage: "original_language",
	Label:            "label",
	UserID:           "user_id",
	CreatedAt:        "created_at",
}
type tagI18nR struct {
	Tag  *Tag
	User *User
}
type tagI18nL struct{}
var (
	tagI18nColumns               = []string{"tag_id", "language", "original_language", "label", "user_id", "created_at"}
	tagI18nColumnsWithoutDefault = []string{"tag_id", "language", "original_language", "label", "user_id"}
	tagI18nColumnsWithDefault    = []string{"created_at"}
	tagI18nPrimaryKeyColumns     = []string{"tag_id", "language"}
)
type (
	TagI18nSlice []*TagI18n
	tagI18nQuery struct {
		*queries.Query
	}
)
var (
	tagI18nType                 = reflect.TypeOf(&TagI18n{})
	tagI18nMapping              = queries.MakeStructMapping(tagI18nType)
	tagI18nPrimaryKeyMapping, _ = queries.BindMapping(tagI18nType, tagI18nMapping, tagI18nPrimaryKeyColumns)
	tagI18nInsertCacheMut       sync.RWMutex
	tagI18nInsertCache          = make(map[string]insertCache)
	tagI18nUpdateCacheMut       sync.RWMutex
	tagI18nUpdateCache          = make(map[string]updateCache)
	tagI18nUpsertCacheMut       sync.RWMutex
	tagI18nUpsertCache          = make(map[string]insertCache)
)
var (
	_ = time.Second
	_ = bytes.MinRead
)
func (q tagI18nQuery) OneP() *TagI18n {
	o, err := q.One()
	if err != nil {
		panic(boil.WrapErr(err))
	}
	return o
}
func (q tagI18nQuery) One() (*TagI18n, error) {
	o := &TagI18n{}
	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 tag_i18n")
	}
	return o, nil
}
func (q tagI18nQuery) AllP() TagI18nSlice {
	o, err := q.All()
	if err != nil {
		panic(boil.WrapErr(err))
	}
	return o
}
func (q tagI18nQuery) All() (TagI18nSlice, error) {
	var o []*TagI18n
	err := q.Bind(&o)
	if err != nil {
		return nil, errors.Wrap(err, "mdbmodels: failed to assign all query results to TagI18n slice")
	}
	return o, nil
}
func (q tagI18nQuery) CountP() int64 {
	c, err := q.Count()
	if err != nil {
		panic(boil.WrapErr(err))
	}
	return c
}
func (q tagI18nQuery) 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 tag_i18n rows")
	}
	return count, nil
}
func (q tagI18nQuery) ExistsP() bool {
	e, err := q.Exists()
	if err != nil {
		panic(boil.WrapErr(err))
	}
	return e
}
func (q tagI18nQuery) 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 tag_i18n exists")
	}
	return count > 0, nil
}
func (o *TagI18n) TagG(mods ...qm.QueryMod) tagQuery {
	return o.Tag(boil.GetDB(), mods...)
}
func (o *TagI18n) Tag(exec boil.Executor, mods ...qm.QueryMod) tagQuery {
	queryMods := []qm.QueryMod{
		qm.Where("id=?", o.TagID),
	}
	queryMods = append(queryMods, mods...)
	query := Tags(exec, queryMods...)
	queries.SetFrom(query.Query, "\"tags\"")
	return query
}
func (o *TagI18n) UserG(mods ...qm.QueryMod) userQuery {
	return o.User(boil.GetDB(), mods...)
}
func (o *TagI18n) 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 (tagI18nL) LoadTag(e boil.Executor, singular bool, maybeTagI18n interface{}) error {
	var slice []*TagI18n
	var object *TagI18n
	count := 1
	if singular {
		object = maybeTagI18n.(*TagI18n)
	} else {
		slice = *maybeTagI18n.(*[]*TagI18n)
		count = len(slice)
	}
	args := make([]interface{}, count)
	if singular {
		if object.R == nil {
			object.R = &tagI18nR{}
		}
		args[0] = object.TagID
	} else {
		for i, obj := range slice {
			if obj.R == nil {
				obj.R = &tagI18nR{}
			}
			args[i] = obj.TagID
		}
	}
	query := fmt.Sprintf(
		"select * from \"tags\" 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 Tag")
	}
	defer results.Close()
	var resultSlice []*Tag
	if err = queries.Bind(results, &resultSlice); err != nil {
		return errors.Wrap(err, "failed to bind eager loaded slice Tag")
	}
	if len(resultSlice) == 0 {
		return nil
	}
	if singular {
		object.R.Tag = resultSlice[0]
		return nil
	}
	for _, local := range slice {
		for _, foreign := range resultSlice {
			if local.TagID == foreign.ID {
				local.R.Tag = foreign
				break
			}
		}
	}
	return nil
}
func (tagI18nL) LoadUser(e boil.Executor, singular bool, maybeTagI18n interface{}) error {
	var slice []*TagI18n
	var object *TagI18n
	count := 1
	if singular {
		object = maybeTagI18n.(*TagI18n)
	} else {
		slice = *maybeTagI18n.(*[]*TagI18n)
		count = len(slice)
	}
	args := make([]interface{}, count)
	if singular {
		if object.R == nil {
			object.R = &tagI18nR{}
		}
		args[0] = object.UserID
	} else {
		for i, obj := range slice {
			if obj.R == nil {
				obj.R = &tagI18nR{}
			}
			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
}