[PR #5311] [MERGED] fix(drizzle-adapter): handle all operators in multiple where conditions #14165

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5311
Author: @Kinfe123
Created: 10/14/2025
Status: Merged
Merged: 10/15/2025
Merged by: @Kinfe123

Base: canaryHead: fix/drizzle-where-operators


📝 Commits (4)

  • 3bc078c fix(drizzle-adapter): handle all operators in multiple WHERE conditions
  • 9b3c559 lint
  • c2376ff Merge branch 'canary' into fix/drizzle-where-operators
  • 9036f37 lint

📊 Changes

2 files changed (+149 additions, -0 deletions)

View changed files

📝 packages/better-auth/src/adapters/drizzle-adapter/drizzle-adapter.ts (+64 -0)
📝 packages/better-auth/src/adapters/tests/normal.ts (+85 -0)

📄 Description

Summary by cubic

Fixes the Drizzle adapter to correctly handle multiple where conditions with all supported operators in both AND and OR clauses. Adds validation and tests to ensure reliable filtering.

  • Bug Fixes
    • Map operators to Drizzle predicates: eq, ne, lt, lte, gt, gte, contains, starts_with, ends_with, in, not_in (AND/OR groups).
    • Validate that in/not_in values are arrays; throw BetterAuthError otherwise.
    • Add findMany tests covering mixed operators and connectors.

🔄 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/5311 **Author:** [@Kinfe123](https://github.com/Kinfe123) **Created:** 10/14/2025 **Status:** ✅ Merged **Merged:** 10/15/2025 **Merged by:** [@Kinfe123](https://github.com/Kinfe123) **Base:** `canary` ← **Head:** `fix/drizzle-where-operators` --- ### 📝 Commits (4) - [`3bc078c`](https://github.com/better-auth/better-auth/commit/3bc078c910897271bda0e255232887c72a7a5332) fix(drizzle-adapter): handle all operators in multiple WHERE conditions - [`9b3c559`](https://github.com/better-auth/better-auth/commit/9b3c559ad2d0ad2addd733d2aa8eeb5e460efbe6) lint - [`c2376ff`](https://github.com/better-auth/better-auth/commit/c2376ff9e2609622b135727bfc2cb0b45be249a7) Merge branch 'canary' into fix/drizzle-where-operators - [`9036f37`](https://github.com/better-auth/better-auth/commit/9036f37a7d2b21be9160a7728803668386f5a68f) lint ### 📊 Changes **2 files changed** (+149 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/adapters/drizzle-adapter/drizzle-adapter.ts` (+64 -0) 📝 `packages/better-auth/src/adapters/tests/normal.ts` (+85 -0) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Fixes the Drizzle adapter to correctly handle multiple where conditions with all supported operators in both AND and OR clauses. Adds validation and tests to ensure reliable filtering. - **Bug Fixes** - Map operators to Drizzle predicates: eq, ne, lt, lte, gt, gte, contains, starts_with, ends_with, in, not_in (AND/OR groups). - Validate that in/not_in values are arrays; throw BetterAuthError otherwise. - Add findMany tests covering mixed operators and connectors. <!-- 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:20:37 -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#14165