2 Replies
Hi @Bruno Njeru. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Currently, Wasp does not natively support importing or using Prisma enum types directly from the Prisma schema in your Wasp code. This is a known limitation and is being tracked as a feature request by the Wasp team. There is no official way to define or import Prisma enums in Wasp at this time, and users have requested this feature for better type safety and schema expressiveness.
As a workaround, some community members have used custom seeder functions with raw SQL to create enums directly in the database, but this is considered a hack and not an officially supported solution. The Wasp team has indicated that full support for Prisma features like enums is planned for a future release, but it is not available yet. Until then, you cannot import or use enum types from your Prisma schema in Wasp code in a straightforward or supported way Discord: Prisma Enum Github Issue: Expand our Prisma support.
If you need enum support, you will need to wait for an upcoming Wasp release that includes this feature.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Bruno Njeru, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?
Here's a page in the docs: https://wasp.sh/docs/data-model/prisma-file#how-to-use-enums-in-your-code
Prisma Schema File | Wasp
Wasp uses Prisma to interact with the database. Prisma is a "Next-generation Node.js and TypeScript ORM" that provides a type-safe API for working with your database.