Recommended Pattern for Joining Tables and Producing Nested Structs #3394
-
I've been following the (absolutely fantastic) realword-axum-sqlx guide, and there's an interesting pattern I noticed here. Essentially, we create a Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
We used that pattern quite a lot internally. There's nothing really wrong with it besides the amount of boilerplate. At the end of the day, SQL just doesn't have great support for returning complex structured data in a way we can reliably typecheck, so needing a transformation step is understandable. Making the query macros work with |
Beta Was this translation helpful? Give feedback.
We used that pattern quite a lot internally. There's nothing really wrong with it besides the amount of boilerplate.
At the end of the day, SQL just doesn't have great support for returning complex structured data in a way we can reliably typecheck, so needing a transformation step is understandable.
Making the query macros work with
FromRow
and theflatten
attribute would improve the situation, that's discussed in #514.