-
Notifications
You must be signed in to change notification settings - Fork 714
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecate standard transaction mechanism in next major release? #690
Comments
Require a special setting in sqlitePlugin.openDatabase if the user wants to use the standard db.transaction call!!!! What is that special setting @brodybits ?? |
Not decided yet. |
In some cases it is useful to do several actions in one transaction that depend on each other. E.g. read some rows, perform calculation and then update this rows in the same transaction. Looks like new API doesn't allow it. |
I am using |
As Chrome doesn't appear to support db.executeSql, this change will remove the ability to develop and test against a browser before moving to a device. That was always the strength of the plugin, in that I could transparently fall back to WebSQL if required. |
Thanks guys for the feedback, will not be removed from this plugin version. |
@brodybits Does that mean that |
Not from this plugin version. May not be supported by a new sqlite plugin based on possible redesign discussed in #548.
I 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. FYI 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. |
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:
false
(fixed with no issue filed)database.executeSql
anddatabase.sqlBatch
instead ofdatabase.transaction
in both worker and main app code)ADDITIONAL ISSUES DISCOVERED:
Given these issues I would like to deprecate the
db.transaction
call in the next major release discussed in #687. Users would be advised to usedb.executeSql
for SELECT and single-statement changes anddatabase.sqlBatch
for multi-statement changes as already documented. These calls would be supported on the "browser" platform in addition to Android/iOS/macOS/Windows.I am thinking of the following options:
db.transaction
calldb
object constructed by thesqlitePlugin.openDatabase
call would not support the standarddb.transaction
call. Instead the user could issue a call such asdb.getStandardDatabaseHandle()
to get a new object that does support thedb.transaction
call.I would like to leave this issue open for feedback from the user community.
ADDITIONAL NOTE: This may
go along withbe related to the possible redesign discussed in #548.The text was updated successfully, but these errors were encountered: