@unvired/cordova-plugin-unvired-electron-db 0.0.41 → 0.0.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/plugin.xml +1 -1
- package/src/browser/DbPluginProxy.js +5 -1
- package/src/electron/package.json +1 -1
package/package.json
CHANGED
package/plugin.xml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<?xml version='1.0' encoding='utf-8'?>
|
|
2
2
|
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
|
3
3
|
id="@unvired/cordova-plugin-unvired-electron-db"
|
|
4
|
-
version="0.0.
|
|
4
|
+
version="0.0.42"
|
|
5
5
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
|
6
6
|
<name>Unvired DB</name>
|
|
7
7
|
<description>Unvired DB Native Support for Cordova</description>
|
|
@@ -30,7 +30,11 @@ module.exports.execute = async function (sucessCallback, errorCallback, options)
|
|
|
30
30
|
try {
|
|
31
31
|
const db = dbType == DBType.FrameworkDb ? webDb.fwDb : webDb.appDb;
|
|
32
32
|
|
|
33
|
-
if
|
|
33
|
+
// Check if query is a SELECT statement (starts with SELECT or WITH for CTEs)
|
|
34
|
+
// Using regex to handle leading whitespace and ensure it's the start of the command
|
|
35
|
+
const isSelect = /^\s*\(?\s*(SELECT|WITH|PRAGMA|VALUES|EXPLAIN)\b/i.test(query);
|
|
36
|
+
|
|
37
|
+
if (isSelect) {
|
|
34
38
|
let rows = [];
|
|
35
39
|
var stmt = db.prepare(query);
|
|
36
40
|
while (stmt.step()) {
|