Skip to content

Can you do two levels of includes? #12

@nickretallack

Description

@nickretallack

Lets say I'm doing a many through, and I want the results from the join table as well. It could be a many on the first relationship and a one on the second, and result in something like this:

User = {name:'Fred', 'friendships': [{'user':{name:'Bob'}, confirmed:True}, {'user':{name:'George'}, confirmed:False}]}

Given tables like:

create table user (int id primary key, text name)
create table friendship (int sender_id references user, int receiver_id references user, bool confirmed) 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions