sqlboiler/templates/10_all.tpl
Aaron L 8392a4ba2a Fix quoting throughout templates
- Use "" style strings for all templates
- Attach a Quote and SchemaTable that understand escaped quotes so we
  can use "" style strings without repercussion.
- Make SchemaTable use escaped quotes
- Remove schemaTable from the templates in favor of .SchemaTable
2016-09-11 23:50:11 -07:00

13 lines
660 B
Smarty

{{- $tableNameSingular := .Table.Name | singular | titleCase -}}
{{- $tableNamePlural := .Table.Name | plural | titleCase -}}
{{- $varNameSingular := .Table.Name | singular | camelCase -}}
// {{$tableNamePlural}}G retrieves all records.
func {{$tableNamePlural}}G(mods ...qm.QueryMod) {{$varNameSingular}}Query {
return {{$tableNamePlural}}(boil.GetDB(), mods...)
}
// {{$tableNamePlural}} retrieves all the records using an executor.
func {{$tableNamePlural}}(exec boil.Executor, mods ...qm.QueryMod) {{$varNameSingular}}Query {
mods = append(mods, qm.From("{{.Table.Name | .SchemaTable}}"))
return {{$varNameSingular}}Query{NewQuery(exec, mods...)}
}