sqlboiler/templates/all.tpl
Aaron L 8757c8a184 Refactor entire project :D
- Move most files to root
- Remove cmds directory in favor of cmd directory with binary
- Remove all cobra from main
2016-06-11 18:25:00 -07:00

17 lines
623 B
Smarty

{{- $tableNameSingular := titleCaseSingular .Table.Name -}}
{{- $tableNamePlural := titleCasePlural .Table.Name -}}
{{- $varNameSingular := camelCaseSingular .Table.Name -}}
type {{$varNameSingular}}Query struct {
*boil.Query
}
// {{$tableNamePlural}}All retrieves all records.
func {{$tableNamePlural}}(mods ...qs.QueryMod) {{$varNameSingular}}Query {
return {{$tableNamePlural}}X(boil.GetDB(), mods...)
}
func {{$tableNamePlural}}X(exec boil.Executor, mods ...qs.QueryMod) {{$varNameSingular}}Query {
mods = append(mods, qs.Table("{{.Table.Name}}"))
return {{$varNameSingular}}Query{NewQueryX(exec, mods...)}
}