[PR #5904] feat(prisma): enhance JSON default value handling for arrays and objects in schema generation #14557

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

Original Pull Request: https://github.com/better-auth/better-auth/pull/5904

State: closed
Merged: Yes


solves #5900

Added objects and arrays compatibility for default JSON values with test cases

The default string value is not sorted for mysql ,but will be soon be done with the #5866 PR


Summary by cubic

Adds support for JSON default values for arrays and objects in Prisma schema generation. This outputs correct @default strings with proper escaping and handles empty arrays and objects.

  • New Features
    • JSON defaults for arrays and objects are serialized and escaped in @default.
    • Empty defaults map to default([]) and default("{}").
    • Array defaults supported for string[] and number[] fields.
    • Expanded DBPrimitive to include objects and arrays; added tests for these cases.

Written for commit bfac068875. Summary will update automatically on new commits.

**Original Pull Request:** https://github.com/better-auth/better-auth/pull/5904 **State:** closed **Merged:** Yes --- **solves #5900** ### Added objects and arrays compatibility for default JSON values with test cases The default string value is not sorted for **mysql** ,but will be soon be done with the #5866 PR <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Adds support for JSON default values for arrays and objects in Prisma schema generation. This outputs correct @default strings with proper escaping and handles empty arrays and objects. - **New Features** - JSON defaults for arrays and objects are serialized and escaped in @default. - Empty defaults map to default([]) and default("{}"). - Array defaults supported for string[] and number[] fields. - Expanded DBPrimitive to include objects and arrays; added tests for these cases. <sup>Written for commit bfac068875eb8bd1fa7d9f87158a21699de8e518. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. -->
GiteaMirror added the pull-request label 2026-04-13 09:31:41 -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#14557