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
Describe the bug
There should be a setting to force non-nullability of all parameters, and make nullability possibly opt in with the ? suffix. I don't really see the use case of nullability, but it has bit me in the back a few times so far because i forget to att the ! suffix.
Hi, thanks!
Unfortunately, Postgres doesn't provide nullability information on parameter types, so we have to assume all parameters to be nullable by default.
This is not entirely true. We can also just assume they are not nullable. It would be less wrong imo. If you are not sure if something is nullable, better not assume it is.
The text was updated successfully, but these errors were encountered:
Wait, I'm even more confused now. How come i cannot pass null into a field which has the ! suffix? Does ! both mean that it has to be specified, and that it cannot be NULL? What if I want to force a field to be specified, but allow it to be null?
What if I want to force a field to be specified, but allow it to be null?
Yeah, annoyingly things are marked as optional if they're allowed to be null. I've opened a PR to allow toggling the default behaviour of optional parameters here #582 .
I do think there should be an option to make parameters not nullable by default too though!
Describe the bug
There should be a setting to force non-nullability of all parameters, and make nullability possibly opt in with the
?
suffix. I don't really see the use case of nullability, but it has bit me in the back a few times so far because i forget to att the!
suffix.See also #583 #118
#118 (comment)
This is not entirely true. We can also just assume they are not nullable. It would be less wrong imo. If you are not sure if something is nullable, better not assume it is.
The text was updated successfully, but these errors were encountered: