We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have no idea why, but adding plugin @core/enhancer breaks validation checks for @core/zod plugin
in the following schema, ^[a-zA-Z0-9_]{3,30}$ regex validation would correctly take place on User.name:
^[a-zA-Z0-9_]{3,30}$
User.name
generator client { provider = "prisma-client-js" } datasource db { provider = "postgresql" url = env("DATABASE_URL") } plugin hooks { provider = '@zenstackhq/tanstack-query' target = 'react' version = 'v5' output = 'src/hooks/generated' } plugin zod { provider = '@core/zod' } model User extends Base { name String @unique @regex('^[a-zA-Z0-9_]{3,30}$') @@allow('read', true) }
surprisingly enough, adding plugin enhancer plugin to the previous schema would result in @regex validation on User.name to be completely ignored:
plugin enhancer
@regex
generator client { provider = "prisma-client-js" } datasource db { provider = "postgresql" url = env("DATABASE_URL") } plugin hooks { provider = '@zenstackhq/tanstack-query' target = 'react' version = 'v5' output = 'src/hooks/generated' } plugin zod { provider = '@core/zod' } plugin enhancer { provider = '@core/enhancer' generatePermissionChecker = true } abstract model Base { id String @id @default(uuid()) createdAt DateTime @default(now()) updatedAt DateTime @updatedAt() // require login @@allow('all', true) } model User extends Base { name String @unique @regex('^[a-zA-Z0-9_]{3,30}$') @@allow('read', true) }
also tried to move around the enhancer plugin to check if its order related issue, it's not.
The text was updated successfully, but these errors were encountered:
Thanks for reporting this @tmax22 ! I've identified the issue and will make a fix in v2.4.
Sorry, something went wrong.
No branches or pull requests
I have no idea why, but adding plugin @core/enhancer breaks validation checks for @core/zod plugin
✅ Good
in the following schema,
^[a-zA-Z0-9_]{3,30}$
regex validation would correctly take place onUser.name
:❌ Bad
surprisingly enough, adding
plugin enhancer
plugin to the previous schema would result in@regex
validation onUser.name
to be completely ignored:also tried to move around the enhancer plugin to check if its order related issue, it's not.
The text was updated successfully, but these errors were encountered: