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

stephenafamo / bob / 14939098091

09 May 2025 10:59PM UTC coverage: 36.868% (-4.6%) from 41.506%
14939098091

push

github

stephenafamo
Move reusable sqlite parser components to antlrhelpers package

0 of 758 new or added lines in 12 files covered. (0.0%)

547 existing lines in 8 files now uncovered.

6533 of 17720 relevant lines covered (36.87%)

212.48 hits per line

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

0.0
/gen/bobgen-sqlite/driver/parser/args.go
1
package parser
2

3
import (
4
        "github.com/stephenafamo/bob/gen/bobgen-helpers/parser"
5
        "github.com/stephenafamo/bob/gen/drivers"
6
        sqliteparser "github.com/stephenafamo/sqlparser/sqlite"
7
)
8

9
func (v *visitor) getArgs(start, stop int) []drivers.QueryArg {
×
10
        args, groups := v.sortExprsIntoArgsAndGroups(start, stop)
×
NEW
11
        return v.GetArgs(args, groups, TranslateColumnType)
×
12
}
×
13

NEW
14
func (v *visitor) sortExprsIntoArgsAndGroups(start, stop int) ([]NodeInfo, []NodeInfo) {
×
NEW
15
        args := []NodeInfo{}
×
NEW
16
        groups := []NodeInfo{}
×
17

×
18
        // Sort the exprs into groups and binds
×
NEW
19
        for _, expr := range v.Infos {
×
NEW
20
                if expr.Node.GetStart().GetStart() < start || expr.Node.GetStop().GetStop() > stop {
×
UNCOV
21
                        continue
×
22
                }
23

NEW
24
                if expr.IsGroup {
×
25
                        groups = append(groups, expr)
×
26
                        continue
×
27
                }
28

NEW
29
                if _, ok := expr.Node.(*sqliteparser.Expr_bindContext); !ok {
×
30
                        continue
×
31
                }
32

33
                args = append(args, expr)
×
34
        }
35

36
        for i := range args {
×
37
                // Merge in case the name is configured in the bind
×
NEW
38
                args[i].Config = args[i].Config.Merge(
×
NEW
39
                        parser.ParseQueryColumnConfig(v.getCommentToRight(args[i].Node)),
×
40
                )
×
41
        }
×
42

43
        for i := range groups {
×
44
                // Merge in case the name is configured in the bind
×
NEW
45
                groups[i].Config = groups[i].Config.Merge(
×
NEW
46
                        parser.ParseQueryColumnConfig(v.getCommentToRight(groups[i].Node)),
×
47
                )
×
48
        }
×
49

50
        return args, groups
×
51
}
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

© 2025 Coveralls, Inc