2016-03-23 07:18:41 +01:00
|
|
|
{{- $tableNameSingular := titleCaseSingular .Table.Name -}}
|
|
|
|
{{- $dbName := singular .Table.Name -}}
|
2016-03-18 12:26:48 +01:00
|
|
|
// {{$tableNameSingular}} is an object representing the database table.
|
|
|
|
type {{$tableNameSingular}} struct {
|
2016-03-23 07:18:41 +01:00
|
|
|
{{range $key, $value := .Table.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 -}}
|
|
|
|
}
|