What I was proposing wouldn’t incur any query overhead. This is all absolutely academic at this point but what I was proposing a wrapper could do is something like the following:
Let’s say your schema is that a Shot is linked to a Sequence and a sequence has a string attribute called the prefix. You’d like to query the Shot and have it return the Sequence but you’d also like to have the prefix attribute for the Sequence.
Normally you’d do:
sg.find_one('Shot', [['id', 'is', <id>]], ['sg_sequence', 'sg_sequence.Sequence.sg_prefix'])
And you’d get
{'type':'Shot', 'id':<id>, 'sg_sequence':{'type':'Sequence', 'id':<id>, 'name':'SeqName'}, 'sg_sequence.Sequence.sg_prefix':'some_prefix'}
Now, you could have a wrapper that would accept the following call:
wrapper.find_one('Shot', [['id', 'is', <id>]], ['sg_sequence.Sequence.sg_prefix'])
And that, by virtue of having sg_sequence.Sequence.sg_prefix
in the return fields, it would add sg_sequence
resulting in the same thing as our first call.
Then, when the return payload comes in, the wrapper would reformat the payload like so before returning to the caller:
{'type':'Shot', 'id':<id>, 'sg_sequence':{'type':'Sequence', 'id':<id>, 'name':'SeqName', 'sg_prefix':'some_prefix'}}
The wrapper basically takes the bubbled information and moves it into the actual entity hash.
Now this is just a thought experiment and the value proposition might not be enough to be worth the trouble implementing it. Not to mention that because this isn’t like asking the API to return “by default” some specified fields when an entity hash is returned, you still don’t have an eloquent way to deal with multi-entity links.
Anyway… I’m just digging the conversation. Have a great day!