Adding support for flatten
attribute
#1844
Unanswered
heroin-moose
asked this question in
Q&A
Replies: 2 comments 6 replies
-
Imho, supporting prefixes like this is essential for the flattened structs sql returns. |
Beta Was this translation helpful? Give feedback.
1 reply
-
@heroin-moose |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi guys,
I'm currently hacking up a
flatten
attribute similar to serde. The basic case is simple and works with a trivial patch, so this:gets converted to this:
So far so good. However, I also want to support a little bit more complex scenarios, like this:
I want all columns starting with "foo_" to be translated into
Foo
without the prefix. Of course, in this scenario therename
attribute can be added manually for each child structure field, but IMO the attribute parameter has two advantages:Unfortunately this requires passing the attribute parameter from the field level of the parent structure to the container level of the child structure. And this is a completely uncharted territory for me, because I haven't seen anyone doing this and I'm starting to think that maybe it's not possible at all. Maybe someone can share some thoughts?
Beta Was this translation helpful? Give feedback.
All reactions