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

stephenafamo / bob / 29178719639
48%
main: 48%

Build:
Build:
LAST BUILD BRANCH: fix/stmt-rows-leak
DEFAULT BRANCH: main
Ran 12 Jul 2026 03:55AM UTC
Jobs 2
Files 252
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

12 Jul 2026 03:43AM UTC coverage: 48.155% (+0.4%) from 47.707%
29178719639

Pull #736

github

sandonemaki
feat(orm): add opt-in PreloadDedup to share preloaded to-one instances

JOIN-based preloading builds one related struct per parent row, even when
many parents reference the same related row. Add an opt-in PreloadDedup
option (orm.PreloadDedup, wrapped by psql/mysql/sqlite PreloadDedup) that
caches related structs per query execution keyed by the join columns, so
parent rows with the same key share a single instance — the same sharing
semantics as ThenLoad, without changing the emitted SQL.

With the reflection-based StructMapper the key is read from the scan
destinations before the struct is built, so duplicate rows skip
construction, nested preload AfterMods and Collect entirely. With a typed
PreloadMapper the link is opaque, so the key is read from the built value:
instances are still shared and collected once, but construction still runs.
A last-key fast path handles sorted results with a single comparison.

Dedup disables itself when the join key columns are not selected
(PreloadOnly/PreloadExcept), never caches unmatched LEFT JOIN rows, and
turns itself off after 1024 distinct keys without a single cache hit as a
safety valve for workloads with no duplication.
Pull Request #736: feat(orm): add opt-in PreloadDedup — share preloaded to-one instances across parent rows

208 of 265 new or added lines in 4 files covered. (78.49%)

8 existing lines in 1 file now uncovered.

12095 of 25117 relevant lines covered (48.15%)

744.99 hits per line

Uncovered Changes

Lines Coverage ∆ File
48
74.89
19.89% orm/load.go
3
0.0
0.0% dialect/mysql/load.go
3
0.0
0.0% dialect/psql/load.go
3
0.0
0.0% dialect/sqlite/load.go

Coverage Regressions

Lines Coverage ∆ File
8
77.25
-4.79% gen/aliases.go
Jobs
ID Job ID Ran Files Coverage
1 go-oldstable - 29178719639.1 12 Jul 2026 03:55AM UTC 252
48.15
GitHub Action Run
2 go-stable - 29178719639.2 12 Jul 2026 03:55AM UTC 252
48.15
GitHub Action Run
Source Files on build 29178719639
  • Tree
  • List 252
  • Changed 6
  • Source Changed 0
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #736
  • PR Base - main (#29131698836)
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