Skip to content

fix(drizzle): pagination applied incorrectly when sorting by a field inside an array field#15908

Open
r1tsuu wants to merge 1 commit intomainfrom
fix/sorting
Open

fix(drizzle): pagination applied incorrectly when sorting by a field inside an array field#15908
r1tsuu wants to merge 1 commit intomainfrom
fix/sorting

Conversation

@r1tsuu
Copy link
Member

@r1tsuu r1tsuu commented Mar 11, 2026

Fixes #14124

This PR changes select distinct usage in findMany to group by with min and max Specifically for cases when the sort query includes columns inside arrays to avoid duplicative results and so breaking the pagination.

@github-actions
Copy link
Contributor

📦 esbuild Bundle Analysis for payload

This analysis was generated by esbuild-bundle-analyzer. 🤖
This PR introduced no changes to the esbuild bundle! 🙌

@r1tsuu r1tsuu assigned DanRibbens and unassigned DanRibbens Mar 11, 2026
@r1tsuu r1tsuu requested a review from DanRibbens March 11, 2026 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LocalAPI: paginated query with sorting on a field inside an array field does not retrieve all docs of the queried page

2 participants