sqlboiler/templates/00_struct.tpl

9 lines
382 B
Smarty
Raw Normal View History

{{- $tableNameSingular := .Table.Name | singular | titleCase -}}
2016-03-23 07:18:41 +01:00
{{- $dbName := singular .Table.Name -}}
// {{$tableNameSingular}} is an object representing the database table.
type {{$tableNameSingular}} struct {
2016-03-23 07:18:41 +01:00
{{range $key, $value := .Table.Columns -}}
{{titleCase $value.Name}} {{$value.Type}} `db:"{{makeDBName $dbName $value.Name}}" json:"{{$value.Name}}"`
{{end -}}
}