ea2f39ca7f
Change-Id: Ie2527b673dd4ce5250cf5c0cbf8f14921262f665
27 lines
582 B
Cheetah
27 lines
582 B
Cheetah
{{- define "signature" -}}
|
|
Count_{{ .Suffix }}({{ ctxparam .Args }}) (
|
|
count int64, err error)
|
|
{{- end -}}
|
|
|
|
{{- define "invoke" -}}
|
|
Count_{{ .Suffix }}({{ ctxarg .Args }})
|
|
{{- end -}}
|
|
|
|
{{- define "body" }}
|
|
{{ embedplaceholders .Info }}
|
|
{{ embedsql .Info "__embed_stmt" }}
|
|
|
|
var __values []interface{}
|
|
{{ embedvalues .Args "__values" }}
|
|
|
|
var __stmt = __sqlbundle_Render(obj.dialect, __embed_stmt)
|
|
obj.logStmt(__stmt, __values...)
|
|
|
|
err = obj.queryRowContext(ctx, __stmt, __values...).Scan(&count)
|
|
if err != nil {
|
|
return 0, obj.makeErr(err)
|
|
}
|
|
|
|
return count, nil
|
|
{{ end -}}
|