[TIMOB-26877] Android: Ti.Database.install() should throw exception like iOS if source db file not found
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Low |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2019-05-16T22:54:37.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 8.1.0 |
Components | Android |
Labels | android, database, engArch, install, parity |
Reporter | Joshua Quick |
Assignee | Joshua Quick |
Created | 2019-03-05T23:26:09.000+0000 |
Updated | 2019-05-16T22:54:37.000+0000 |
Description
*Summary:*
The [Ti.Database.install()](https://docs.appcelerator.com/platform/latest/#!/api/Titanium.Database-method-install) API is intended to copy a "source" database file embedded within the app to a writeable location. The idea being that the app developer can preconfigure a SQLite database's tables/columns/indexes, embed that preconfigured database file within the app, thus avoiding having to do set up a database dynamically within the app's code.
On iOS, if the 1st argument (the source database file path) is not found, then the
install()
function will throw an exception. This is good because this tells the app developer that he/she has set the path wrong to the embedded database file.
On Android, if the source database file is not found, then an empty database is installed to the given location. This may confuse the app developer. It should throw an exception instead like iOS to clearly indicate that it's a path issue.
PR (master): https://github.com/appcelerator/titanium_mobile/pull/10770
FR passed. PR merged
Verified the fix on sdk 8.1.0.v20190516120244.Works as expected. Test information found under the PR https://github.com/appcelerator/titanium_mobile/pull/10770