-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Loading Relations #47
Comments
Yes, I'd like to definitely implement that at some point, just don't know when (other stuff on my hands right now). If you want to help out - pull requests are always appreciated. |
I am working on this right now. I'll post a gist soon of how I am going to accomplish this so that I can get feedback. It is actually quite simple, you just need to alias all the columns in the SELECT with the tablename.column. We could either transfer the column and container values into a map using the aliases as the key before mapping to the types or find a cleaner way. I have also added FK contraints when you run CreateTable for hood. Give me a couple days and I will have the basics for joining one to one and one to many relationships up on a gist. |
@eaigner @crosbymichael any update on this? Very much desired (although what I need -- eager loading a bunch of records -- might be more compolicated than a single belongs_to relationship.). In Rails / ActiveRecord, you can do: User.where(...).all(include: {account: :subscription}) This lets you get a bunch of records with minimal SQL. |
+1 |
I'm sorry, but I'm currently not longer actively maintaining hood (moved on to jet for more flexibility). If anyone want's to jump in, I can add you as a contributor. |
Nobody add support? |
I'm just curious if you were planning to handle loading of relations at any point?
e.g. If a User has an associated Account, would you say it should be represented as:
and it's up to the user to select it separately when they want?
The text was updated successfully, but these errors were encountered: