26 lines
581 B
Cheetah
26 lines
581 B
Cheetah
|
{{- define "signature" -}}
|
||
|
Has_{{ .Suffix }}({{ ctxparam .Args }}) (
|
||
|
has bool, err error)
|
||
|
{{- end -}}
|
||
|
|
||
|
{{- define "invoke" -}}
|
||
|
Has_{{ .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.driver.QueryRowContext(ctx, __stmt, __values...).Scan(&has)
|
||
|
if err != nil {
|
||
|
return false, obj.makeErr(err)
|
||
|
}
|
||
|
return has, nil
|
||
|
{{ end -}}
|