sqlboiler/templates/01_types.tpl

18 lines
983 B
Smarty
Raw Normal View History

{{- $varNameSingular := .Table.Name | singular | camelCase -}}
{{- $tableNameSingular := .Table.Name | singular | titleCase -}}
var (
2016-07-14 07:09:05 +02:00
{{$varNameSingular}}Columns = []string{{"{"}}{{.Table.Columns | columnNames | stringMap .StringFuncs.quoteWrap | join ", "}}{{"}"}}
{{$varNameSingular}}ColumnsWithoutDefault = []string{{"{"}}{{.Table.Columns | filterColumnsByDefault false | columnNames | stringMap .StringFuncs.quoteWrap | join ","}}{{"}"}}
{{$varNameSingular}}ColumnsWithDefault = []string{{"{"}}{{.Table.Columns | filterColumnsByDefault true | columnNames | stringMap .StringFuncs.quoteWrap | join ","}}{{"}"}}
{{$varNameSingular}}PrimaryKeyColumns = []string{{"{"}}{{.Table.PKey.Columns | stringMap .StringFuncs.quoteWrap | join ", "}}{{"}"}}
)
type (
{{$tableNameSingular}}Slice []*{{$tableNameSingular}}
{{$tableNameSingular}}Hook func(*{{$tableNameSingular}}) error
2016-07-14 07:09:05 +02:00
{{$varNameSingular}}Query struct {
*boil.Query
}
)