sqlboiler/templates_test/hooks.tpl
Patrick O'brien 4036786b6a Got insert testing in a better state
* Split up insert function for testing
* Add DBType to global state
* Move test reflection helpers to testing.go
* Add incremental seed to randomizeField to avoid duplicate constraint
  error messages
* Fixed Viper SSL default bug
* Fixed pgpass SSL inclusion bug
* Add MakeStringMap strmangle helper
* Change test errors from error to skip
2016-07-14 02:51:40 +10:00

28 lines
807 B
Smarty

{{- $tableNameSingular := .Table.Name | singular | titleCase -}}
{{- $dbName := singular .Table.Name -}}
{{- $tableNamePlural := .Table.Name | plural | titleCase -}}
{{- $varNamePlural := .Table.Name | plural | camelCase -}}
{{- $varNameSingular := .Table.Name | singular | camelCase -}}
func {{$varNameSingular}}BeforeCreateHook(o *{{$tableNameSingular}}) error {
return nil
}
func {{$varNameSingular}}AfterCreateHook(o *{{$tableNameSingular}}) error {
return nil
}
func {{$varNameSingular}}BeforeUpdateHook(o *{{$tableNameSingular}}) error {
return nil
}
func {{$varNameSingular}}AfterUpdateHook(o *{{$tableNameSingular}}) error {
return nil
}
func Test{{$tableNamePlural}}Hooks(t *testing.T) {
// var err error
{{$varNamePlural}}DeleteAllRows(t)
t.Skip("Hook tests not implemented")
}