DS.Adapter#findQuery should be able to give the store ids only #64

Closed
pixelcort opened this Issue Jan 24, 2012 · 5 comments

3 participants

@pixelcort

Currently, DS.Adapter#findQuery has to give the modelArray.load an array of hashes of all the returned data.

In addition, it should be possible to tell the modelArray or the store only the ids of the records returned.

Then, the modelArray would lazy load the actual model instances upon DS.ModelArray#objectAtContent.

This was possible in SC.DataSource by only returning storeKeys back to the store.

@pixelcort

Workaround might be to use DS.Store#pushHash(undefined, id, type) to get clientId for each id, set the DS.AdapterPopulatedModelArray's content to an array of these clientIds, and set the DS.AdapterPopulatedModelArray's isLoaded to true.

@wycats
Ember.js member

In Ember, the clientId is an internal construct only. I assume you want the ability to push server IDs, which would immediately be converted into clientIds as you describe above by the ModelArray?

@pixelcort

@wycats correct. My server would return an array of server primaryKeys for the result, which I would like to pass on to the store or model instance.

A bonus would be, if and when #90 is implemented, to return pairs of types and primaryKeys to populate the DS.AdapterPopulatedModelArray with just a bunch of type/primaryKey pairs that could then be lazy-loaded later.

@wagenet
Ember.js member

@wycats, do you think we'll actually implement this? If not, we should close.

@wycats wycats was assigned Aug 9, 2013
@wycats
Ember.js member

This probably will be done more generically when we support partial records (in this case, the partial records are just the IDs). Should be fine to close.

@wycats wycats closed this Aug 9, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment