sqlboiler/templates/00_struct.tpl
Aaron L a1b14f4eae Fix struct tag generation.
- Clean up template
2016-08-03 22:34:46 -07:00

8 lines
383 B
Smarty

{{- $tableNameSingular := .Table.Name | singular -}}
{{- $modelName := $tableNameSingular | titleCase -}}
// {{$modelName}} is an object representing the database table.
type {{$modelName}} struct {
{{range $column := .Table.Columns -}}
{{titleCase $column.Name}} {{$column.Type}} `boil:"{{printf "%s.%s" $tableNameSingular $column.Name}}" json:"{{$column.Name}}"`
{{end -}}
}