func (q purchaseQuery) AllG() (PurchaseSlice, error) {
	return q.All(boil.GetDB())
}
AllG returns all Purchase records from the query using the global executor.
package model
import (
	"database/sql"
	"fmt"
	"reflect"
	"strconv"
	"strings"
	"sync"
	"time"
	"github.com/pkg/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"
)
type Purchase struct {
	ID                  uint64      `boil:"id" json:"id" toml:"id" yaml:"id"`
	TransactionByHashID null.String `boil:"transaction_by_hash_id" json:"transaction_by_hash_id,omitempty" toml:"transaction_by_hash_id" yaml:"transaction_by_hash_id,omitempty"`
	Vout                uint        `boil:"vout" json:"vout" toml:"vout" yaml:"vout"`
	ClaimID             null.String `boil:"claim_id" json:"claim_id,omitempty" toml:"claim_id" yaml:"claim_id,omitempty"`
	PublisherID         null.String `boil:"publisher_id" json:"publisher_id,omitempty" toml:"publisher_id" yaml:"publisher_id,omitempty"`
	Height              uint        `boil:"height" json:"height" toml:"height" yaml:"height"`
	AmountSatoshi       int64       `boil:"amount_satoshi" json:"amount_satoshi" toml:"amount_satoshi" yaml:"amount_satoshi"`
	Created             time.Time   `boil:"created" json:"created" toml:"created" yaml:"created"`
	Modified            time.Time   `boil:"modified" json:"modified" toml:"modified" yaml:"modified"`
	R *purchaseR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L purchaseL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}
var PurchaseColumns = struct {
	ID                  string
	TransactionByHashID string
	Vout                string
	ClaimID             string
	PublisherID         string
	Height              string
	AmountSatoshi       string
	Created             string
	Modified            string
}{
	ID:                  "id",
	TransactionByHashID: "transaction_by_hash_id",
	Vout:                "vout",
	ClaimID:             "claim_id",
	PublisherID:         "publisher_id",
	Height:              "height",
	AmountSatoshi:       "amount_satoshi",
	Created:             "created",
	Modified:            "modified",
}
var PurchaseWhere = struct {
	ID                  whereHelperuint64
	TransactionByHashID whereHelpernull_String
	Vout                whereHelperuint
	ClaimID             whereHelpernull_String
	PublisherID         whereHelpernull_String
	Height              whereHelperuint
	AmountSatoshi       whereHelperint64
	Created             whereHelpertime_Time
	Modified            whereHelpertime_Time
}{
	ID:                  whereHelperuint64{field: "`purchase`.`id`"},
	TransactionByHashID: whereHelpernull_String{field: "`purchase`.`transaction_by_hash_id`"},
	Vout:                whereHelperuint{field: "`purchase`.`vout`"},
	ClaimID:             whereHelpernull_String{field: "`purchase`.`claim_id`"},
	PublisherID:         whereHelpernull_String{field: "`purchase`.`publisher_id`"},
	Height:              whereHelperuint{field: "`purchase`.`height`"},
	AmountSatoshi:       whereHelperint64{field: "`purchase`.`amount_satoshi`"},
	Created:             whereHelpertime_Time{field: "`purchase`.`created`"},
	Modified:            whereHelpertime_Time{field: "`purchase`.`modified`"},
}
var PurchaseRels = struct {
	TransactionByHash string
}{
	TransactionByHash: "TransactionByHash",
}
type purchaseR struct {
	TransactionByHash *Transaction
}
func (*purchaseR) NewStruct() *purchaseR {
	return &purchaseR{}
}
type purchaseL struct{}
var (
	purchaseAllColumns            = []string{"id", "transaction_by_hash_id", "vout", "claim_id", "publisher_id", "height", "amount_satoshi", "created", "modified"}
	purchaseColumnsWithoutDefault = []string{"transaction_by_hash_id", "vout", "claim_id", "publisher_id", "height"}
	purchaseColumnsWithDefault    = []string{"id", "amount_satoshi", "created", "modified"}
	purchasePrimaryKeyColumns     = []string{"id"}
)
type (
	PurchaseSlice []*Purchase
	purchaseQuery struct {
		*queries.Query
	}
)
var (
	purchaseType                 = reflect.TypeOf(&Purchase{})
	purchaseMapping              = queries.MakeStructMapping(purchaseType)
	purchasePrimaryKeyMapping, _ = queries.BindMapping(purchaseType, purchaseMapping, purchasePrimaryKeyColumns)
	purchaseInsertCacheMut       sync.RWMutex
	purchaseInsertCache          = make(map[string]insertCache)
	purchaseUpdateCacheMut       sync.RWMutex
	purchaseUpdateCache          = make(map[string]updateCache)
	purchaseUpsertCacheMut       sync.RWMutex
	purchaseUpsertCache          = make(map[string]insertCache)
)
var (
	_ = time.Second
	_ = qmhelper.Where
)
func (q purchaseQuery) OneG() (*Purchase, error) {
	return q.One(boil.GetDB())
}
func (q purchaseQuery) OneGP() *Purchase {
	o, err := q.One(boil.GetDB())
	if err != nil {
		panic(boil.WrapErr(err))
	}
	return o
}
func (q purchaseQuery) OneP(exec boil.Executor) *Purchase {
	o, err := q.One(exec)
	if err != nil {
		panic(boil.WrapErr(err))
	}
	return o
}
func (q purchaseQuery) One(exec boil.Executor) (*Purchase, error) {
	o := &Purchase{}
	queries.SetLimit(q.Query, 1)
	err := q.Bind(nil, exec, o)
	if err != nil {
		if errors.Cause(err) == sql.ErrNoRows {
			return nil, sql.ErrNoRows
		}
		return nil, errors.Wrap(err, "model: failed to execute a one query for purchase")
	}
	return o, nil
}