[PR #6844] [MERGED] docs: change role type from string to enum values #15164

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6844
Author: @bennettdams
Created: 12/18/2025
Status: Merged
Merged: 12/18/2025
Merged by: @himself65

Base: canaryHead: patch-2


📝 Commits (1)

  • 37ae4ea docs: Change role type from string to enum values

📊 Changes

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

View changed files

📝 docs/content/docs/concepts/database.mdx (+1 -1)

📄 Description

The example for the additional "role" field now uses an array instead of a raw string. This comes very handy when one is already using an enum-like DB schema (like pgEnum) and Drizzle for better type inference.

By the way, I found out that this is allowed by accident from this test, so I am not even sure that this is the intended usage.

https://github.com/better-auth/better-auth/pull/5287/files#diff-b98623fbecefef5313e8c1fe082f4895ee707cea0183c5cf4f860942cf3d0e3e


Summary by cubic

Update database docs to define the user role additional field as enum values (["user", "admin"]) instead of a generic "string". This clarifies supported types and aligns with enum-backed schemas (e.g., pgEnum) for better Drizzle type inference.

Written for commit 37ae4ea659. Summary will update automatically 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/6844 **Author:** [@bennettdams](https://github.com/bennettdams) **Created:** 12/18/2025 **Status:** ✅ Merged **Merged:** 12/18/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `patch-2` --- ### 📝 Commits (1) - [`37ae4ea`](https://github.com/better-auth/better-auth/commit/37ae4ea6596b003a577bbbc0c8ae3bfce2c2457c) docs: Change role type from string to enum values ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/concepts/database.mdx` (+1 -1) </details> ### 📄 Description The example for the additional "role" field now uses an array instead of a raw string. This comes very handy when one is already using an enum-like DB schema (like `pgEnum`) and Drizzle for better type inference. By the way, I found out that this is allowed by accident from this test, so I am not even sure that this is the intended usage. https://github.com/better-auth/better-auth/pull/5287/files#diff-b98623fbecefef5313e8c1fe082f4895ee707cea0183c5cf4f860942cf3d0e3e <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Update database docs to define the user role additional field as enum values (["user", "admin"]) instead of a generic "string". This clarifies supported types and aligns with enum-backed schemas (e.g., pgEnum) for better Drizzle type inference. <sup>Written for commit 37ae4ea6596b003a577bbbc0c8ae3bfce2c2457c. Summary will update automatically 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-04-13 09:51:48 -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#15164