sqlboiler/templates/00_struct.tpl
2016-08-07 18:07:37 -07:00

8 lines
397 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:"{{$column.Name}}" json:"{{$column.Name}}" toml:"{{$column.Name}}" yaml:"{{$column.Name}}"`
{{end -}}
}