func AuthorI18ns(exec boil.Executor, mods ...qm.QueryMod) authorI18nQuery {
	mods = append(mods, qm.From("\"author_i18n\""))
	return authorI18nQuery{NewQuery(exec, mods...)}
}
AuthorI18ns retrieves all the records using an executor.
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 AuthorI18n struct {
	AuthorID  int64       `boil:"author_id" json:"author_id" toml:"author_id" yaml:"author_id"`
	Language  string      `boil:"language" json:"language" toml:"language" yaml:"language"`
	Name      null.String `boil:"name" json:"name,omitempty" toml:"name" yaml:"name,omitempty"`
	FullName  null.String `boil:"full_name" json:"full_name,omitempty" toml:"full_name" yaml:"full_name,omitempty"`
	CreatedAt time.Time   `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`
	R *authorI18nR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L authorI18nL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}
var AuthorI18nColumns = struct {
	AuthorID  string
	Language  string
	Name      string
	FullName  string
	CreatedAt string
}{
	AuthorID:  "author_id",
	Language:  "language",
	Name:      "name",
	FullName:  "full_name",
	CreatedAt: "created_at",
}
type authorI18nR struct {
	Author *Author
}
type authorI18nL struct{}
var (
	authorI18nColumns               = []string{"author_id", "language", "name", "full_name", "created_at"}
	authorI18nColumnsWithoutDefault = []string{"author_id", "language", "name", "full_name"}
	authorI18nColumnsWithDefault    = []string{"created_at"}
	authorI18nPrimaryKeyColumns     = []string{"author_id", "language"}
)
type (
	AuthorI18nSlice []*AuthorI18n
	authorI18nQuery struct {
		*queries.Query
	}
)
var (
	authorI18nType                 = reflect.TypeOf(&AuthorI18n{})
	authorI18nMapping              = queries.MakeStructMapping(authorI18nType)
	authorI18nPrimaryKeyMapping, _ = queries.BindMapping(authorI18nType, authorI18nMapping, authorI18nPrimaryKeyColumns)
	authorI18nInsertCacheMut       sync.RWMutex
	authorI18nInsertCache          = make(map[string]insertCache)
	authorI18nUpdateCacheMut       sync.RWMutex
	authorI18nUpdateCache          = make(map[string]updateCache)
	authorI18nUpsertCacheMut       sync.RWMutex
	authorI18nUpsertCache          = make(map[string]insertCache)
)
var (
	_ = time.Second
	_ = bytes.MinRead
)
func (q authorI18nQuery) OneP() *AuthorI18n {
	o, err := q.One()
	if err != nil {
		panic(boil.WrapErr(err))
	}
	return o
}
func (q authorI18nQuery) One() (*AuthorI18n, error) {
	o := &AuthorI18n{}
	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 author_i18n")
	}
	return o, nil
}
func (q authorI18nQuery) AllP() AuthorI18nSlice {
	o, err := q.All()
	if err != nil {
		panic(boil.WrapErr(err))
	}
	return o
}
func (q authorI18nQuery) All() (AuthorI18nSlice, error) {
	var o []*AuthorI18n
	err := q.Bind(&o)
	if err != nil {
		return nil, errors.Wrap(err, "mdbmodels: failed to assign all query results to AuthorI18n slice")
	}
	return o, nil
}
func (q authorI18nQuery) CountP() int64 {
	c, err := q.Count()
	if err != nil {
		panic(boil.WrapErr(err))
	}
	return c
}
func (q authorI18nQuery) 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 author_i18n rows")
	}
	return count, nil
}
func (q authorI18nQuery) ExistsP() bool {
	e, err := q.Exists()
	if err != nil {
		panic(boil.WrapErr(err))
	}
	return e
}
func (q authorI18nQuery) 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 author_i18n exists")
	}
	return count > 0, nil
}
func (o *AuthorI18n) AuthorG(mods ...qm.QueryMod) authorQuery {
	return o.Author(boil.GetDB(), mods...)
}
func (o *AuthorI18n) Author(exec boil.Executor, mods ...qm.QueryMod) authorQuery {
	queryMods := []qm.QueryMod{
		qm.Where("id=?", o.AuthorID),
	}
	queryMods = append(queryMods, mods...)
	query := Authors(exec, queryMods...)
	queries.SetFrom(query.Query, "\"authors\"")
	return query
}  
func (authorI18nL) LoadAuthor(e boil.Executor, singular bool, maybeAuthorI18n interface{}) error {
	var slice []*AuthorI18n
	var object *AuthorI18n
	count := 1
	if singular {
		object = maybeAuthorI18n.(*AuthorI18n)
	} else {
		slice = *maybeAuthorI18n.(*[]*AuthorI18n)
		count = len(slice)
	}
	args := make([]interface{}, count)
	if singular {
		if object.R == nil {
			object.R = &authorI18nR{}
		}
		args[0] = object.AuthorID
	} else {
		for i, obj := range slice {
			if obj.R == nil {
				obj.R = &authorI18nR{}
			}
			args[i] = obj.AuthorID
		}
	}
	query := fmt.Sprintf(
		"select * from \"authors\" 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 Author")
	}
	defer results.Close()
	var resultSlice []*Author
	if err = queries.Bind(results, &resultSlice); err != nil {
		return errors.Wrap(err, "failed to bind eager loaded slice Author")
	}
	if len(resultSlice) == 0 {
		return nil
	}
	if singular {
		object.R.Author = resultSlice[0]
		return nil
	}
	for _, local := range slice {
		for _, foreign := range resultSlice {
			if local.AuthorID == foreign.ID {
				local.R.Author = foreign
				break
			}
		}
	}
	return nil
}
func (o *AuthorI18n) SetAuthorG(insert bool, related *Author) error {
	return o.SetAuthor(boil.GetDB(), insert, related)
}
func (o *AuthorI18n) SetAuthorP(exec boil.Executor, insert bool, related *Author) {
	if err := o.SetAuthor(exec, insert, related); err != nil {
		panic(boil.WrapErr(err))
	}
}
func (o *AuthorI18n) SetAuthorGP(insert bool, related *Author) {
	if err := o.SetAuthor(boil.GetDB(), insert, related); err != nil {
		panic(boil.WrapErr(err))
	}
}
func (o *AuthorI18n) SetAuthor(exec boil.Executor, insert bool, related *Author) 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 \"author_i18n\" SET %s WHERE %s",
		strmangle.SetParamNames("\"", "\"", 1, []string{"author_id"}),
		strmangle.WhereClause("\"", "\"", 2, authorI18nPrimaryKeyColumns),
	)
	values := []interface{}{related.ID, o.AuthorID, 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.AuthorID = related.ID
	if o.R == nil {
		o.R = &authorI18nR{
			Author: related,
		}
	} else {
		o.R.Author = related
	}
	if related.R == nil {
		related.R = &authorR{
			AuthorI18ns: AuthorI18nSlice{o},
		}
	} else {
		related.R.AuthorI18ns = append(related.R.AuthorI18ns, o)
	}
	return nil
}
func AuthorI18nsG(mods ...qm.QueryMod) authorI18nQuery {
	return AuthorI18ns(boil.GetDB(), mods...)
}