mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
entc/cmd/entc: support more numeric types for ids
Reviewed By: alexsn Differential Revision: D17527952 fbshipit-source-id: 1465b054531cee8ca1dd445b6654063f32f4c4e3
This commit is contained in:
committed by
Facebook Github Bot
parent
3f7553af20
commit
0f71ca6ad8
@@ -40,7 +40,7 @@ func ({{ $receiver }} *{{ $builder }}) sqlSave(ctx context.Context) (*{{ $.Name
|
||||
if err != nil {
|
||||
return nil, rollback(tx, err)
|
||||
}
|
||||
{{ $.Receiver }}.ID = {{ if $.ID.IsString }}strconv.FormatInt(id, 10){{ else }}int(id){{ end }}
|
||||
{{ $.Receiver }}.ID = {{ if $.ID.IsString }}strconv.FormatInt(id, 10){{ else }}{{ $.ID.Type }}(id){{ end }}
|
||||
{{- range $_, $e := $.Edges }}
|
||||
if len({{ $receiver }}.{{ $e.StructField }}) > 0 {
|
||||
{{- if and $e.Unique $e.SelfRef }}{{/* O2O with self reference */}}
|
||||
|
||||
Reference in New Issue
Block a user