[PR #7423] [CLOSED] feat(adapter): support select for findMany #24201

Closed
opened 2026-04-15 22:13:52 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7423
Author: @jslno
Created: 1/16/2026
Status: Closed

Base: canaryHead: 01-16-2026/findMany-select


📝 Commits (4)

📊 Changes

6 files changed (+61 additions, -9 deletions)

View changed files

📝 packages/better-auth/src/adapters/drizzle-adapter/drizzle-adapter.ts (+13 -3)
📝 packages/better-auth/src/adapters/kysely-adapter/kysely-adapter.ts (+17 -3)
📝 packages/better-auth/src/adapters/mongodb-adapter/mongodb-adapter.ts (+17 -1)
📝 packages/better-auth/src/adapters/prisma-adapter/prisma-adapter.ts (+2 -2)
📝 packages/better-auth/src/adapters/tests/basic.ts (+10 -0)
📝 packages/core/src/db/adapter/index.ts (+2 -0)

📄 Description

Summary by cubic

Add select support to findMany so callers can fetch only specific fields. This reduces payload size and improves performance, including when joins are used.

  • New Features
    • Core: DBAdapter and CustomAdapter findMany now accept select: string[].
    • Prisma/Kysely/MongoDB: implement field projection for findMany; join results are included as needed.
    • Drizzle: implemented select handling for findMany and findOne.
    • Tests: added SHOULD_FIND_MANY_WITH_SELECT to validate partial field selection.

Written for commit 9e890c64b3. Summary will update on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/7423 **Author:** [@jslno](https://github.com/jslno) **Created:** 1/16/2026 **Status:** ❌ Closed **Base:** `canary` ← **Head:** `01-16-2026/findMany-select` --- ### 📝 Commits (4) - [`cb0b983`](https://github.com/better-auth/better-auth/commit/cb0b983b25e4bc7ce24c08e72232ceb7cf3573c7) feat(adapter): support `select` for `findMany` - [`ba4d189`](https://github.com/better-auth/better-auth/commit/ba4d189dfff115cd7dd1288f82f51920a3f0222d) chore: fix linting - [`5cdee75`](https://github.com/better-auth/better-auth/commit/5cdee756a88b9df0f6e324bb14fb97484eff3088) chore: fix linting - [`9e890c6`](https://github.com/better-auth/better-auth/commit/9e890c64b3095911c1503b81fcdfabfe90496119) chore: cleanup ### 📊 Changes **6 files changed** (+61 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/adapters/drizzle-adapter/drizzle-adapter.ts` (+13 -3) 📝 `packages/better-auth/src/adapters/kysely-adapter/kysely-adapter.ts` (+17 -3) 📝 `packages/better-auth/src/adapters/mongodb-adapter/mongodb-adapter.ts` (+17 -1) 📝 `packages/better-auth/src/adapters/prisma-adapter/prisma-adapter.ts` (+2 -2) 📝 `packages/better-auth/src/adapters/tests/basic.ts` (+10 -0) 📝 `packages/core/src/db/adapter/index.ts` (+2 -0) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Add select support to findMany so callers can fetch only specific fields. This reduces payload size and improves performance, including when joins are used. - **New Features** - Core: DBAdapter and CustomAdapter findMany now accept select: string[]. - Prisma/Kysely/MongoDB: implement field projection for findMany; join results are included as needed. - Drizzle: implemented select handling for findMany and findOne. - Tests: added SHOULD_FIND_MANY_WITH_SELECT to validate partial field selection. <sup>Written for commit 9e890c64b3095911c1503b81fcdfabfe90496119. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-15 22:13:52 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#24201