{"action":"created","issue":{"url":"https://api.github.com/repos/litehelpers/Cordova-sqlite-storage/issues/690","repository_url":"https://api.github.com/repos/litehelpers/Cordova-sqlite-storage","labels_url":"https://api.github.com/repos/litehelpers/Cordova-sqlite-storage/issues/690/labels{/name}","comments_url":"https://api.github.com/repos/litehelpers/Cordova-sqlite-storage/issues/690/comments","events_url":"https://api.github.com/repos/litehelpers/Cordova-sqlite-storage/issues/690/events","html_url":"https://github.com/litehelpers/Cordova-sqlite-storage/issues/690","id":228061099,"number":690,"title":"Deprecate standard transaction mechanism in next major release?","user":{"login":"brodybits","id":1559888,"avatar_url":"https://avatars0.githubusercontent.com/u/1559888?v=4","gravatar_id":"","url":"https://api.github.com/users/brodybits","html_url":"https://github.com/brodybits","followers_url":"https://api.github.com/users/brodybits/followers","following_url":"https://api.github.com/users/brodybits/following{/other_user}","gists_url":"https://api.github.com/users/brodybits/gists{/gist_id}","starred_url":"https://api.github.com/users/brodybits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brodybits/subscriptions","organizations_url":"https://api.github.com/users/brodybits/orgs","repos_url":"https://api.github.com/users/brodybits/repos","events_url":"https://api.github.com/users/brodybits/events{/privacy}","received_events_url":"https://api.github.com/users/brodybits/received_events","type":"User","site_admin":false},"labels":[{"id":358023673,"url":"https://api.github.com/repos/litehelpers/Cordova-sqlite-storage/labels/discussion","name":"discussion","color":"5319e7","default":false},{"id":500812113,"url":"https://api.github.com/repos/litehelpers/Cordova-sqlite-storage/labels/doc-general","name":"doc-general","color":"1d76db","default":false},{"id":40026137,"url":"https://api.github.com/repos/litehelpers/Cordova-sqlite-storage/labels/question","name":"question","color":"cc317c","default":true},{"id":358024074,"url":"https://api.github.com/repos/litehelpers/Cordova-sqlite-storage/labels/suggestion","name":"suggestion","color":"d93f0b","default":false},{"id":227836186,"url":"https://api.github.com/repos/litehelpers/Cordova-sqlite-storage/labels/testing","name":"testing","color":"fbca04","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2017-05-11T17:10:02Z","updated_at":"2018-03-05T19:38:31Z","closed_at":"2018-02-16T12:02:58Z","author_association":"OWNER","body":"The deprecated Web SQL transaction API described in <https://www.w3.org/TR/webdatabase/> has led to some bugs and significant confusion over the past few years. For example:\r\n- litehelpers/Cordova-sqlite-storage#409 - TypeError in success callback, fixed with a workaround solution\r\n- plugin would fire more callbacks after an error with no error handler that returns `false` (fixed with no issue filed)\r\n- litehelpers/Cordova-sqlite-storage#666 - Transaction problem after page change, WITH POSSIBLE DATA LOSS (fixed with a workaround solution in this plugin version)\r\n- litehelpers/Cordova-sqlite-evplus-legacy-workers-free#3 - transaction within a transaction issue with simultaneous transactions in web worker and main app code in that version (workaround is to use `database.executeSql` and `database.sqlBatch` instead of `database.transaction` in both worker and main app code)\r\n\r\n_ADDITIONAL ISSUES DISCOVERED:_\r\n- _not possible to support Web SQL transaction API in worker on the Browser platform ref:  <https://github.com/litehelpers/Cordova-sqlite-evcore-extbuild-free/issues/11>_\r\n- _Problem with workaround solution to #666 reported in <https://github.com/litehelpers/Cordova-sqlite-storage/issues/666#issuecomment-315283081>_\r\n- _Database might be busy when close is called ref: #702_\r\n\r\nGiven these issues I would like to deprecate the `db.transaction` call in the next major release discussed in litehelpers/Cordova-sqlite-storage#687. Users would be advised to use `db.executeSql` for SELECT and single-statement changes and `database.sqlBatch` for multi-statement changes as already documented. These calls would be supported on the \"browser\" platform in addition to Android/iOS/macOS/Windows.\r\n\r\nI am thinking of the following options:\r\n- Require a special setting in sqlitePlugin.openDatabase if the user wants to use the standard `db.transaction` call\r\n- The `db` object constructed by the `sqlitePlugin.openDatabase` call would not support the standard `db.transaction` call. Instead the user could issue a call such as `db.getStandardDatabaseHandle()` to get a new object that *does* support the `db.transaction` call.\r\n\r\nI would like to leave this issue open for feedback from the user community.\r\n\r\n_ADDITIONAL NOTE: This may ~~go along with~~ **be related to** the possible redesign discussed in litehelpers/Cordova-sqlite-storage#548._"},"comment":{"url":"https://api.github.com/repos/litehelpers/Cordova-sqlite-storage/issues/comments/370538044","html_url":"https://github.com/litehelpers/Cordova-sqlite-storage/issues/690#issuecomment-370538044","issue_url":"https://api.github.com/repos/litehelpers/Cordova-sqlite-storage/issues/690","id":370538044,"user":{"login":"brodybits","id":1559888,"avatar_url":"https://avatars0.githubusercontent.com/u/1559888?v=4","gravatar_id":"","url":"https://api.github.com/users/brodybits","html_url":"https://github.com/brodybits","followers_url":"https://api.github.com/users/brodybits/followers","following_url":"https://api.github.com/users/brodybits/following{/other_user}","gists_url":"https://api.github.com/users/brodybits/gists{/gist_id}","starred_url":"https://api.github.com/users/brodybits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brodybits/subscriptions","organizations_url":"https://api.github.com/users/brodybits/orgs","repos_url":"https://api.github.com/users/brodybits/repos","events_url":"https://api.github.com/users/brodybits/events{/privacy}","received_events_url":"https://api.github.com/users/brodybits/received_events","type":"User","site_admin":false},"created_at":"2018-03-05T19:38:31Z","updated_at":"2018-03-05T19:38:31Z","author_association":"OWNER","body":"> @brodybits Does that mean that db.transaction may still be removed in future versions?\r\n\r\nNot from this plugin version. May not be supported by a new sqlite plugin based on possible redesign discussed in #548.\r\n\r\n> [...] is it recommended to just use executeSql where possible instead?\r\n\r\nI would recommend db.executeSql() call for read and simple (single-statement) write or db.sqlBatch() call in case of multiple-statement modification. Simpler, more future-proof in case of new sqlite plugin version with redesign discussed in #548.\r\n\r\nFYI a promise-based API wrapper is available in <https://github.com/brodybits/sql-promise-helper>, which provides functionality similar to db.executeSql() and db.sqlBatch() calls."}}
{"actor":{"display_login":"brodybits"}}