-
Notifications
You must be signed in to change notification settings - Fork 1
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
Starting new SQLite plugin design for Apache Cordova #3
Comments
Do you have any plans to move to Capacitor? |
My apologies for the delay. Apache Cordova is my primary target; Capacitor should be able to run almost any plugin working on Cordova. A major advantage of Cordova is no need for platform artifacts to be committed in the git history. |
Hi, do you have an approximated release date for that ? May I start to use this SQLite plugin expecting the next one will be compatible ? Thanks! |
I am working on something for both Cordova & React Native, should be ready in the next 1-2 weeks or so. |
@brodybits are there any news about the new sql plugin for Cordova? |
My apologies for the delays. I may need another 1-2 weeks or so. |
Hey, any update on this?:) |
New, unstable plugin version is here: https://github.com/brodybits/cordova-plugin-sqlite-batch-connection-manager-core-unstable-0x The native SQLite3 libraries are not committed in master. TODO item is to update the plugin to install native SQLite3 libraries using pod for iOS, Maven for Android. Until then, it is recommended to install from an unstable build release tag, for example: cordova plugin add github: com/brodybits/cordova-plugin-sqlite-batch-connection-manager-core-unstable-0x#build-2020-06-17-01 The database file path generally needs to be resolved using |
Thanks for the response! I couldn't yet check it deeply but are there any plans to move from old websql limitations like persist an sqlite transaction more than a tick, essentially making async/await possible in transactions? |
The new plugin API is pretty low-level, and I would generally recommend some kind of a JavaScript wrapper layer. Transactions would be accomplished by using the standard BEGIN, COMMIT, and ROLLBACK statements. A promise-based wrapper API could be used to support async/await. |
The new plugin design has been working together with SQLCipher and PouchDB for RTI (https://www.rti.org). I will still need some time to get it ready for more widespread usage. Here are the components available and delivered so far:
The following patch is required in https://github.com/brodybits/cordova-sqlite-plugin-legacy-object-wrapper to support SQLCipher with the password key option: index 12af61b..c2ecbbe 100644
--- a/cordova-sqlite-plugin-legacy-object-wrapper.js
+++ b/cordova-sqlite-plugin-legacy-object-wrapper.js
@@ -224,6 +224,7 @@
console.log('path: ' + path);
opts = {
fullName: path,
+ key: _this.openargs.key || '',
flags: 6
};
return window.sqliteBatchConnectionManager.openDatabaseConnection(opts, function(id) { Some loose ends:
|
I would like to better understand this comment if it may affect using an open SQLite connection from a thread pool: https://sqlite.org/forum/forumpost/f9d10599b6 |
I have renamed the project for 2021 and pushed some updates to support named parameters (on Android, iOS, and macOS). |
Background: Apache Cordova enables people to develop mobile apps for Android, iOS, and other platforms in HTML and JavaScript. I have been maintaining a widely used plugin that provides SQLite storage capability with a JavaScript API. The plugin has a somewhat complex JavaScript API that closely emulates the draft and deprecated Web SQL API.
I am now starting a new SQLite plugin design based on a lightweight SQLite connection management component, with a preview already available in:
brodybits/sqlite-batch-connection-support-preview-2020-01
Note that the preview is archived since I am not interested in handling any PRs at this time. Any questions, ideas, or suggestions should be raised here or in a new issue on this project.
The preview was designed to be thread-safe, with exception for a single initialization function that should be run from the main thread. It includes a proof-of-concept demo of a new Cordova plugin that provides many of the batch SQL capabilities like the draft Web SQL API.
Here are the major goals that I would like to achieve, in response to my past experience and some recent user demand:
Major non-goals:
I think that the preview with the Cordova plugin demo already fulfills all goals except for running SQL operations in background threads. Access from custom Java code on Android is demonstrated in sample code in the documentation of the preview.
Note that the API of the preview should be considered a draft API and is subject to change when I publish the new plugin.
I am raising this issue as the new step in continuation from a discussion on the existing plugin: storesafe/cordova-sqlite-storage#862
I will probably need a few more weeks to get something ready to replace the existing plugin and am giving priority to paying customers. Please contact [email protected] if interested.
The text was updated successfully, but these errors were encountered: