You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After defining fields with assert when the wrong value is inserted it returns Surreal db error. I want to specify a specific error message for each of the fields submitted that failed the assertion rule.
Describe the solution
When defining a field with a define command there is an option to add an assertion rule with the assert keyword. While this feature works fine there is an issue in specifying a custom error message when the assertion failed when a user created or updated a field.
so if we could add an optional message keyword to specify what the custom error should look like on every asserting it would really be great for the user experience and for not doing things multiple times.
here is an example script:
DEFINE FIELD email ON TABLE user TYPE string ASSERT string::is::email($value) message "Email should be valid!";
Is your feature request related to a problem?
After defining fields with assert when the wrong value is inserted it returns Surreal db error. I want to specify a specific error message for each of the fields submitted that failed the assertion rule.
Describe the solution
When defining a field with a define command there is an option to add an assertion rule with the assert keyword. While this feature works fine there is an issue in specifying a custom error message when the assertion failed when a user created or updated a field.
so if we could add an optional message keyword to specify what the custom error should look like on every asserting it would really be great for the user experience and for not doing things multiple times.
here is an example script:
DEFINE FIELD email ON TABLE user TYPE string ASSERT string::is::email($value) message "Email should be valid!";
Alternative methods
I currently have no alternative methods.
SurrealDB version
1.4.0 for linux on x86_64
Contact Details
henokmengistu5@gmail.com
Is there an existing issue for this?
Code of Conduct
The text was updated successfully, but these errors were encountered: