Deriving all optional field struct for partial / optional fields selects #2520
Unanswered
kriswuollett
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The current partial model / optional fields features do not directly support dynamic field masking, because needing to define a struct for each combination is not practical. A commonly used pattern in some systems is field masking, e.g., with the protobuf field masks.
I'm trying to use both the
struct_patch
or optfield to get a struct with all options that do not rewrap any existing options, but getting what seems to be a macro interaction/ordering error forDerivePartialModel
for which I'll post a PR example soon:More or less the entity struct looks like:
Hopefully this is just an error on my part and wouldn't actually require macro changes in
sea-orm
?I know it is probably possible through
JsonValue
as a work around, but doesn't seem like it should be necessary go through that route.Beta Was this translation helpful? Give feedback.
All reactions