sqlboiler/cmds/templates/all.tpl
Patrick O'brien a957bc3836 Changed From qmod to Table, added default values
* Added drivername to tplData
2016-04-26 19:27:00 +10:00

16 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...)}
}