Replies: 1 comment 1 reply
-
My initial thought on this is to use proto 3 Wrapper types instead of primitives for fields that are Nillable and then to check for presence before invoking the ent |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary 💡
Currently
protoc-gen-entgrpc
does not consider zero/nil values in the generatedCreate
andUpdate
methods.For example, the
Create
method will Set all available fields:If for example, the
Joined
field has a default value, the user has no way to pass a nil/zero value to let ent use the default for the field.In addition, if the calling user does not set a Group with a valid ID, the generated code will execute .SetGroupId(0), which will cause the insert to fail on a foreign key constraint, since no Group with ID zero exists.
Beta Was this translation helpful? Give feedback.
All reactions