Add support for database json types.

This commit is contained in:
zer0sub 2019-04-04 15:25:45 +02:00
parent 37b0a6445b
commit d84deb8745
6 changed files with 94 additions and 5 deletions

View file

@ -51,10 +51,15 @@ func (a *{{.ToGoStructName}}) As(alias string) *{{.ToGoStructName}} {
var DataModelTemplate = `package model
{{range .GetImports}}
import "{{.}}"
{{ if .GetImports }}
import (
{{- range .GetImports}}
"{{.}}"
{{- end}}
)
{{end}}
type {{.ToGoModelStructName}} struct {
{{- range .Columns}}
{{.ToGoDMFieldName}} {{.ToGoType}} {{if .IsUnique}}` + "`sql:\"unique\"`" + ` {{end}}