forked from jschaf/pggen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
alpha_query.sql.1.go
37 lines (31 loc) · 895 Bytes
/
alpha_query.sql.1.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Code generated by pggen. DO NOT EDIT.
package out
import (
"context"
"fmt"
"github.com/jackc/pgx/v5"
)
const alphaSQL = `SELECT 'alpha' as output;`
// Alpha implements Querier.Alpha.
func (q *DBQuerier) Alpha(ctx context.Context) (string, error) {
ctx = context.WithValue(ctx, "pggen_query_name", "Alpha")
row := q.conn.QueryRow(ctx, alphaSQL)
var item string
if err := row.Scan(&item); err != nil {
return item, fmt.Errorf("query Alpha: %w", err)
}
return item, nil
}
// AlphaBatch implements Querier.AlphaBatch.
func (q *DBQuerier) AlphaBatch(batch genericBatch) {
batch.Queue(alphaSQL)
}
// AlphaScan implements Querier.AlphaScan.
func (q *DBQuerier) AlphaScan(results pgx.BatchResults) (string, error) {
row := results.QueryRow()
var item string
if err := row.Scan(&item); err != nil {
return item, fmt.Errorf("scan AlphaBatch row: %w", err)
}
return item, nil
}