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

FeatureRequest: include associations #57

@ebasley

Description

@ebasley

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions