mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
entc: support schema/blob annotation
This commit is contained in:
@@ -20,6 +20,9 @@ in the LICENSE file in the root directory of this source tree.
|
||||
{{- if $f.HasValueScanner }}
|
||||
{{- continue }}
|
||||
{{- end }}
|
||||
{{- if $f.IsBlob }}
|
||||
{{- continue }}
|
||||
{{- end }}
|
||||
{{ $names := list }}
|
||||
{{ if hasKey $ctypes $f.NewScanType }}
|
||||
{{ $names = get $ctypes $f.NewScanType }}
|
||||
@@ -42,6 +45,7 @@ func (*{{ $.Name }}) scanValues(columns []string) ([]any, error) {
|
||||
values[i] = {{ $type }}
|
||||
{{- end }}
|
||||
{{- range $f := $.Fields }}
|
||||
{{- if $f.IsBlob }}{{ continue }}{{ end }}
|
||||
{{- if $f.HasValueScanner }}
|
||||
case {{ $.Package }}.{{ $f.Constant }}:
|
||||
values[i] = {{ $f.ScanValueFunc }}()
|
||||
@@ -83,6 +87,9 @@ func ({{ $receiver }} *{{ $.Name }}) assignValues(columns []string, values []any
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- range $f := $.Fields }}
|
||||
{{- if $f.IsBlob }}
|
||||
{{- continue }}
|
||||
{{- end }}
|
||||
case {{ $.Package }}.{{ $f.Constant }}:
|
||||
{{- with extend $ "Idx" "i" "Field" $f "Rec" $receiver }}
|
||||
{{ template "dialect/sql/decode/field" . }}
|
||||
|
||||
Reference in New Issue
Block a user