[ALOY-1116] sql sync adapter: optimize update method for adding/updating models
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Medium |
Status | Resolved |
Resolution | Fixed |
Resolution Date | 2014-09-17T15:28:57.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Alloy 1.7.0 |
Components | Models |
Labels | n/a |
Reporter | Tim Poulsen |
Assignee | Tim Poulsen |
Created | 2014-08-22T19:01:45.000+0000 |
Updated | 2014-10-23T19:47:54.000+0000 |
Description
Community PR: https://github.com/appcelerator/alloy/pull/518
The proposed change should offer speed improvements but implements no functional changes (in other words, existing code should continue to work).
Per the comment on the PR: Consider adding a batch update method that would be faster because it would process all model changes in a single SQL statement rather than by opening repeated connections to the database. (Likely that's a separate ticket)
Tested the PR. Small typo (see comment on PR) but other than that it works and passes all tests. I see no obvious side-effects and I'm ready to merge, pending a fix for the typo.
PR: https://github.com/appcelerator/alloy/pull/556 Functional test: any of the test/apps/models/* sample apps should run without error.
PR merged.
PR to back out the change https://github.com/appcelerator/alloy/pull/562 The immediately-invoked function is necessary to permit garbage collection
New PR https://github.com/appcelerator/alloy/pull/564 This change restores the self-calling (IIFE) function, removes the unnecessary transaction, and implements the lastInsertId as in the original community PR. Please merge pull 562 before merging this one.
PR merged.