[TIMOB-382] Titanium.Database.install Options to Force Rewrite on sql File
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2011-04-15T02:28:25.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Android |
Labels | android, database, ios |
Reporter | dukz |
Assignee | Don Thorp |
Created | 2011-04-15T02:28:24.000+0000 |
Updated | 2017-03-09T21:08:44.000+0000 |
Description
It'd be great if the install can overwrite the writable sqlite3 db file with a given option.
Changes made to the schema of a database change a lot while on development, and it seems that the install method would just use the existing one if it already exists.
Proposed implementation:
Titanium.Database.install(resource_name, target_name, options);
Where options, for now, has the following options:
force {boolean} Overwrites target name when true.
Defaults to false.
The following code will use the target_name, not replace
it:
Titanium.Database.install(resource_name, target_name);
Titanium.Database.install(resource_name, target_name, {});
Titanium.Database.install(resource_name, target_name, { force: false });
The following code will replace target_name with
resource_name
Titanium.Database.install(resource_name, target_name, { force: true });
Can be accomplished with a combination of Ti.Database.remove() and Ti.Database.install().
Closing ticket as invalid.