You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# custom_column_types.yml
tables:
- name: Items
columns:
Codes: Codes
// or might be
// Codes: "[]Code"
// type.go
type Codes []Code
type Code int64
const (
CodeOK Code = 1
CodeNG Code = 2
)
I want to generate code with conversion between the type (e,g, INT64) and custom type (e.g. Code) if it is an array.
The default template shows it has condition to check Field has CustomType or not so that it generates type conversion code.
It would be helpful to have the method to know the field type is ARRAY or not in this case, but do you have any idea or suggestion for this?
// type.go.tpl
{{- range .Fields }}
{{- if .CustomType.IsArray }}
// type conversion code for array type
{{- end }}
{{- end }}
The text was updated successfully, but these errors were encountered:
Hi, I'd like to generate code with
ARRAY(INT64)
with custom types.If I write DDL and custom types configuration like this:
I want to generate code with conversion between the type (e,g,
INT64
) and custom type (e.g.Code
) if it is an array.The default template shows it has condition to check
Field
hasCustomType
or not so that it generates type conversion code.It would be helpful to have the method to know the field type is
ARRAY
or not in this case, but do you have any idea or suggestion for this?The text was updated successfully, but these errors were encountered: