Skip to content

Eager loading of many-many associations#834

Merged
sdepold merged 7 commits intosequelize:masterfrom
lemon-tree:eagermany
Aug 17, 2013
Merged

Eager loading of many-many associations#834
sdepold merged 7 commits intosequelize:masterfrom
lemon-tree:eagermany

Conversation

@lemon-tree
Copy link
Copy Markdown
Contributor

These commits add support for eager loading of many-many associations through a junctionTable on all three dialects, which is achieved by performing the expected two joins. See the new test code for an example, it's essentially the same as any other include.

It doesn't have support for non-standard named primary keys, but that should be possible with a couple of tweaks. There's also probably some cleaning up to be done, but that can be sorted before merging and once some others have confirmed it is a viable solution.

Also, this fixes a bug whereby only one many-many association direction had the foreignIdentifier property defined properly. Now both directions have the correct properties.

@sdepold
Copy link
Copy Markdown
Member

sdepold commented Aug 17, 2013

fucking awesome !

@sdepold sdepold merged commit f2bcc28 into sequelize:master Aug 17, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants