2016-06-20 07:22:50 +02:00
|
|
|
{{- $varNameSingular := .Table.Name | singular | camelCase -}}
|
|
|
|
{{- $tableNameSingular := .Table.Name | singular | titleCase -}}
|
2016-06-20 01:29:59 +02:00
|
|
|
var (
|
2016-06-20 07:57:46 +02:00
|
|
|
{{$varNameSingular}}Columns = []string{{"{"}}{{.Table.Columns | columnNames | stringMap .StringFuncs.quoteWrap | join ", "}}{{"}"}}
|
2016-06-23 08:48:49 +02:00
|
|
|
{{$varNameSingular}}ColumnsWithoutDefault = []string{{"{"}}{{.Table.Columns | filterColumnsByDefault false | columnNames | stringMap .StringFuncs.quoteWrap | join ","}}{{"}"}}
|
|
|
|
{{$varNameSingular}}ColumnsWithDefault = []string{{"{"}}{{.Table.Columns | filterColumnsByDefault true | columnNames | stringMap .StringFuncs.quoteWrap | join ","}}{{"}"}}
|
2016-06-20 07:57:46 +02:00
|
|
|
{{$varNameSingular}}PrimaryKeyColumns = []string{{"{"}}{{.Table.PKey.Columns | stringMap .StringFuncs.quoteWrap | join ", "}}{{"}"}}
|
2016-06-23 08:48:49 +02:00
|
|
|
{{$varNameSingular}}AutoIncrementColumns = []string{{"{"}}{{.Table.Columns | filterColumnsByAutoIncrement | columnNames | stringMap .StringFuncs.quoteWrap | join "," }}{{"}"}}
|
|
|
|
{{$varNameSingular}}AutoIncPrimaryKey = "{{- with autoIncPrimaryKey .Table.Columns .Table.PKey -}}{{.Name}}{{- end -}}"
|
2016-06-20 01:29:59 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
type (
|
|
|
|
{{$varNameSingular}}Slice []*{{$tableNameSingular}}
|
|
|
|
{{$tableNameSingular}}Hook func(*{{$tableNameSingular}}) error
|
|
|
|
{{$varNameSingular}}Query struct {
|
|
|
|
*boil.Query
|
|
|
|
}
|
|
|
|
)
|