2016-03-18 12:26:48 +01:00
|
|
|
{{- $tableNameSingular := titleCaseSingular .Table -}}
|
|
|
|
{{- $dbName := singular .Table -}}
|
|
|
|
// {{$tableNameSingular}} is an object representing the database table.
|
|
|
|
type {{$tableNameSingular}} struct {
|
2016-03-02 05:05:25 +01:00
|
|
|
{{range $key, $value := .Columns -}}
|
2016-03-18 12:26:48 +01:00
|
|
|
{{titleCase $value.Name}} {{$value.Type}} `db:"{{makeDBName $dbName $value.Name}}" json:"{{$value.Name}}"`
|
2016-02-23 09:27:32 +01:00
|
|
|
{{end -}}
|
|
|
|
}
|