[PR #7483] [MERGED] fix(prisma-adapter): enhance null condition handling #15593

Closed
opened 2026-04-13 10:07:29 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7483
Author: @himself65
Created: 1/20/2026
Status: Merged
Merged: 1/20/2026
Merged by: @himself65

Base: canaryHead: himself65/2026/01/19/prisma


📝 Commits (2)

  • d008a5d fix: enhance null condition handling in Prisma adapter
  • af5bc11 fix(prisma-adapter): enhance null condition handling

📊 Changes

1 file changed (+6 additions, -1 deletions)

View changed files

📝 packages/better-auth/src/adapters/prisma-adapter/prisma-adapter.ts (+6 -1)

📄 Description

Fixes: https://github.com/better-auth/better-auth/pull/7464


Summary by cubic

Fixes handling of "not equals null" filters in the Prisma adapter: now applies {not: null} for nullable fields and skips the condition for non-nullable fields. This prevents dropped filters and returns correct query results.

  • Bug Fixes
    • Detect field nullability with getFieldAttributes and conditionally apply { [fieldName]: { not: null } }.

Written for commit af5bc11e7e. 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/7483 **Author:** [@himself65](https://github.com/himself65) **Created:** 1/20/2026 **Status:** ✅ Merged **Merged:** 1/20/2026 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2026/01/19/prisma` --- ### 📝 Commits (2) - [`d008a5d`](https://github.com/better-auth/better-auth/commit/d008a5d38b2052234aaaa7932c20b15c5992d4e1) fix: enhance null condition handling in Prisma adapter - [`af5bc11`](https://github.com/better-auth/better-auth/commit/af5bc11e7eb604149ca32812592e794509b2a42d) fix(prisma-adapter): enhance null condition handling ### 📊 Changes **1 file changed** (+6 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/adapters/prisma-adapter/prisma-adapter.ts` (+6 -1) </details> ### 📄 Description Fixes: https://github.com/better-auth/better-auth/pull/7464 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixes handling of "not equals null" filters in the Prisma adapter: now applies {not: null} for nullable fields and skips the condition for non-nullable fields. This prevents dropped filters and returns correct query results. - **Bug Fixes** - Detect field nullability with getFieldAttributes and conditionally apply { [fieldName]: { not: null } }. <sup>Written for commit af5bc11e7eb604149ca32812592e794509b2a42d. 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-13 10:07:29 -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#15593