@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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unvired/cordova-plugin-unvired-electron-db",
3
3
  "displayName": "Unvired DB",
4
- "version": "0.0.41",
4
+ "version": "0.0.42",
5
5
  "description": "Unvired DB Native Support for Cordova",
6
6
  "scripts": {},
7
7
  "keywords": [
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.41"
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 (query.toUpperCase().includes("SELECT")) {
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()) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cordova-plugin-unvired-electron-db",
3
- "version": "0.0.41",
3
+ "version": "0.0.42",
4
4
  "description": "Unvired DB Native Support for Cordova",
5
5
  "main": "unvired-db-proxy.js",
6
6
  "author": "Unvired Inc",