[PR #4297] [MERGED] feat: add json field type #5299

Closed
opened 2026-03-13 12:17:37 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/4297
Author: @dvanmali
Created: 8/29/2025
Status: Merged
Merged: 9/2/2025
Merged by: @himself65

Base: canaryHead: jsonFieldType


📝 Commits (4)

  • d809129 feat: add json field type
  • 068e131 style: lintfix
  • 2a767b4 feat: cubic-dev suggestions
  • 4e63401 fix: zodv4 uses ZodType instead of ZodSchema

📊 Changes

5 files changed (+26 additions, -20 deletions)

View changed files

📝 packages/better-auth/src/adapters/create-adapter/index.ts (+0 -2)
📝 packages/better-auth/src/adapters/create-adapter/test/create-adapter.test.ts (+0 -2)
📝 packages/better-auth/src/db/field.ts (+4 -3)
📝 packages/better-auth/src/db/get-migration.ts (+10 -0)
📝 packages/better-auth/src/db/to-zod.ts (+12 -13)

📄 Description

Support for json was already supported and tested in the adapter but not made an official fieldType.

Partial: #4237


Summary by cubic

Adds 'json' as an official field type across the DB schema, migrations, and Zod schema generation, formalizing existing adapter support. Partial for Linear #4237.

  • New Features
    • Added 'json' to FieldType and Zod generation (uses z.json()).
    • Mapped JSON to native types for Postgres, MySQL, SQLite, and MSSQL in migration tooling.

🔄 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/4297 **Author:** [@dvanmali](https://github.com/dvanmali) **Created:** 8/29/2025 **Status:** ✅ Merged **Merged:** 9/2/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `jsonFieldType` --- ### 📝 Commits (4) - [`d809129`](https://github.com/better-auth/better-auth/commit/d809129323390269a380eff0f82099879dc87b99) feat: add json field type - [`068e131`](https://github.com/better-auth/better-auth/commit/068e131e5aa85a2e6761f6035d0c3839cce3fcb0) style: lintfix - [`2a767b4`](https://github.com/better-auth/better-auth/commit/2a767b41081f7c8b5d2aa231cfcfd09a264517fb) feat: cubic-dev suggestions - [`4e63401`](https://github.com/better-auth/better-auth/commit/4e63401a8538f57f410d1cc83cbe76a21032753f) fix: zodv4 uses ZodType instead of ZodSchema ### 📊 Changes **5 files changed** (+26 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/adapters/create-adapter/index.ts` (+0 -2) 📝 `packages/better-auth/src/adapters/create-adapter/test/create-adapter.test.ts` (+0 -2) 📝 `packages/better-auth/src/db/field.ts` (+4 -3) 📝 `packages/better-auth/src/db/get-migration.ts` (+10 -0) 📝 `packages/better-auth/src/db/to-zod.ts` (+12 -13) </details> ### 📄 Description Support for json was already supported and tested in the adapter but not made an official fieldType. Partial: #4237 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Adds 'json' as an official field type across the DB schema, migrations, and Zod schema generation, formalizing existing adapter support. Partial for Linear #4237. - **New Features** - Added 'json' to FieldType and Zod generation (uses z.json()). - Mapped JSON to native types for Postgres, MySQL, SQLite, and MSSQL in migration tooling. <!-- 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 12:17:37 -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#5299