[PR #6572] [MERGED] fix(kysely): wrong affected row count in updateMany & deleteMany #15000

Closed
opened 2026-04-13 09:45:51 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6572
Author: @jslno
Created: 12/6/2025
Status: Merged
Merged: 12/9/2025
Merged by: @Bekacru

Base: canaryHead: 06-12-2025/fix-kysely-return-row-count


📝 Commits (1)

  • f8a642a fix(kysely-adapter): return actual affected row count for updateMany

📊 Changes

1 file changed (+8 additions, -3 deletions)

View changed files

📝 packages/better-auth/src/adapters/kysely-adapter/kysely-adapter.ts (+8 -3)

📄 Description

Related: https://discord.com/channels/1288403910284935179/1446936682401235074


Summary by cubic

Fixes incorrect affected row counts in the Kysely adapter for updateMany and deleteMany. Counts now reflect actual rows updated/deleted across dialects.

  • Bug Fixes
    • Use executeTakeFirst() with numUpdatedRows/numDeletedRows instead of result length.
    • Convert to number and cap at Number.MAX_SAFE_INTEGER to handle BigInt results.

Written for commit f8a642a809. Summary will update automatically 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/6572 **Author:** [@jslno](https://github.com/jslno) **Created:** 12/6/2025 **Status:** ✅ Merged **Merged:** 12/9/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `06-12-2025/fix-kysely-return-row-count` --- ### 📝 Commits (1) - [`f8a642a`](https://github.com/better-auth/better-auth/commit/f8a642a809359150c7243a9434ece1491737fad6) fix(kysely-adapter): return actual affected row count for `updateMany` ### 📊 Changes **1 file changed** (+8 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/adapters/kysely-adapter/kysely-adapter.ts` (+8 -3) </details> ### 📄 Description Related: https://discord.com/channels/1288403910284935179/1446936682401235074 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixes incorrect affected row counts in the Kysely adapter for updateMany and deleteMany. Counts now reflect actual rows updated/deleted across dialects. - **Bug Fixes** - Use executeTakeFirst() with numUpdatedRows/numDeletedRows instead of result length. - Convert to number and cap at Number.MAX_SAFE_INTEGER to handle BigInt results. <sup>Written for commit f8a642a809359150c7243a9434ece1491737fad6. Summary will update automatically 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-13 09:45:51 -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#15000