mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
entc/gen/template: allow mutating the sqlgraph.UpdateSpec by ent extensions or user templates
This commit is contained in:
committed by
Ariel Mashraki
parent
7f5720cf92
commit
d56537c606
@@ -24,6 +24,12 @@ func ({{ $receiver }} *{{ $builder }}) sqlSave(ctx context.Context) ({{ $ret }}
|
||||
},
|
||||
},
|
||||
}
|
||||
{{- /* Allow mutating the sqlgraph.UpdateSpec by ent extensions or user templates.*/}}
|
||||
{{- with $tmpls := matchTemplate "dialect/sql/update/spec/*" }}
|
||||
{{- range $tmpl := $tmpls }}
|
||||
{{- xtemplate $tmpl $ }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if $one }}
|
||||
id, ok := {{ $mutation }}.{{ $.ID.MutationGet }}()
|
||||
if !ok {
|
||||
|
||||
Reference in New Issue
Block a user