mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
ent/schema: rename nullable to nillable
Reviewed By: idoshveki Differential Revision: D16687892 fbshipit-source-id: e8cfaaf1241e94c2de0a9fe9077326339d593716
This commit is contained in:
committed by
Facebook Github Bot
parent
25f5a2ef01
commit
619b63d5f7
@@ -7,7 +7,7 @@ func ({{ $receiver }} *{{ $.Name }}) FromRows(rows *sql.Rows) error {
|
||||
var {{ $scan }} struct {
|
||||
ID {{ if $.ID.IsString }}int{{ else }}{{ $.ID.Type }}{{ end }}
|
||||
{{ range $_, $f := $.Fields }}
|
||||
{{- pascal $f.Name }} {{ if or $f.Nullable $f.Optional }}{{ $f.NullType }}{{ else }}{{ $f.Type }}{{ end }}
|
||||
{{- pascal $f.Name }} {{ if or $f.Nillable $f.Optional }}{{ $f.NullType }}{{ else }}{{ $f.Type }}{{ end }}
|
||||
{{ end }}
|
||||
}
|
||||
// the order here should be the same as in the `{{ $.Package }}.Columns`.
|
||||
@@ -21,7 +21,7 @@ func ({{ $receiver }} *{{ $.Name }}) FromRows(rows *sql.Rows) error {
|
||||
}
|
||||
{{ $receiver }}.ID = {{ if $.ID.IsString }}strconv.Itoa({{ $scan }}.ID){{ else }}{{ $scan }}.ID{{ end }}
|
||||
{{- range $_, $f := $.Fields }}
|
||||
{{- if $f.Nullable }}
|
||||
{{- if $f.Nillable }}
|
||||
{{- if $f.IsTime }}
|
||||
{{ $receiver }}.{{ pascal $f.Name }} = &{{ $scan }}.{{ pascal $f.Name }}
|
||||
{{- else }}
|
||||
|
||||
Reference in New Issue
Block a user