[PR #8104] [MERGED] fix: force drizzle-adapter to return dates correctly #7750

Closed
opened 2026-03-13 13:48:07 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/8104
Author: @ping-maxwell
Created: 2/23/2026
Status: Merged
Merged: 2/23/2026
Merged by: @Bekacru

Base: canaryHead: fix/drizzle-should-return-date


📝 Commits (1)

  • 61df1ca fix: force drizzle-adapter to return dates correctly

📊 Changes

1 file changed (+4 additions, -0 deletions)

View changed files

📝 packages/drizzle-adapter/src/drizzle-adapter.ts (+4 -0)

📄 Description

On very specific cases using specific dialects with a specific field configuration, dates fields are returned as either strings or numbers and not truly dates.

This PR applies a transformation on fields that are meant to be dates, if a field is already a date then it will skip transformation, so there is no need for checking for specific cases in the code.

closes https://github.com/better-auth/better-auth/issues/7819


Summary by cubic

Ensure date fields in drizzle-adapter always return Date objects across providers by forcing adapter-level normalization. Fixes cases where some dialects returned strings or numbers for dates.

  • Bug Fixes
    • Set supportsDates: false to always run the date transformation; it’s a no-op when the value is already a Date.
    • Resolves incorrect date values in specific dialect/field configurations (issue #7819).

Written for commit 61df1ca716. 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/8104 **Author:** [@ping-maxwell](https://github.com/ping-maxwell) **Created:** 2/23/2026 **Status:** ✅ Merged **Merged:** 2/23/2026 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `fix/drizzle-should-return-date` --- ### 📝 Commits (1) - [`61df1ca`](https://github.com/better-auth/better-auth/commit/61df1ca716669e32f35d2e2405516f887637fa38) fix: force drizzle-adapter to return dates correctly ### 📊 Changes **1 file changed** (+4 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/drizzle-adapter/src/drizzle-adapter.ts` (+4 -0) </details> ### 📄 Description On very specific cases using specific dialects with a specific field configuration, dates fields are returned as either strings or numbers and not truly dates. This PR applies a transformation on fields that are meant to be dates, if a field is already a date then it will skip transformation, so there is no need for checking for specific cases in the code. closes https://github.com/better-auth/better-auth/issues/7819 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Ensure date fields in drizzle-adapter always return Date objects across providers by forcing adapter-level normalization. Fixes cases where some dialects returned strings or numbers for dates. - **Bug Fixes** - Set supportsDates: false to always run the date transformation; it’s a no-op when the value is already a Date. - Resolves incorrect date values in specific dialect/field configurations (issue #7819). <sup>Written for commit 61df1ca716669e32f35d2e2405516f887637fa38. 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-03-13 13:48:07 -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#7750