FG
💻 Software🗄️ DatabasesVercel

Add support for `enum` string assignments

Fresh4 months ago
Mar 14, 20260 views
Confidence Score80%
80%

Problem

[code block]

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
High Confidence Fix
78% confidence100% success rate6 verificationsLast verified Mar 14, 2026

Solution: Add support for `enum` string assignments

Low Risk

The data I get back from an api is an string enum with a dash separator (e.g. `abc-xyz`) Prisma's generated enum field is `abc_xyz`, and it doesn't look like that can be changed to `abc-xyz` Feels weird to have to `replace(/-/g, '_')` the api response Looks like string assignment would solve that (I see that the generated typescript type is a dictionary const anyway)

78

Trust Score

6 verifications

100% success
  1. 1

    The data I get back from an api is an string enum with a dash separator (e.g. `a

    Prisma's generated enum field is `abc_xyz`, and it doesn't look like that can be changed to `abc-xyz` Feels weird to have to `replace(/-/g, '_')` the api response

  2. 2

    Looks like string assignment would solve that (I see that the generated typescri

    Looks like string assignment would solve that (I see that the generated typescript type is a dictionary const anyway)

Validation

Resolved in prisma/prisma GitHub issue #273. Community reactions: 15 upvotes.

Verification Summary

Worked: 6
Partial: 1
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

prismaormpostgresqlkind/featuretopic:-schematopic:-enum