Fixed issue with collection types in udt. empty type colums skiped. Added test for udt.

This commit is contained in:
pavle995
2022-05-08 15:08:09 +02:00
committed by Michal Jan Matczuk
parent a62ba24cf9
commit fc92258512
5 changed files with 41 additions and 9 deletions

View File

@@ -40,10 +40,10 @@ var (
{{range .}}
{{- $type_name := .Name | camelize}}
{{- $field_types := .FieldTypes}}
type {{$type_name}}Type struct {
type {{$type_name}}UserType struct {
{{- range $index, $element := .FieldNames}}
{{- $type := index $field_types $index}}
{{. | camelize}} {{getNativeTypeSting $type | mapScyllaToGoType}}
{{. | camelize}} {{typeToString $type | mapScyllaToGoType}}
{{- end}}
}
{{- end}}
@@ -54,7 +54,9 @@ type {{$type_name}}Type struct {
{{- $model_name := .Name | camelize}}
type {{$model_name}}Struct struct {
{{- range .Columns}}
{{- if not (eq .Validator "empty") }}
{{.Name | camelize}} {{.Validator | mapScyllaToGoType}}
{{- end}}
{{- end}}
}
{{- end}}