User table support for Postgres Not Enough (JSON) #1208

Closed
opened 2026-03-13 08:28:14 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @MarkLee425 on GitHub (May 16, 2025).

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

For example, I have a column with type of JSONB but it cannot be set as additional fields in table, since the types of fields are hardcoded as string | string[] | boolean | date | number | number[].

Current vs. Expected behavior

For additional fields in tables, there are only string | string[] | boolean | date | number | number[]. But there is no jsonb or json or other like timestamps, enum, geometric types etc.

Expected behavior:
It supports jsonb or json or other like timestamps, enum, geometric types etc typically for Postgres. For further more types, please check the postgres data types in official website.
We can check if user database is instance of Postgresql or Kysely PostgresJSDialect.

What version of Better Auth are you using?

1.2.7

Provide environment information

- OS: [MacOS 15.5]
- Browser: [Chrome]

Which area(s) are affected? (Select all that apply)

Types, Backend, Documentation

Auth config (if applicable)

import { betterAuth } from "better-auth"
export const auth = betterAuth({
  user: {
		modelName: 'user',
		fields: {
			name: 'display_name',
			email: 'email_address',
			createdAt: 'created_at',
			updatedAt: 'updated_at',
		},
        additionalFields: {
            user_id: {
                type: 'json', // Type '"json"' is not assignable to type 'FieldType'
            }
        }
	}
});

Additional context

No response

Originally created by @MarkLee425 on GitHub (May 16, 2025). ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce For example, I have a column with type of JSONB but it cannot be set as additional fields in table, since the types of fields are hardcoded as string | string[] | boolean | date | number | number[]. ### Current vs. Expected behavior For additional fields in tables, there are only string | string[] | boolean | date | number | number[]. But there is no jsonb or json or other like timestamps, enum, geometric types etc. Expected behavior: It supports jsonb or json or other like timestamps, enum, geometric types etc typically for Postgres. For further more types, please check the postgres data types in official website. We can check if user database is instance of Postgresql or Kysely PostgresJSDialect. ### What version of Better Auth are you using? 1.2.7 ### Provide environment information ```bash - OS: [MacOS 15.5] - Browser: [Chrome] ``` ### Which area(s) are affected? (Select all that apply) Types, Backend, Documentation ### Auth config (if applicable) ```typescript import { betterAuth } from "better-auth" export const auth = betterAuth({ user: { modelName: 'user', fields: { name: 'display_name', email: 'email_address', createdAt: 'created_at', updatedAt: 'updated_at', }, additionalFields: { user_id: { type: 'json', // Type '"json"' is not assignable to type 'FieldType' } } } }); ``` ### Additional context _No response_
Author
Owner

@dosubot[bot] commented on GitHub (Aug 15, 2025):

Hi, @MarkLee425. I'm Dosu, and I'm helping the better-auth team manage their backlog and am marking this issue as stale.

Issue Summary

  • You requested support for additional PostgreSQL-specific data types (JSONB, JSON, timestamps, enums, geometric types) in the user table's additional fields.
  • You suggested implementing database detection to enable these types only when using PostgreSQL.
  • There has been no activity or comments on this feature request since it was opened.
  • The issue remains unresolved and no progress has been made toward a solution.

Next Steps

  • Please let me know if this feature request is still relevant to the latest version of better-auth by commenting on this issue.
  • If I do not hear back within 7 days, I will automatically close this issue.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Aug 15, 2025): Hi, @MarkLee425. I'm [Dosu](https://dosu.dev), and I'm helping the better-auth team manage their backlog and am marking this issue as stale. **Issue Summary** - You requested support for additional PostgreSQL-specific data types (JSONB, JSON, timestamps, enums, geometric types) in the user table's additional fields. - You suggested implementing database detection to enable these types only when using PostgreSQL. - There has been no activity or comments on this feature request since it was opened. - The issue remains unresolved and no progress has been made toward a solution. **Next Steps** - Please let me know if this feature request is still relevant to the latest version of better-auth by commenting on this issue. - If I do not hear back within 7 days, I will automatically close this issue. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#1208