{ "id": "89871", "key": "TIMOB-8695", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "20412", "name": "Release 8.1.0", "archived": false, "released": true, "releaseDate": "2019-08-13" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2020-01-10T18:50:18.000+0000", "created": "2012-04-11T17:44:36.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "api", "database", "install" ], "versions": [ { "id": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" } ], "issuelinks": [ { "id": "58076", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "121090", "key": "TIMOB-15458", "fields": { "summary": "iOS: Can not install database file using temporary directory", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "Low", "id": "4" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2020-01-10T18:50:21.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "The documentation doesn't state that its impossible to run Ti.Database.install(Ti.Filesystem.applicationDataDirectory, 'mydb');\r\n\r\nHowever not matter what you do, it is impossible, further more its a little frustrating as many a database strategy will involve remote files and source files that can be used for later purposes.\r\n\r\nI can see no reason why the command has to default to the Resources directory.\r\nCould there be some clarification on what you can and can't do. And if currently, you can't install from the appDataDirectory, can i suggest it goes high up on the roadmap.\r\n\r\nthis will cost days of developers time a) figuring out what works and doesn't work, then having to write a very long process in evaluating and inserting data, when its not necessary.\r\n\r\nAt the moment you can write to the DB storage space on iOS, it mainly affects android, but I think the SDK should allow for this behaviour. ", "attachment": [], "flagged": false, "summary": "Android: Database Install fails to install from applicationDataDirectory", "creator": { "name": "stereoket", "key": "stereoket", "displayName": "Ketan Majmudar", "active": true, "timeZone": "Europe/London" }, "subtasks": [], "reporter": { "name": "stereoket", "key": "stereoket", "displayName": "Ketan Majmudar", "active": true, "timeZone": "Europe/London" }, "environment": "SDK 2.0.0 (all versions I think) - Mac OS X 10.6.8 - tested on Android 2.2 / 2.3.6 HTC wildfire", "closedSprints": [ { "id": 1176, "state": "closed", "name": "2020 Sprint 1", "startDate": "2020-01-02T21:15:56.301Z", "endDate": "2020-01-17T21:15:00.000Z", "completeDate": "2020-01-21T17:44:29.577Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "281427", "author": { "name": "stereoket", "key": "stereoket", "displayName": "Ketan Majmudar", "active": true, "timeZone": "Europe/London" }, "body": "I will throw up a test case for this shortly\r\n", "updateAuthor": { "name": "stereoket", "key": "stereoket", "displayName": "Ketan Majmudar", "active": true, "timeZone": "Europe/London" }, "created": "2013-11-26T17:03:41.000+0000", "updated": "2013-11-26T17:03:41.000+0000" }, { "id": "453646", "author": { "name": "ahutton", "key": "ahutton", "displayName": "Alan Hutton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This issue is out of date with our current supported SDK release (7.5.2.GA as of the date of closure), and out of date with mobile OS versions. \r\n\r\nIf community members feel that the issue is still valid, please create a new ticket. Please reference this closed ticket number, include SDK used, comments, and code that demonstrates/reproduces the issue.", "updateAuthor": { "name": "ahutton", "key": "ahutton", "displayName": "Alan Hutton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-01-10T18:04:41.000+0000", "updated": "2020-01-10T18:04:41.000+0000" }, { "id": "453658", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "You can use the following code to test this...\r\n{code:javascript}\r\nfunction dbInsert(dbConnection, key, value) {\r\n\tvar sqlStatement = \"INSERT OR REPLACE INTO properties(key, value) VALUES (?, ?);\";\r\n\tdbConnection.execute(sqlStatement, key, value);\r\n}\r\n\r\nvar dbSourceFile = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, \"Source.sqlite\");\r\nTi.API.info(\"@@@ dbSourceFile: \" + dbSourceFile.nativePath);\r\nvar dbConnection = Ti.Database.open(dbSourceFile);\r\ndbConnection.execute(\"CREATE TABLE IF NOT EXISTS properties(key TEXT PRIMARY KEY, value TEXT);\");\r\ndbInsert(dbConnection, \"Message1\", \"This is message 1.\");\r\ndbConnection.close();\r\n\r\nvar dbConnection = Ti.Database.install(dbSourceFile.nativePath, \"MyInstalledDatabase\");\r\ndbInsert(dbConnection, \"Message2\", \"This is message 2.\");\r\nvar resultSet = dbConnection.execute(\"SELECT key, value FROM properties\");\r\nTi.API.info(\"@@@ Database Table 'properties' row count: \" + (resultSet ? resultSet.rowCount : \"\"));\r\nif (resultSet) {\r\n\tfor (; resultSet.isValidRow(); resultSet.next()) {\r\n\t\tTi.API.info(\"- Key: '\" + resultSet.field(0) + \"', Value: '\" + resultSet.field(1) + \"'\");\r\n\t}\r\n}\r\ndbConnection.close();\r\n{code}\r\n", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-01-10T18:46:06.000+0000", "updated": "2020-01-10T18:46:06.000+0000" }, { "id": "453659", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This issue was resolved on Android in Titanium 8.1.0.\r\nIt was solved by: [TIMOB-26878]\r\n\r\n*Note:*\r\nWhile this now works on Android, it does not work on iOS. See: [TIMOB-15458]", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-01-10T18:47:00.000+0000", "updated": "2020-01-10T18:50:14.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }