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

stephenafamo / bob / 28859945952

07 Jul 2026 10:37AM UTC coverage: 47.617% (+0.6%) from 47.059%
28859945952

Pull #726

github

sandonemaki
test
Pull Request #726: perf(orm): drop reflection from AfterPreloader collect/load path

43 of 75 new or added lines in 10 files covered. (57.33%)

15 existing lines in 4 files now uncovered.

11827 of 24838 relevant lines covered (47.62%)

721.82 hits per line

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

0.0
/dialect/sqlite/load.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/orm"
7
)
8

9
type (
10
        // Preloader builds a query mod that modifies the original query to retrieve related fields
11
        // while it can be used as a queryMod, it does not have any direct effect.
12
        // if using manually, the ApplyPreload method should be called
13
        // with the query's context AFTER other mods have been applied
14
        Preloader   = orm.Preloader[*dialect.SelectQuery]
15
        PreloadRel  = orm.PreloadRel[Expression]
16
        PreloadSide = orm.PreloadSide[Expression]
17
        // Settings for preloading relationships
18
        PreloadSettings = orm.PreloadSettings[*dialect.SelectQuery]
19
        // Modifies preloading relationships
20
        PreloadOption = orm.PreloadOption[*dialect.SelectQuery]
21
)
22

23
func PreloadOnly(cols ...string) PreloadOption {
×
24
        return orm.PreloadOnly[*dialect.SelectQuery](cols)
×
25
}
×
26

27
func PreloadExcept(cols ...string) PreloadOption {
×
28
        return orm.PreloadExcept[*dialect.SelectQuery](cols)
×
29
}
×
30

31
func PreloadWhere(f ...func(from, to string) []bob.Expression) PreloadOption {
×
32
        return orm.PreloadWhere[*dialect.SelectQuery](f)
×
33
}
×
34

35
func PreloadAs(alias string) PreloadOption {
×
36
        return orm.PreloadAs[*dialect.SelectQuery](alias)
×
37
}
×
38

NEW
39
func Preload[T orm.Preloadable, Ts ~[]T](rel orm.PreloadRel[Expression], cols []string, mapper orm.PreloadMapper[T], opts ...PreloadOption) Preloader {
×
NEW
40
        return orm.Preload[T, Ts](rel, cols, mapper, opts...)
×
UNCOV
41
}
×
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