Some checks failed
kotlin / test (push) Has been skipped
python / test (push) Has been skipped
typescript / test (push) Has been skipped
go / build darwin/amd64 (push) Has been cancelled
go / build linux/amd64 (push) Has been cancelled
go / build windows/amd64 (push) Has been cancelled
go / build darwin/arm64 (push) Has been cancelled
go / build linux/arm64 (push) Has been cancelled
go / build windows/arm64 (push) Has been cancelled
go / test (push) Has been cancelled
go / vuln_check (push) Has been cancelled
74 lines
3.2 KiB
Cheetah
74 lines
3.2 KiB
Cheetah
{{define "interfaceCodePgx"}}
|
|
type Querier interface {
|
|
{{- $dbtxParam := .EmitMethodsWithDBArgument -}}
|
|
{{- range .GoQueries}}
|
|
{{- if and (eq .Cmd ":one") ($dbtxParam) }}
|
|
{{range .Comments}}//{{.}}
|
|
{{end -}}
|
|
{{.MethodName}}(ctx context.Context, db DBTX, {{.Arg.Pair}}) ({{.Ret.DefineType}}, error)
|
|
{{- else if eq .Cmd ":one" }}
|
|
{{range .Comments}}//{{.}}
|
|
{{end -}}
|
|
{{.MethodName}}(ctx context.Context, {{.Arg.Pair}}) ({{.Ret.DefineType}}, error)
|
|
{{- end}}
|
|
{{- if and (eq .Cmd ":many") ($dbtxParam) }}
|
|
{{range .Comments}}//{{.}}
|
|
{{end -}}
|
|
{{.MethodName}}(ctx context.Context, db DBTX, {{.Arg.Pair}}) ([]{{.Ret.DefineType}}, error)
|
|
{{- else if eq .Cmd ":many" }}
|
|
{{range .Comments}}//{{.}}
|
|
{{end -}}
|
|
{{.MethodName}}(ctx context.Context, {{.Arg.Pair}}) ([]{{.Ret.DefineType}}, error)
|
|
{{- end}}
|
|
{{- if and (eq .Cmd ":exec") ($dbtxParam) }}
|
|
{{range .Comments}}//{{.}}
|
|
{{end -}}
|
|
{{.MethodName}}(ctx context.Context, db DBTX, {{.Arg.Pair}}) error
|
|
{{- else if eq .Cmd ":exec" }}
|
|
{{range .Comments}}//{{.}}
|
|
{{end -}}
|
|
{{.MethodName}}(ctx context.Context, {{.Arg.Pair}}) error
|
|
{{- end}}
|
|
{{- if and (eq .Cmd ":execrows") ($dbtxParam) }}
|
|
{{range .Comments}}//{{.}}
|
|
{{end -}}
|
|
{{.MethodName}}(ctx context.Context, db DBTX, {{.Arg.Pair}}) (int64, error)
|
|
{{- else if eq .Cmd ":execrows" }}
|
|
{{range .Comments}}//{{.}}
|
|
{{end -}}
|
|
{{.MethodName}}(ctx context.Context, {{.Arg.Pair}}) (int64, error)
|
|
{{- end}}
|
|
{{- if and (eq .Cmd ":execresult") ($dbtxParam) }}
|
|
{{range .Comments}}//{{.}}
|
|
{{end -}}
|
|
{{.MethodName}}(ctx context.Context, db DBTX, {{.Arg.Pair}}) (pgconn.CommandTag, error)
|
|
{{- else if eq .Cmd ":execresult" }}
|
|
{{range .Comments}}//{{.}}
|
|
{{end -}}
|
|
{{.MethodName}}(ctx context.Context, {{.Arg.Pair}}) (pgconn.CommandTag, error)
|
|
{{- end}}
|
|
{{- if and (eq .Cmd ":copyfrom") ($dbtxParam) }}
|
|
{{range .Comments}}//{{.}}
|
|
{{end -}}
|
|
{{.MethodName}}(ctx context.Context, db DBTX, {{.Arg.SlicePair}}) (int64, error)
|
|
{{- else if eq .Cmd ":copyfrom" }}
|
|
{{range .Comments}}//{{.}}
|
|
{{end -}}
|
|
{{.MethodName}}(ctx context.Context, {{.Arg.SlicePair}}) (int64, error)
|
|
{{- end}}
|
|
{{- if and (or (eq .Cmd ":batchexec") (eq .Cmd ":batchmany") (eq .Cmd ":batchone")) ($dbtxParam) }}
|
|
{{range .Comments}}//{{.}}
|
|
{{end -}}
|
|
{{.MethodName}}(ctx context.Context, db DBTX, {{.Arg.SlicePair}}) *{{.MethodName}}BatchResults
|
|
{{- else if or (eq .Cmd ":batchexec") (eq .Cmd ":batchmany") (eq .Cmd ":batchone") }}
|
|
{{range .Comments}}//{{.}}
|
|
{{end -}}
|
|
{{.MethodName}}(ctx context.Context, {{.Arg.SlicePair}}) *{{.MethodName}}BatchResults
|
|
{{- end}}
|
|
|
|
{{- end}}
|
|
}
|
|
|
|
var _ Querier = (*Queries)(nil)
|
|
{{end}}
|