[GH-ISSUE #9091] Drizzle adapter: allow overriding supportsUUIDs on PostgreSQL for explicit user ids from hooks #28593

Closed
opened 2026-04-17 20:02:07 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @dakaii on GitHub (Apr 10, 2026).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/9091

Problem

On PostgreSQL the Drizzle adapter sets supportsUUIDs: true. The adapter factory then treats UUID ids as database-generated and input transforms can omit explicit id values on create, even when using forceAllowId. Apps that insert a related row in databaseHooks.user.create.before and must reuse the same UUID for ba_user.id need to pass supportsUUIDs: false.

Proposal

Add optional supportsUUIDs to DrizzleAdapterConfig, defaulting to current behavior: config.supportsUUIDs ?? (provider === "pg").

PR

See linked PR.

Originally created by @dakaii on GitHub (Apr 10, 2026). Original GitHub issue: https://github.com/better-auth/better-auth/issues/9091 ## Problem On PostgreSQL the Drizzle adapter sets `supportsUUIDs: true`. The adapter factory then treats UUID ids as database-generated and input transforms can omit explicit `id` values on `create`, even when using `forceAllowId`. Apps that insert a related row in `databaseHooks.user.create.before` and must reuse the same UUID for `ba_user.id` need to pass `supportsUUIDs: false`. ## Proposal Add optional `supportsUUIDs` to `DrizzleAdapterConfig`, defaulting to current behavior: `config.supportsUUIDs ?? (provider === "pg")`. ## PR See linked PR.
GiteaMirror added the database label 2026-04-17 20:02:07 -05:00
Author
Owner

@hrougier commented on GitHub (Apr 12, 2026):

Looks like a duplicate of #9056?

<!-- gh-comment-id:4230512970 --> @hrougier commented on GitHub (Apr 12, 2026): Looks like a duplicate of #9056?
Author
Owner

@dakaii commented on GitHub (Apr 13, 2026):

@hrougier oh right. #9056 might fix the bug I encountered. I'll close my PR.

<!-- gh-comment-id:4233508641 --> @dakaii commented on GitHub (Apr 13, 2026): @hrougier oh right. #9056 might fix the bug I encountered. I'll close my PR.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#28593