sqlboiler/cmds/templates/struct.tpl
2016-03-22 23:18:41 -07:00

8 lines
377 B
Smarty

{{- $tableNameSingular := titleCaseSingular .Table.Name -}}
{{- $dbName := singular .Table.Name -}}
// {{$tableNameSingular}} is an object representing the database table.
type {{$tableNameSingular}} struct {
{{range $key, $value := .Table.Columns -}}
{{titleCase $value.Name}} {{$value.Type}} `db:"{{makeDBName $dbName $value.Name}}" json:"{{$value.Name}}"`
{{end -}}
}