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

stephenafamo / bob / 16832136476

08 Aug 2025 01:51PM UTC coverage: 40.77% (+0.4%) from 40.407%
16832136476

push

github

web-flow
Merge pull request #531 from stephenafamo/schema-in-preload

Use dedicated `orm.PreloadRel` struct for Preloading

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

3 existing lines in 3 files now uncovered.

9102 of 22325 relevant lines covered (40.77%)

276.38 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, opts ...PreloadOption) Preloader {
×
NEW
40
        return orm.Preload[T, Ts](rel, cols, 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