Replies: 1 comment
-
Regarding field validation, the current plan is to integrate zod. Validations are expressed as field-level attributes and converted to First batch of validation attributes to add are: string:
number:
Sample usage: model User {
id String @id
handle String @regex("^[0-9a-zA-Z]{4,16}$")
email String @email @endsWith("@myorg.com")
profileImage String? @url
age Int @gt(0)
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Here's the current road map for the next two minor versions.
v0.4.0
Allows attaching validation rules at field level, executed on both client and server sides.
Simplifies dependency management and update.
Useful for scenarios like when query parameters haven't been fully constructed yet.
v0.5.0
E.g., contains, regex, etc.
For validating entities after update happens.
For easier usage analytics and prioritization.
E.g., auto-completion when accessing members of a field.
More complete checking and better error reporting.
Beta Was this translation helpful? Give feedback.
All reactions