3
0

Add support for meta data on attribute types (rdbms:type=integer)

This commit is contained in:
Denis Arh
2022-09-09 16:27:13 +02:00
parent 6939d9e226
commit 44ba447678
20 changed files with 46 additions and 29 deletions

View File

@@ -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{

View File

@@ -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" {

View File

@@ -29,6 +29,10 @@ _dalModelFn: {
if attr.dal.default != _|_ {
"quotedDefault": attr.dal.type == "String"
}
if attr.dal.meta != _|_ {
"meta": attr.dal.meta
}
}
}
]