Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-382] Titanium.Database.install Options to Force Rewrite on sql File

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionInvalid
Resolution Date2011-04-15T02:28:25.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsandroid, database, ios
Reporterdukz
AssigneeDon Thorp
Created2011-04-15T02:28:24.000+0000
Updated2017-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 });

Comments

  1. Stephen Tramer 2011-04-15

    Can be accomplished with a combination of Ti.Database.remove() and Ti.Database.install().

  2. Lee Morris 2017-03-09

    Closing ticket as invalid.

JSON Source