How to retrieve struct with nested structs with sqlx and Rust? #2292
Unanswered
frederikhors
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
-
I'm trying to use Rust and sqlx (v0.6.2) to retrieve from DB structs with nested structs.
I tried using the below code but I found out that there is a limit of 9 fields in tuple that I can use with
FromRow
.Note:
As you can see I'm using a
Box<T>
for struct fields.The error is:
I can use whatever SQL query the method needs.
I can return tuple from DB or single columns, I don't care. I only need a way to query with sqlx structs with nested
Box<Struct>
and I cannot understand how.How can I retrieve these structs?
Beta Was this translation helpful? Give feedback.
All reactions