Titanium JIRA Archive
Alloy (ALOY)

[ALOY-458] Alloy sql sync adapter to execute queries on fetch()

GitHub Issuen/a
TypeImprovement
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2014-08-06T22:53:47.000+0000
Affected Version/sn/a
Fix Version/sAlloy 0.3.5, 2013 Sprint 02
ComponentsRuntime
Labelsnotable, qe-Alloy, qe-manualtest
ReporterTony Lukasavage
AssigneeTony Lukasavage
Created2013-01-14T11:37:47.000+0000
Updated2014-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.

Comments

  1. Tony Lukasavage 2013-01-17

    test app: https://github.com/appcelerator/alloy/tree/master/test/apps/models/sql_queries
  2. Federico Casali 2013-01-26

    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.

JSON Source