mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
dialect/sql/sqlgraph: move fields setters to method calls (#2995)
This commit is contained in:
@@ -81,11 +81,7 @@ func ({{ $receiver }} *{{ $builder }}) createSpec() (*{{ $.Name }}, *sqlgraph.Cr
|
||||
{{- end }}
|
||||
{{- range $f := $.MutationFields }}
|
||||
if value, ok := {{ $mutation }}.{{ $f.MutationGet }}(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.{{ $f.Type.ConstName }},
|
||||
Value: value,
|
||||
Column: {{ $.Package }}.{{ $f.Constant }},
|
||||
})
|
||||
_spec.SetField({{ $.Package }}.{{ $f.Constant }}, field.{{ $f.Type.ConstName }}, value)
|
||||
_node.{{ $f.StructField }} = {{ if $f.NillableValue }}&{{ end }}value
|
||||
}
|
||||
{{- end }}
|
||||
|
||||
Reference in New Issue
Block a user