This is purely conceptual at this point but I would love to have this feature. It would be similar to TrimQuery but be based on Ext Stores. I would love to be able to do this:
var joinedStore = new Ext.data.QueryStore({ query: "SELECT p1.name as parentName, p2.name as childName, IF(p1.id=1,'parent','child') as relationshipType "+ "FROM relationship r "+ "JOIN people p1 ON (r.parentId = p1.id) "+ "JOIN people p2 ON (r.childId = p2.id) "+ "WHERE p1.id = 1 OR p2.id = 1" }); |
[Edit]
Let me preface this with the fact that this is NOT server side SQL. This SQL never gets sent to the server. This is a very simple client side implementation that is only used for joining together data from multiple stores into an intermediary store which is useful for displaying grids that don’t match your server side data model. It saves you from having to create one-off data providers for these grids and having to migrate changes to your other stores by hand.
[/Edit]
Continue reading ‘ExtJS - QueryStore & Store Query Language’