Making a column only allow letters and characters, including capitals
I am using Yup for my validation on the client side. For example the username field does this:
My user schema on the drizzle side is:
Just wondering is there a way to add the regex to it? Thanks
2 Replies
You could potentially use a CHECK constraint if you want it validated on a database level, though that's not currently implemented in drizzle directly
If you're just looking for serverside validation though, typically you'd do that before you even make a request to your database (some frameworks provide a built-in way to do request validation, or you may chose to use zod or similar)
Yeah i'm just validating it on the backend via yup, was just wondering if I could do it on the database side also. Thanks