schema validation enforcement
The above schema is nice and well - but how can I enforce that
email
actually only allows to store strings that are emails?
So I looked at drizzle-zod
but it looks like I would have to define the schema twice?
There is no way to attach this to the table schema itself?
What about using postgres constraints?
https://www.postgresql.org/docs/current/ddl-constraints.htmlPostgreSQL Documentation
5.4. Constraints
5.4. Constraints # 5.4.1. Check Constraints 5.4.2. Not-Null Constraints 5.4.3. Unique Constraints 5.4.4. Primary Keys 5.4.5. Foreign Keys 5.4.6. Exclusion Constraints …
0 Replies