Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

FeatureRequest: include associations #57

Open
ebasley opened this issue Nov 22, 2012 · 0 comments
Open

FeatureRequest: include associations #57

ebasley opened this issue Nov 22, 2012 · 0 comments
Assignees

Comments

@ebasley
Copy link

ebasley commented Nov 22, 2012

Is there a solution to include associations in a query on a model , like with :include within Activerecord in rails ?

Ex :

var A = patio.addModel('a');
var B = patio.addModel(''b').oneToOne(''a');

B.filter({id: [1,2,3,4,5]}).include(['a']).all(function(b){b.a)})

should produce :

select * from b where id in (1,2,3,4,5)
select * from a where b_id in (b_id1, b_id2, b_id3, ...)

eager load is close to the point but will produce many requests (5 here)

Any existing solution or help to dev it ?

thanks for your very good job

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants