53 lines
1.3 KiB
Go
53 lines
1.3 KiB
Go
|
// Code generated by SQLBoiler 3.7.1 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT.
|
||
|
// This file is meant to be re-generated in place and/or deleted at any time.
|
||
|
|
||
|
package model
|
||
|
|
||
|
import (
|
||
|
"strconv"
|
||
|
|
||
|
"github.com/friendsofgo/errors"
|
||
|
"github.com/volatiletech/sqlboiler/boil"
|
||
|
"github.com/volatiletech/sqlboiler/strmangle"
|
||
|
)
|
||
|
|
||
|
// M type is for providing columns and column values to UpdateAll.
|
||
|
type M map[string]interface{}
|
||
|
|
||
|
// ErrSyncFail occurs during insert when the record could not be retrieved in
|
||
|
// order to populate default value information. This usually happens when LastInsertId
|
||
|
// fails or there was a primary key configuration that was not resolvable.
|
||
|
var ErrSyncFail = errors.New("model: failed to synchronize data after insert")
|
||
|
|
||
|
type insertCache struct {
|
||
|
query string
|
||
|
retQuery string
|
||
|
valueMapping []uint64
|
||
|
retMapping []uint64
|
||
|
}
|
||
|
|
||
|
type updateCache struct {
|
||
|
query string
|
||
|
valueMapping []uint64
|
||
|
}
|
||
|
|
||
|
func makeCacheKey(cols boil.Columns, nzDefaults []string) string {
|
||
|
buf := strmangle.GetBuffer()
|
||
|
|
||
|
buf.WriteString(strconv.Itoa(cols.Kind))
|
||
|
for _, w := range cols.Cols {
|
||
|
buf.WriteString(w)
|
||
|
}
|
||
|
|
||
|
if len(nzDefaults) != 0 {
|
||
|
buf.WriteByte('.')
|
||
|
}
|
||
|
for _, nz := range nzDefaults {
|
||
|
buf.WriteString(nz)
|
||
|
}
|
||
|
|
||
|
str := buf.String()
|
||
|
strmangle.PutBuffer(buf)
|
||
|
return str
|
||
|
}
|