entc: support schema/blob annotation

This commit is contained in:
Giau. Tran Minh
2026-05-03 18:00:38 +00:00
parent 665007afec
commit 7a21ec2e29
37 changed files with 1611 additions and 417 deletions

View File

@@ -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" . }}