Skip to content

TVF and split queries#14

Merged
hbulens merged 15 commits into
masterfrom
feat/splitquery-tvf
May 20, 2026
Merged

TVF and split queries#14
hbulens merged 15 commits into
masterfrom
feat/splitquery-tvf

Conversation

@hbulens

@hbulens hbulens commented May 14, 2026

Copy link
Copy Markdown
Member

Adds QueryFunctionAsync for SQL Server iTVFs, adds a splitQuery opt-in on FindAllAsync and FindAllPagedAsync, and fixes a long-standing perf bug where ordered + paged queries fetched all WHERE-matching rows and paged in .NET memory instead of SQL.

Call an inline TVF through the repository:

var rows = await repo.QueryFunctionAsync<AppointmentDto>(
  "fGetMyPreciousDataQuickly", 
  "dbo",
   parameters,
   select: x => projector.Map(x),
   splitQuery: true);

Avoid Cartesian fan-out on multi-collection projections:

var page = await repo.FindAllPagedAsync(
    where: x => x.Url.Contains("cat"),
    orderBy: orders,
    page: 1, pageSize: 50,
    splitQuery: true,
    includes: nameof(Blog.Posts), nameof(Blog.Tags));

@hbulens hbulens changed the title TVH and split queries TVF and split queries May 14, 2026
hbulens and others added 14 commits May 14, 2026 14:32
Several utility classes and the EfRepository partial were marked with
[ExcludeFromCodeCoverage], which hid them from coverage reports even
though they contain real production logic. On partial classes the
attribute also propagates to every other partial declaration, so the
whole EfRepository was disappearing from the report.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hbulens hbulens merged commit 62d4f4c into master May 20, 2026
2 checks passed
@hbulens hbulens deleted the feat/splitquery-tvf branch May 20, 2026 12:43
@github-actions

Copy link
Copy Markdown

Code Coverage

Package Line Rate Branch Rate Health
Dime.Repositories 100% 100%
Dime.Repositories.Sql.EntityFramework 94% 85%
Summary 94% (550 / 584) 85% (190 / 224)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant