Open brodycj opened 4 years ago
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 cordova-sqlite-storage-file
; database path is still in unstable path on iOS.
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:
sqlite3_key
function for testing purposes - permissive MIT licenseu0000
character - GPL v3 or commercial license optionssqlite3_key
function for testing purposes, and partial support for u0000
character - GPL v3 or commercial license optionsnet.sqlcipher
C++ & Java classes removed, using https://github.com/brodybits/sqlite-fake-crypto-batch-connection-core-unstable-2020-0x for JNI interfaceu0000
character support and workaround for large result memory issue on Android, using https://github.com/brodybits/sqlite-batch-connection-core-pro-free-2020-01-unstable-0x for low-level libraries, requires local build step - GPL v3 or commercial license optionsu0000
character support and workaround for large result memory issue on Android, requires local build step (unstable build release tags available) - GPL v3 or commercial license optionsThe 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: https://github.com/xpbrew/cordova-sqlite-storage/issues/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 chris@brody.consulting if interested.