Add support for meta data on attribute types (rdbms:type=integer)
This commit is contained in:
@@ -38,6 +38,7 @@ var {{ .var }} = &dal.Model{
|
||||
{{- if .dal.precision }} Precision: {{ .dal.precision }}, {{ end }}
|
||||
{{- if .dal.scale }} Scale: {{ .dal.scale }}, {{ end }}
|
||||
{{- if .dal.length }} Length: {{ .dal.length }}, {{ end }}
|
||||
{{- if .dal.meta }} Meta: {{ printf "%#v" .dal.meta }}, {{ end }}
|
||||
{{- if eq .dal.type "Ref" }}
|
||||
RefAttribute: {{ printf "%q" .dal.attribute }},
|
||||
RefModel: &dal.ModelRef{
|
||||
|
||||
@@ -65,7 +65,6 @@ import (
|
||||
nullable: bool | *false
|
||||
|
||||
|
||||
|
||||
if type == "ID" {
|
||||
generatedByStore: bool | *false
|
||||
default?: 0
|
||||
@@ -97,6 +96,7 @@ import (
|
||||
precision: number | *(-1)
|
||||
scale: number | *(-1)
|
||||
default?: number
|
||||
meta?: { [string]: _ }
|
||||
}
|
||||
|
||||
if type == "Text" {
|
||||
|
||||
@@ -29,6 +29,10 @@ _dalModelFn: {
|
||||
if attr.dal.default != _|_ {
|
||||
"quotedDefault": attr.dal.type == "String"
|
||||
}
|
||||
|
||||
if attr.dal.meta != _|_ {
|
||||
"meta": attr.dal.meta
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user