-
Notifications
You must be signed in to change notification settings - Fork 1k
Expand file tree
/
Copy pathquery.sql.go
More file actions
52 lines (44 loc) · 1.03 KB
/
query.sql.go
File metadata and controls
52 lines (44 loc) · 1.03 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.30.0
// source: query.sql
package querytest
import (
"context"
)
const getAuthorByID = `-- name: GetAuthorByID :one
SELECT id, name, bio
FROM authors
WHERE id = ?
LIMIT 1
`
func (q *Queries) GetAuthorByID(ctx context.Context, id int64) (Author, error) {
row := q.db.QueryRowContext(ctx, getAuthorByID, id)
var i Author
err := row.Scan(&i.ID, &i.Name, &i.Bio)
return i, err
}
const getAuthorIDByID = `-- name: GetAuthorIDByID :one
SELECT id
FROM authors
WHERE id = ?
LIMIT 1
`
func (q *Queries) GetAuthorIDByID(ctx context.Context, id int64) (int64, error) {
row := q.db.QueryRowContext(ctx, getAuthorIDByID, id)
var id_2 int64
err := row.Scan(&id_2)
return id_2, err
}
const getUser = `-- name: GetUser :one
SELECT sub
FROM users
WHERE sub = ?
LIMIT 1
`
func (q *Queries) GetUser(ctx context.Context, sub string) (string, error) {
row := q.db.QueryRowContext(ctx, getUser, sub)
var sub_2 string
err := row.Scan(&sub_2)
return sub_2, err
}