entc/gen: unexpose upsert setters for immutable fields (#2875)

This commit is contained in:
Ariel Mashraki
2022-08-20 18:09:12 +03:00
committed by GitHub
parent 2c63d1d70e
commit 461ab4a3e4
4 changed files with 2 additions and 162 deletions

View File

@@ -108,7 +108,7 @@ type (
}
)
{{ range $f := $.Fields }}
{{ range $f := $.MutableFields }}
{{ $func := print "Set" $f.StructField }}
// {{ $func }} sets the "{{ $f.Name }}" field.
func (u *{{ $upsertSet }}) {{ $func }}(v {{ $f.Type }}) *{{ $upsertSet }} {
@@ -408,7 +408,7 @@ func (u *{{ $upsertBulk }}) ExecX(ctx context.Context) {
{{ $upsert := $.Scope.Upsert }}
{{ $upsertSet := $.Scope.UpsertSet }}
{{ range $f := $.Fields }}
{{ range $f := $.MutableFields }}
{{ $func := print "Set" $f.StructField }}
// {{ $func }} sets the "{{ $f.Name }}" field.
func (u *{{ $upsert }}) {{ $func }}(v {{ $f.Type }}) *{{ $upsert }} {