[PR #4265] [CLOSED] fix(drizzle-adapter): resolve fieldName mapping in field validation #13530

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/4265
Author: @ShobhitPatra
Created: 8/27/2025
Status: Closed

Base: canaryHead: fix/drizzle-adapter


📝 Commits (2)

  • 603a71a fix(drizzle-adapter): resolve fieldName mapping in field validation
  • 19df74b chore(drizzle): add tests for fieldName mapping in additionalFields

📊 Changes

2 files changed (+106 additions, -1 deletions)

View changed files

📝 packages/better-auth/src/adapters/drizzle-adapter/drizzle-adapter.ts (+2 -1)
📝 packages/better-auth/src/adapters/drizzle-adapter/test/adapter.drizzle.test.ts (+104 -0)

📄 Description

Closes #4211


Summary by cubic

Fix field validation in the Drizzle adapter by mapping incoming keys via getFieldName before checking the schema. This prevents false “field does not exist” errors when models use renamed or aliased fields.


🔄 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/4265 **Author:** [@ShobhitPatra](https://github.com/ShobhitPatra) **Created:** 8/27/2025 **Status:** ❌ Closed **Base:** `canary` ← **Head:** `fix/drizzle-adapter` --- ### 📝 Commits (2) - [`603a71a`](https://github.com/better-auth/better-auth/commit/603a71ab4eb31e354590a96e879bb83c8617d416) fix(drizzle-adapter): resolve fieldName mapping in field validation - [`19df74b`](https://github.com/better-auth/better-auth/commit/19df74b1415b790bfa5f21bde40904f5016a3605) chore(drizzle): add tests for fieldName mapping in additionalFields ### 📊 Changes **2 files changed** (+106 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/adapters/drizzle-adapter/drizzle-adapter.ts` (+2 -1) 📝 `packages/better-auth/src/adapters/drizzle-adapter/test/adapter.drizzle.test.ts` (+104 -0) </details> ### 📄 Description ### Closes #4211 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fix field validation in the Drizzle adapter by mapping incoming keys via getFieldName before checking the schema. This prevents false “field does not exist” errors when models use renamed or aliased fields. <!-- 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 08:59:20 -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#13530