mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
entc/gen: initial support for user-defined ids
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/162 Reviewed By: alexsn Differential Revision: D18485086 fbshipit-source-id: 9bb6ccff592bc0cb8b218625161ed492f67bc170
This commit is contained in:
committed by
Facebook Github Bot
parent
e161ecc29c
commit
d9da7243f9
@@ -17,11 +17,14 @@ in the LICENSE file in the root directory of this source tree.
|
||||
// {{ $builder }} is the builder for creating a {{ $.Name }} entity.
|
||||
type {{ $builder }} struct {
|
||||
config
|
||||
{{- if $.ID.UserDefined }}
|
||||
{{ $.ID.BuilderField }} *{{ $.ID.Type }}
|
||||
{{- end }}
|
||||
{{ range $_, $f := $.Fields }}
|
||||
{{- $f.BuilderField }} *{{ $f.Type }}
|
||||
{{ end }}
|
||||
{{- range $_, $e := $.Edges }}
|
||||
{{- $e.BuilderField }} map[{{ $.ID.Type }}]struct{}
|
||||
{{- $e.BuilderField }} map[{{ $e.Type.ID.Type }}]struct{}
|
||||
{{ end -}}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user