Add StringColumn type and expression

Add Projection type
Alias refactoring
More numeric operations
This commit is contained in:
zer0sub 2019-04-03 11:03:07 +02:00
parent 033ab1d0da
commit b2f84d048c
16 changed files with 350 additions and 199 deletions

View file

@ -11,7 +11,7 @@ type {{.ToGoStructName}} struct {
//Columns
{{- range .Columns}}
{{.ToGoFieldName}} sqlbuilder.NonAliasColumn
{{.ToGoFieldName}} *sqlbuilder.{{.ToSqlBuilderColumnType}}
{{- end}}
AllColumns sqlbuilder.ColumnList
@ -22,7 +22,7 @@ var {{.ToGoVarName}} = new{{.ToGoStructName}}()
func new{{.ToGoStructName}}() *{{.ToGoStructName}} {
var (
{{- range .Columns}}
{{.ToGoVarName}} = sqlbuilder.IntColumn("{{.Name}}", {{if .IsNullable}}sqlbuilder.Nullable{{else}}sqlbuilder.NotNullable{{end}})
{{.ToGoVarName}} = sqlbuilder.New{{.ToSqlBuilderColumnType}}("{{.Name}}", {{if .IsNullable}}sqlbuilder.Nullable{{else}}sqlbuilder.NotNullable{{end}})
{{- end}}
)