• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stephenafamo / bob / 21293428638

23 Jan 2026 04:32PM UTC coverage: 42.743% (+0.4%) from 42.35%
21293428638

push

github

web-flow
Merge pull request #613 from manhrev/feat/values-query

feat: Add VALUES query

159 of 194 new or added lines in 11 files covered. (81.96%)

8 existing lines in 1 file now uncovered.

9989 of 23370 relevant lines covered (42.74%)

599.69 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

75.0
/dialect/sqlite/dialect/values.go
1
package dialect
2

3
import (
4
        "context"
5
        "fmt"
6
        "io"
7

8
        "github.com/stephenafamo/bob"
9
)
10

11
// Trying to represent the row value as documented in
12
// https://www.sqlite.org/rowvalue.html
13
type ValuesQuery struct {
14
        RowVals []RowValue
15
}
16

17
type RowValue []bob.Expression
18

19
func (v RowValue) WriteSQL(ctx context.Context, w io.StringWriter, d bob.Dialect, start int) ([]any, error) {
8✔
20
        return bob.ExpressSlice(ctx, w, d, start, v, "(", ", ", ")")
8✔
21
}
8✔
22

23
func (v *ValuesQuery) AppendValues(vals ...bob.Expression) {
8✔
24
        if len(vals) == 0 {
8✔
NEW
25
                return
×
NEW
26
        }
×
27

28
        v.RowVals = append(v.RowVals, vals)
8✔
29
}
30

31
func (v ValuesQuery) WriteSQL(ctx context.Context, w io.StringWriter, d bob.Dialect, start int) ([]any, error) {
4✔
32
        var err error
4✔
33
        var args []any
4✔
34

4✔
35
        w.WriteString("VALUES ")
4✔
36

4✔
37
        // write values
4✔
38
        if len(v.RowVals) == 0 {
4✔
NEW
39
                return nil, fmt.Errorf("VALUES query must have at least one value expression")
×
NEW
40
        }
×
41
        args, err = bob.ExpressSlice(ctx, w, d, start, v.RowVals, "", ", ", "")
4✔
42
        if err != nil {
4✔
NEW
43
                return nil, err
×
NEW
44
        }
×
45

46
        w.WriteString("\n")
4✔
47
        return args, nil
4✔
48
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc