sqlboiler/cmds/templates/struct.tpl
Patrick O'brien 2f9c936c6a Added inflection library, fixed all templates
* Added inflection to all templates
* Fixed broken template code (for the most part)
2016-03-18 21:26:48 +10:00

9 lines
361 B
Smarty

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