Questions about more complex scenarios #1139
Unanswered
frederikhors
asked this question in
Q&A
Replies: 3 comments 9 replies
-
|
@frederikhors hello! I think you need something like this: #739 |
Beta Was this translation helpful? Give feedback.
4 replies
-
|
Hey @frederikhors, I think this article explains the limitation of Rust regarding selecting complex relations. We're considering a data loader approach in SeaORM which is capable to select nested relation in batch. CC @tyt2y3 |
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
Uh oh!
There was an error while loading. Please reload this page.
-
I have a project with these models and relations:
This is an example, of course, but as you can see I can have on table
Playerateam_idcolumn as FK (Foreign Key) forTeamwhich hascoach_idcolumn as FK forCoachtable.In my Golang backend I'm using an ORM that allows you to (generate and) use this kind of code:
Starting with Rust I was fascinated by SeaORM but now that I'm trying to create something more complex I have realized that I cannot do things like in Go.
I'm generating entities using
sea-orm-clifrom my Postgresql DB created using SeaORM Migrator (this is totally optional, you can also write the following code by yourself).The generated entities are like this:
And I'm using code like:
I'd like to know what you think of this mental order.
Most likely I need to change it because the code is really ugly (as well as expensive for the many SQL queries and allocations) and inconvenient to use to scale with even more complexity.
What do you recommend?
Beta Was this translation helpful? Give feedback.
All reactions