mirror of
https://github.com/ent/ent.git
synced 2026-05-22 09:31:45 +03:00
entc/gen/template: allow mutating the sqlgraph.DeleteSpec by ent extensions or user templates
This commit is contained in:
committed by
Ariel Mashraki
parent
63eb68a269
commit
7f5720cf92
File diff suppressed because one or more lines are too long
@@ -19,6 +19,12 @@ func ({{ $receiver}} *{{ $builder }}) sqlExec(ctx context.Context) (int, error)
|
||||
},
|
||||
},
|
||||
}
|
||||
{{- /* Allow mutating the sqlgraph.DeleteSpec by ent extensions or user templates.*/}}
|
||||
{{- with $tmpls := matchTemplate "dialect/sql/delete/spec/*" }}
|
||||
{{- range $tmpl := $tmpls }}
|
||||
{{- xtemplate $tmpl $ }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
if ps := {{ $mutation }}.predicates; len(ps) > 0 {
|
||||
_spec.Predicate = func(selector *sql.Selector) {
|
||||
for i := range ps {
|
||||
|
||||
Reference in New Issue
Block a user