mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
entc/gen: unexpose upsert setters for immutable fields (#2875)
This commit is contained in:
@@ -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 }} {
|
||||
|
||||
Reference in New Issue
Block a user