diff --git a/templates/15_insert.tpl b/templates/15_insert.tpl index 4833bef..4906875 100644 --- a/templates/15_insert.tpl +++ b/templates/15_insert.tpl @@ -79,7 +79,11 @@ func (o *{{$tableNameSingular}}) Insert(exec boil.Executor, whitelist ... string {{if .UseLastInsertID -}} cache.retQuery = fmt.Sprintf("SELECT {{.LQ}}%s{{.RQ}} FROM {{$schemaTable}} WHERE %s", strings.Join(returnColumns, "{{.RQ}},{{.LQ}}"), strmangle.WhereClause("{{.LQ}}", "{{.RQ}}", {{if .Dialect.IndexPlaceholders}}1{{else}}0{{end}}, {{$varNameSingular}}PrimaryKeyColumns)) {{else -}} + {{if ne .DriverName "mssql" -}} cache.query += fmt.Sprintf(" RETURNING {{.LQ}}%s{{.RQ}}", strings.Join(returnColumns, "{{.RQ}},{{.LQ}}")) + {{- else -}} + cache.query += fmt.Sprintf(" OUTPUT {{.LQ}}%s{{.RQ}}", strings.Join(returnColumns, "{{.RQ}},{{.LQ}}")) + {{- end}} {{end -}} } }