[PR #1460] [CLOSED] Transform sqlite values in Drizzle adapter. #12065

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/1460
Author: @RyanNieuwoudt
Created: 2/16/2025
Status: Closed

Base: mainHead: drizzle-sqlite


📝 Commits (10+)

  • 9e35df0 Transform sqlite values in Drizzle adapter.
  • feb2b20 Merge branch 'better-auth:main' into drizzle-sqlite
  • 674ac0f Merge branch 'better-auth:main' into drizzle-sqlite
  • 9ae6fd2 Merge branch 'better-auth:main' into drizzle-sqlite
  • 1f71f6d Merge branch 'better-auth:main' into drizzle-sqlite
  • 7544b95 Merge branch 'better-auth:main' into drizzle-sqlite
  • 856a15b Merge branch 'better-auth:main' into drizzle-sqlite
  • 89e00a8 Merge branch 'better-auth:main' into drizzle-sqlite
  • df20d14 Merge branch 'better-auth:main' into drizzle-sqlite
  • 5e6c780 Merge branch 'better-auth:main' into drizzle-sqlite

📊 Changes

1 file changed (+33 additions, -2 deletions)

View changed files

📝 packages/better-auth/src/adapters/drizzle-adapter/drizzle-adapter.ts (+33 -2)

📄 Description

Not sure whether this is considered a fix or a new feature, depending on whether better-auth officially supports sqlite via drizzle-adapter. In this configuration, authentication does not work. Inserting into verifications currently fails with:

D1_TYPE_ERROR: Type 'object' not supported for value…

The the dates are passed as objects (not supported in D1) instead of strings (supported in D1).

This pull request resolves the issue, and perhaps enables sqlite via drizzle-adapter more generally. It is based on existing transformations in kysely-adapter, and is intended to match existing code.


🔄 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/1460 **Author:** [@RyanNieuwoudt](https://github.com/RyanNieuwoudt) **Created:** 2/16/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `drizzle-sqlite` --- ### 📝 Commits (10+) - [`9e35df0`](https://github.com/better-auth/better-auth/commit/9e35df091856e07d4b5eda2f7e8a50a8bf5601a1) Transform sqlite values in Drizzle adapter. - [`feb2b20`](https://github.com/better-auth/better-auth/commit/feb2b20f5f3dc0def7666467c0f68530ee85cd18) Merge branch 'better-auth:main' into drizzle-sqlite - [`674ac0f`](https://github.com/better-auth/better-auth/commit/674ac0f6ba9db38348d72dfb85ee167862ba50e8) Merge branch 'better-auth:main' into drizzle-sqlite - [`9ae6fd2`](https://github.com/better-auth/better-auth/commit/9ae6fd2f1001c4f81ef6983174a8690f9cb5d829) Merge branch 'better-auth:main' into drizzle-sqlite - [`1f71f6d`](https://github.com/better-auth/better-auth/commit/1f71f6de2c538e1ecb7e472e9ce1da01e75bbdff) Merge branch 'better-auth:main' into drizzle-sqlite - [`7544b95`](https://github.com/better-auth/better-auth/commit/7544b950cfbb9a6db4c513f2778ef5011a8f06f9) Merge branch 'better-auth:main' into drizzle-sqlite - [`856a15b`](https://github.com/better-auth/better-auth/commit/856a15bb9c05fde551d2dd4235468047b0eeac7e) Merge branch 'better-auth:main' into drizzle-sqlite - [`89e00a8`](https://github.com/better-auth/better-auth/commit/89e00a89c6bc139a85dafaa6fc71fd48e31a3afa) Merge branch 'better-auth:main' into drizzle-sqlite - [`df20d14`](https://github.com/better-auth/better-auth/commit/df20d14c75259f4e1a9058a844421ff601f9c962) Merge branch 'better-auth:main' into drizzle-sqlite - [`5e6c780`](https://github.com/better-auth/better-auth/commit/5e6c780e14c8459357b4ce92c65cf5b797b6637f) Merge branch 'better-auth:main' into drizzle-sqlite ### 📊 Changes **1 file changed** (+33 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/adapters/drizzle-adapter/drizzle-adapter.ts` (+33 -2) </details> ### 📄 Description Not sure whether this is considered a fix or a new feature, depending on whether better-auth officially supports sqlite via `drizzle-adapter`. In this configuration, authentication does not work. Inserting into verifications currently fails with: > D1_TYPE_ERROR: Type 'object' not supported for value… The the dates are passed as objects (not supported in D1) instead of strings ([supported in D1](https://developers.cloudflare.com/d1/worker-api/#type-conversion)). This pull request resolves the issue, and perhaps enables `sqlite` via `drizzle-adapter` more generally. It is based on existing transformations in [kysely-adapter](https://github.com/better-auth/better-auth/blob/03fb6b2dfaf559011863e4fb603ed175b3b0af84/packages/better-auth/src/adapters/kysely-adapter/kysely-adapter.ts#L33), and is intended to match existing code. --- <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:09:23 -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#12065