[ALOY-718] ALLOY: SQL sync adapter should not require knowledge of the table name
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Low |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Models, Runtime |
Labels | alloy, sqlite |
Reporter | Neville Dastur |
Assignee | Unknown |
Created | 2013-06-21T15:21:43.000+0000 |
Updated | 2018-03-07T22:26:07.000+0000 |
Description
The query that is passed to fetch() when using the sql sync adapter requires the table name to be specified. The example in Git https://github.com/appcelerator/alloy/blob/master/test/apps/models/sql_queries/controllers/main.js highlights the issue.
So the collection is called color, but the table name is colors.
It would be better if the table name could be replaced with a place holder in the string e.g. {tablename} or if the sql string does not start with SELECT then a SELECT * FROM is pre-pended.
Alternatively, expose the tablename as a property of the Alloy Collection
No comments