sqlboiler/templates/all.tpl
Patrick O'brien 1508d85cb6 Finish Bind test, renamed querymods package
* Rename querymods qs package to qm
* Refactor comparing values in template tests to remove redundancy
2016-06-15 00:01:28 +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 ...qm.QueryMod) {{$varNameSingular}}Query {
return {{$tableNamePlural}}X(boil.GetDB(), mods...)
}
func {{$tableNamePlural}}X(exec boil.Executor, mods ...qm.QueryMod) {{$varNameSingular}}Query {
mods = append(mods, qm.Table("{{.Table.Name}}"))
return {{$varNameSingular}}Query{NewQueryX(exec, mods...)}
}