Fix a bug that could occur on no-field inserts

This commit is contained in:
Aaron L 2017-04-04 19:42:49 -07:00
parent d13410617f
commit 10cfe74989

View file

@ -86,9 +86,12 @@ func (o *{{$tableNameSingular}}) Insert(exec boil.Executor, whitelist ... string
{{else -}} {{else -}}
queryOutput = fmt.Sprintf("OUTPUT INSERTED.{{.LQ}}%s{{.RQ}} ", strings.Join(returnColumns, "{{.RQ}},INSERTED.{{.LQ}}")) queryOutput = fmt.Sprintf("OUTPUT INSERTED.{{.LQ}}%s{{.RQ}} ", strings.Join(returnColumns, "{{.RQ}},INSERTED.{{.LQ}}"))
{{end -}} {{end -}}
{{- end}} {{end -}}
}
if len(wl) != 0 {
cache.query = fmt.Sprintf(cache.query, queryOutput, queryReturning)
} }
cache.query = fmt.Sprintf(cache.query, queryOutput, queryReturning)
} }
value := reflect.Indirect(reflect.ValueOf(o)) value := reflect.Indirect(reflect.ValueOf(o))