Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Is there support for Prisma Models? #215

Open
RobertCharron opened this issue Dec 21, 2021 · 1 comment
Open

Question: Is there support for Prisma Models? #215

RobertCharron opened this issue Dec 21, 2021 · 1 comment

Comments

@RobertCharron
Copy link

I recently changed from TypeORM to prisma, and am wondering if there is a way to get my existing project using Nest-CASL to work with Prisma. At the moment I receive an error because Prisma models are a type, not a class.

image

@liquidautumn
Copy link
Collaborator

Subject it is required to be class down in @casl/ability, but with Prisma you have schema as a source of truth, so you can generate whatever you need. Check https://github.com/vegardit/prisma-generator-nestjs-dto for example or pick one of generators from https://www.prisma.io/docs/concepts/components/prisma-schema/generators

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants