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

stephenafamo / bob / 21511526140

30 Jan 2026 08:53AM UTC coverage: 42.626% (-0.1%) from 42.739%
21511526140

Pull #622

github

manhrev
feat: all, some, any starters for psql
Pull Request #622: Add EXISTS, ALL, SOME, ANY expressions

0 of 62 new or added lines in 4 files covered. (0.0%)

22 existing lines in 2 files now uncovered.

9989 of 23434 relevant lines covered (42.63%)

598.05 hits per line

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

49.06
/dialect/sqlite/starters.go
1
package sqlite
2

3
import (
4
        "github.com/stephenafamo/bob"
5
        "github.com/stephenafamo/bob/dialect/sqlite/dialect"
6
        "github.com/stephenafamo/bob/expr"
7
        "github.com/stephenafamo/bob/mods"
8
)
9

10
type Expression = dialect.Expression
11

12
//nolint:gochecknoglobals
13
var bmod = expr.Builder[Expression, Expression]{}
14

15
// F creates a function expression with the given name and args
16
//
17
//        SQL: generate_series(1, 3)
18
//        Go: sqlite.F("generate_series", 1, 3)
19
func F(name string, args ...any) mods.Moddable[*dialect.Function] {
8✔
20
        f := dialect.NewFunction(name, args...)
8✔
21

8✔
22
        return mods.Moddable[*dialect.Function](func(mods ...bob.Mod[*dialect.Function]) *dialect.Function {
16✔
23
                for _, mod := range mods {
10✔
24
                        mod.Apply(f)
2✔
25
                }
2✔
26

27
                return f
8✔
28
        })
29
}
30

31
// S creates a string literal
32
// SQL: 'a string'
33
// Go: sqlite.S("a string")
34
func S(s string) Expression {
18✔
35
        return bmod.S(s)
18✔
36
}
18✔
37

38
// SQL: NOT true
39
// Go: sqlite.Not("true")
40
func Not(exp bob.Expression) Expression {
×
41
        return bmod.Not(exp)
×
42
}
×
43

44
// SQL: a OR b OR c
45
// Go: sqlite.Or("a", "b", "c")
46
func Or(args ...bob.Expression) Expression {
×
47
        return bmod.Or(args...)
×
48
}
×
49

50
// SQL: a AND b AND c
51
// Go: sqlite.And("a", "b", "c")
52
func And(args ...bob.Expression) Expression {
×
53
        return bmod.And(args...)
×
54
}
×
55

56
// SQL: a || b || c
57
// Go: sqlite.Concat("a", "b", "c")
58
func Concat(args ...bob.Expression) Expression {
×
59
        return expr.X[Expression, Expression](expr.Join{Exprs: args, Sep: " || "})
×
60
}
×
61

62
// SQL: $1, $2, $3
63
// Go: sqlite.Args("a", "b", "c")
64
func Arg(args ...any) Expression {
46✔
65
        return bmod.Arg(args...)
46✔
66
}
46✔
67

68
// SQL: ($1, $2, $3)
69
// Go: sqlite.ArgGroup("a", "b", "c")
70
func ArgGroup(args ...any) Expression {
4✔
71
        return bmod.ArgGroup(args...)
4✔
72
}
4✔
73

74
// SQL: $1, $2, $3
75
// Go: sqlite.Placeholder(3)
76
func Placeholder(n uint) Expression {
×
77
        return bmod.Placeholder(n)
×
78
}
×
79

80
// SQL: (a, b)
81
// Go: sqlite.Group("a", "b")
82
func Group(exps ...bob.Expression) Expression {
2✔
83
        return bmod.Group(exps...)
2✔
84
}
2✔
85

86
// SQL: "table"."column"
87
// Go: sqlite.Quote("table", "column")
88
func Quote(ss ...string) Expression {
36✔
89
        return bmod.Quote(ss...)
36✔
90
}
36✔
91

92
// SQL: where a = $1
93
// Go: sqlite.Raw("where a = ?", "something")
94
func Raw(query string, args ...any) Expression {
×
95
        return bmod.Raw(query, args...)
×
96
}
×
97

98
// SQL: CAST(a AS int)
99
// Go: sqlite.Cast("a", "int")
100
func Cast(exp bob.Expression, typname string) Expression {
×
101
        return bmod.Cast(exp, typname)
×
102
}
×
103

104
// SQL: CASE WHEN a THEN b ELSE c END
105
// Go: sqlite.Case().When("a", "b").Else("c")
106
func Case() expr.CaseChain[Expression, Expression] {
4✔
107
        return expr.NewCase[Expression, Expression]()
4✔
108
}
4✔
109

110
// SQL: EXISTS ((SELECT 1))
111
// Go: sqlite.Exists(sqlite.Select(sm.Columns("1")))
NEW
112
func Exists(exp bob.Expression) Expression {
×
NEW
113
        return bmod.Exists(exp)
×
NEW
114
}
×
115

116
// SQL: - 1 - 2
117
// Go: sqlite.Minus(sqlite.Arg(1)).Minus(sqlite.Arg(2))
NEW
118
func Minus(exp bob.Expression) Expression {
×
NEW
119
        return bmod.Minus(exp)
×
NEW
120
}
×
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