entc/gen: add support for summing custom Go numeric types

This commit is contained in:
Ariel Mashraki
2021-06-25 15:24:35 +03:00
committed by Ariel Mashraki
parent ee4fa653fd
commit c40ae45aee
33 changed files with 869 additions and 55 deletions

View File

@@ -61,7 +61,7 @@ func ({{ $receiver }} *{{ $builder }}) sqlSave(ctx context.Context) ({{ $ret }}
Column: {{ $.Package }}.{{ $f.Constant }},
})
}
{{- if and $f.Type.Numeric $f.ConvertedToBasic }}
{{- if $f.SupportsMutationAdd }}
if value, ok := {{ $mutation }}.Added{{ $f.StructField }}(); ok {
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
Type: field.{{ $f.Type.ConstName }},