[ALOY-458] Alloy sql sync adapter to execute queries on fetch()
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-08-06T22:53:47.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Alloy 0.3.5, 2013 Sprint 02 |
Components | Runtime |
Labels | notable, qe-Alloy, qe-manualtest |
Reporter | Tony Lukasavage |
Assignee | Tony Lukasavage |
Created | 2013-01-14T11:37:47.000+0000 |
Updated | 2014-08-06T22:53:47.000+0000 |
Description
By default, alloy will
collection.fetch()
from a sql adapter using this query:
SELECT * FROM table
Where **table** is the name of the table associated with the model/collection. Using a collection, a developer will now be able to do a fetch() based on a custom query, like this:
collection.fetch({
query: 'SELECT * FROM table WHERE someField > 10;'
});
The developer can put any arbitrary query in the **query** property of the **opts** object passed in to the fetch() function. That queried is assumed to be executed on the database associated with the given model/collection.
test app: https://github.com/appcelerator/alloy/tree/master/test/apps/models/sql_queries
Verified fixed also on 1_0_X master branch android device: 4.2 iPhone devices: iPhone 6 and iPad 4.3.5 TiSDK: 3.0.2.v20130124164131 CLI: 3.0.23 Closing.