entc: add idtype option codegen

Reviewed By: alexsn

Differential Revision: D16601757

fbshipit-source-id: 35d5fbfb4ef40bae192e084ad4e067880175e71c
This commit is contained in:
Ariel Mashraki
2019-08-04 03:08:47 -07:00
committed by Facebook Github Bot
parent c203f043cf
commit 2cc8286f5f
41 changed files with 302 additions and 339 deletions

View File

@@ -21,9 +21,9 @@
{{ if $.ID.IsString }}v[i], _ = strconv.Atoi({{ $arg }}[i]){{ else }}v[i] = {{ $arg }}[i]{{ end }}
}
{{- else if $.ID.IsString }}
v, _ := strconv.Atoi({{ $arg }})
id, _ := strconv.Atoi({{ $arg }})
{{- end }}
s.Where(sql.{{ $op.Name }}(s.C({{ $.ID.Constant }}), v{{ if $op.Variadic }}...{{ end }}))
s.Where(sql.{{ $op.Name }}(s.C({{ $.ID.Constant }}), {{ if $op.Variadic }}v...{{ else }}id{{ end }}))
}
{{- end }}