enum @map value
I have this enum mapping but it doesn't generate the same value instead it uses the key as the value.
6 Replies
GitHub
Use @map'ed enum values as TS enum values · Issue #8446 · prisma/pr...
Problem Consider the following schema: model Payment { id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid amount Decimal @db.Decimal(14, 2) provider PaymentProvider created...
still has no updates about this issue.. or will this going to be abandoned?
GitHub
feat(client): [breaking] use enum "@map" values as JS/TS values by ...
DRAFT, still experimental.
This PR contributes to #8446 and #273,
and it depends on its companion PR prisma/prisma-engines#4987.
This PR introduces a breaking change, let's wait for Prisma 6.
I tried using this and it works as what my enum would generate.
I hope the pr will be accepted,. for now i just patch the prisma with this pr..
Thanks for linking the PR. It will be accepted as the PR is from our ORM engineering team 🙂
At the moment, the behaviour you are observing is intentional.
Considering this is a breaking change, the plan is to have it in next major Prisma release i.e. Prisma 6
nice ❤️
I just notice when trying to insert data to db, it still using the
enum
key instead of the value of @map
.. maybe because of the pr on prisma-engines
that still not merge yet..
anyways, I will just wait for prisma 6 release!