[PR #4549] [MERGED] fix(memory-adapter): should respect where connector #5442

Closed
opened 2026-03-13 12:22:54 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/4549
Author: @jslno
Created: 9/9/2025
Status: Merged
Merged: 9/11/2025
Merged by: @himself65

Base: canaryHead: fix/memory-adapter-where-connector


📝 Commits (10+)

📊 Changes

3 files changed (+101 additions, -10 deletions)

View changed files

📝 packages/better-auth/src/adapters/memory-adapter/adapter.memory.test.ts (+4 -0)
📝 packages/better-auth/src/adapters/memory-adapter/memory-adapter.ts (+28 -10)
📝 packages/better-auth/src/adapters/test.ts (+69 -0)

📄 Description

Summary by cubic

Fixes memory adapter filtering to honor where connectors (AND/OR) so combined conditions return correct results. Previously, connectors were ignored.

  • Bug Fixes
    • Support OR across where clauses; default connector is AND.
    • Centralized clause evaluation (evalClause/evalWhere) and preserved operators: in, not_in, contains, starts_with, ends_with, equality.
    • Treat empty where as match-all.

🔄 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/4549 **Author:** [@jslno](https://github.com/jslno) **Created:** 9/9/2025 **Status:** ✅ Merged **Merged:** 9/11/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `fix/memory-adapter-where-connector` --- ### 📝 Commits (10+) - [`248fe93`](https://github.com/better-auth/better-auth/commit/248fe93b34b734f6415bd6d4e18246ff488d40a7) fix(memory-adapter): should respect where connector - [`92b37c7`](https://github.com/better-auth/better-auth/commit/92b37c76bfe62b5e9eaded3941ee4fe1c83f9487) chore: add test - [`bc3e80c`](https://github.com/better-auth/better-auth/commit/bc3e80c44d40c06063b9dddae9674fd5651f2e55) Revert "chore: add test" - [`4f1ba17`](https://github.com/better-auth/better-auth/commit/4f1ba17b05e52af4f6d20faa541721a50f33d98d) chore: fix tests - [`e107f59`](https://github.com/better-auth/better-auth/commit/e107f599d2a02e085450190ced5b3a7788aed9b8) Merge branch 'canary' of https://github.com/better-auth/better-auth into fix/memory-adapter-where-connector - [`5507362`](https://github.com/better-auth/better-auth/commit/5507362fd763f5738ec057e7be725aae0d69ca0a) chore: fix linting - [`d450fa2`](https://github.com/better-auth/better-auth/commit/d450fa261178057254f82b0b6d5064f2404b230a) chore: fix linting - [`1b583e1`](https://github.com/better-auth/better-auth/commit/1b583e1951dbb64e7d98114eeaa9608060a2aa6e) fix: disable transaction tests for memory number id adapter - [`259a010`](https://github.com/better-auth/better-auth/commit/259a01055c8e877e5ba69c8ce3a497aea84b6446) chore: cleanup - [`efafa22`](https://github.com/better-auth/better-auth/commit/efafa2276462764c2f0908ea4aa1fa4c29420954) fix: used wrong logical operator ### 📊 Changes **3 files changed** (+101 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/adapters/memory-adapter/adapter.memory.test.ts` (+4 -0) 📝 `packages/better-auth/src/adapters/memory-adapter/memory-adapter.ts` (+28 -10) 📝 `packages/better-auth/src/adapters/test.ts` (+69 -0) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Fixes memory adapter filtering to honor where connectors (AND/OR) so combined conditions return correct results. Previously, connectors were ignored. - **Bug Fixes** - Support OR across where clauses; default connector is AND. - Centralized clause evaluation (evalClause/evalWhere) and preserved operators: in, not_in, contains, starts_with, ends_with, equality. - Treat empty where as match-all. <!-- 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-03-13 12:22:54 -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#5442