mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
entc: add idtype option codegen
Reviewed By: alexsn Differential Revision: D16601757 fbshipit-source-id: 35d5fbfb4ef40bae192e084ad4e067880175e71c
This commit is contained in:
committed by
Facebook Github Bot
parent
c203f043cf
commit
2cc8286f5f
@@ -26,7 +26,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 }}id{{ end }}
|
||||
{{ $.Receiver }}.ID = {{ if $.ID.IsString }}strconv.FormatInt(id, 10){{ else }}int(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