-
Notifications
You must be signed in to change notification settings - Fork 209
/
select_return.go
95 lines (82 loc) · 2.84 KB
/
select_return.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
package dbr
import (
"context"
)
// ReturnInt64 executes the SelectStmt and returns the value as an int64.
func (b *SelectStmt) ReturnInt64() (int64, error) {
var v int64
err := b.LoadOne(&v)
return v, err
}
// ReturnInt64Context executes the SelectStmt and returns the value as an int64.
// The given context is passed into the query runner.
func (b *SelectStmt) ReturnInt64Context(ctx context.Context) (int64, error) {
var v int64
err := b.LoadOneContext(ctx, &v)
return v, err
}
// ReturnInt64s executes the SelectStmt and returns the value as a slice of int64s.
func (b *SelectStmt) ReturnInt64s() ([]int64, error) {
var v []int64
_, err := b.Load(&v)
return v, err
}
// ReturnInt64sContext executes the SelectStmt and returns the value as a slice of int64s.
// The given context is passed into the query runner.
func (b *SelectStmt) ReturnInt64sContext(ctx context.Context) ([]int64, error) {
var v []int64
_, err := b.LoadContext(ctx, &v)
return v, err
}
// ReturnUint64 executes the SelectStmt and returns the value as an uint64.
func (b *SelectStmt) ReturnUint64() (uint64, error) {
var v uint64
err := b.LoadOne(&v)
return v, err
}
// ReturnUint64Context executes the SelectStmt and returns the value as an uint64.
// The given context is passed into the query runner.
func (b *SelectStmt) ReturnUint64Context(ctx context.Context) (uint64, error) {
var v uint64
err := b.LoadOneContext(ctx, &v)
return v, err
}
// ReturnUint64s executes the SelectStmt and returns the value as a slice of uint64s.
func (b *SelectStmt) ReturnUint64s() ([]uint64, error) {
var v []uint64
_, err := b.Load(&v)
return v, err
}
// ReturnUint64sContext executes the SelectStmt and returns the value as a slice of uint64s.
// The given context is passed into the query runner.
func (b *SelectStmt) ReturnUint64sContext(ctx context.Context) ([]uint64, error) {
var v []uint64
_, err := b.LoadContext(ctx, &v)
return v, err
}
// ReturnString executes the SelectStmt and returns the value as a string.
func (b *SelectStmt) ReturnString() (string, error) {
var v string
err := b.LoadOne(&v)
return v, err
}
// ReturnStringContext executes the SelectStmt and returns the value as a string.
// The given context is passed into the query runner.
func (b *SelectStmt) ReturnStringContext(ctx context.Context) (string, error) {
var v string
err := b.LoadOneContext(ctx, &v)
return v, err
}
// ReturnStrings executes the SelectStmt and returns the value as a slice of strings.
func (b *SelectStmt) ReturnStrings() ([]string, error) {
var v []string
_, err := b.Load(&v)
return v, err
}
// ReturnStringsContext executes the SelectStmt and returns the value as a slice of strings.
// The given context is passed into the query runner.
func (b *SelectStmt) ReturnStringsContext(ctx context.Context) ([]string, error) {
var v []string
_, err := b.LoadContext(ctx, &v)
return v, err
}