How to check schema fields against a regex?
I want to restrict the usernames in my user table with a regex. Basically instagram like criteria for usernames.
This is my current schema:
Is there any method that I can call on this to restrict the username? Something like this:
I know that's nonsense code above, but I'm just trying to convey myself. please don't mind 😅
2 Replies
I think you would be better off with a validation library like zod.
Okay