@capacitor-community/sqlite 5.0.0-beta.1 → 5.0.0
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/README.md +19 -16
- package/android/build.gradle +4 -11
- package/android/src/main/AndroidManifest.xml +2 -2
- package/android/src/main/java/com/getcapacitor/community/database/sqlite/SQLite/ImportExportJson/ImportFromJson.java +7 -4
- package/electron/dist/plugin.js +229 -129
- package/electron/dist/plugin.js.map +1 -1
- package/electron/rollup.config.js +1 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
<a href="https://www.npmjs.com/package/@capacitor-community/sqlite"><img src="https://img.shields.io/npm/dw/@capacitor-community/sqlite?style=flat-square" /></a>
|
|
17
17
|
<a href="https://www.npmjs.com/package/@capacitor-community/sqlite"><img src="https://img.shields.io/npm/v/@capacitor-community/sqlite?style=flat-square" /></a>
|
|
18
18
|
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
|
19
|
-
<a href="#contributors-"><img src="https://img.shields.io/badge/all%20contributors-
|
|
19
|
+
<a href="#contributors-"><img src="https://img.shields.io/badge/all%20contributors-35-orange?style=flat-square" /></a>
|
|
20
20
|
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
|
21
21
|
</p>
|
|
22
22
|
|
|
@@ -30,17 +30,17 @@
|
|
|
30
30
|
To install:
|
|
31
31
|
|
|
32
32
|
```
|
|
33
|
-
npm install --save @capacitor-community/sqlite
|
|
33
|
+
npm install --save @capacitor-community/sqlite
|
|
34
34
|
npx cap sync
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
```
|
|
38
|
-
yarn add @capacitor-community/sqlite
|
|
38
|
+
yarn add @capacitor-community/sqlite
|
|
39
39
|
npx cap sync
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
```
|
|
43
|
-
pnpm install --save @capacitor-community/sqlite
|
|
43
|
+
pnpm install --save @capacitor-community/sqlite
|
|
44
44
|
pnpm install --save @jeep-sqlite
|
|
45
45
|
pnpm install --save sql.js
|
|
46
46
|
npx cap sync
|
|
@@ -79,6 +79,7 @@ then add plugin to main `capacitor.config.json` file:
|
|
|
79
79
|
|
|
80
80
|
## More Reading:
|
|
81
81
|
|
|
82
|
+
- [Updating to Capacitor 5](https://capacitorjs.com/docs/updating/5-0)
|
|
82
83
|
- [Releases](https://github.com/capacitor-community/sqlite/blob/master/info_releases.md)
|
|
83
84
|
- [Changelog](https://github.com/capacitor-community/sqlite/blob/master/CHANGELOG.md)
|
|
84
85
|
- [Issues](https://github.com/capacitor-community/sqlite/issues)
|
|
@@ -116,8 +117,8 @@ You'll need the usual capacitor/android/react npm script to build and copy the a
|
|
|
116
117
|
See [#301](https://github.com/capacitor-community/sqlite/issues/301) and [SO question](https://stackoverflow.com/questions/63291529/how-to-fix-more-than-one-file-was-found-with-os-independent-path-build-data-pro) for more information.
|
|
117
118
|
|
|
118
119
|
- Check/Add the following:
|
|
119
|
-
Gradle JDK version
|
|
120
|
-
Android Gradle Plugin Version
|
|
120
|
+
Gradle JDK version 17
|
|
121
|
+
Android Gradle Plugin Version 8.0.0
|
|
121
122
|
In variables.gradle
|
|
122
123
|
|
|
123
124
|
```
|
|
@@ -157,10 +158,9 @@ You'll need the usual capacitor/android/react npm script to build and copy the a
|
|
|
157
158
|
|
|
158
159
|
```bash
|
|
159
160
|
cd electron
|
|
160
|
-
npm install --save
|
|
161
|
+
npm install --save @journeyapps/sqlcipher
|
|
161
162
|
npm install --save jszip
|
|
162
163
|
npm install --save node-fetch@2.6.7
|
|
163
|
-
npm install --save-dev @types/sqlite3
|
|
164
164
|
```
|
|
165
165
|
- **Important**: `node-fetch` version must be `<=2.6.7`; otherwise [you'll get an error](https://github.com/capacitor-community/sqlite/issues/349 "you'll get an error ERR_REQUIRE_ESM") running the app.
|
|
166
166
|
|
|
@@ -180,7 +180,7 @@ npm install --save-dev @types/sqlite3
|
|
|
180
180
|
| isConnection (ReadWrite) | ✅ | ✅ | ✅ | ✅ |
|
|
181
181
|
| isConnection (ReadOnly) | ✅ | ✅ | ✅ | ❌ | since 4.1.0-7
|
|
182
182
|
| open (non-encrypted DB) | ✅ | ✅ | ✅ | ✅ |
|
|
183
|
-
| open (encrypted DB) | ✅ | ✅ |
|
|
183
|
+
| open (encrypted DB) | ✅ | ✅ | ✅ | ❌ |
|
|
184
184
|
| close | ✅ | ✅ | ✅ | ✅ |
|
|
185
185
|
| getUrl | ✅ | ✅ | ❌ | ❌ |
|
|
186
186
|
| getVersion | ✅ | ✅ | ✅ | ✅ |
|
|
@@ -209,10 +209,10 @@ npm install --save-dev @types/sqlite3
|
|
|
209
209
|
| deleteOldDatabases | ✅ | ✅ | ❌ | ❌ |
|
|
210
210
|
| moveDatabasesAndAddSuffix | ✅ | ✅ | ❌ | ❌ |
|
|
211
211
|
| checkConnectionsConsistency | ✅ | ✅ | ✅ | ✅ |
|
|
212
|
-
| isSecretStored | ✅ | ✅ |
|
|
213
|
-
| setEncryptionSecret | ✅ | ✅ |
|
|
214
|
-
| changeEncryptionSecret | ✅ | ✅ |
|
|
215
|
-
| clearEncryptionSecret | ✅ | ✅ |
|
|
212
|
+
| isSecretStored | ✅ | ✅ | ✅ | ❌ |
|
|
213
|
+
| setEncryptionSecret | ✅ | ✅ | ✅ | ❌ |
|
|
214
|
+
| changeEncryptionSecret | ✅ | ✅ | ✅ | ❌ |
|
|
215
|
+
| clearEncryptionSecret | ✅ | ✅ | ✅ | ❌ |
|
|
216
216
|
| checkEncryptionSecret | ✅ | ✅ | ❌ | ❌ |
|
|
217
217
|
| initWebStore | ❌ | ❌ | ❌ | ✅ |
|
|
218
218
|
| saveToStore | ❌ | ❌ | ❌ | ✅ |
|
|
@@ -251,6 +251,7 @@ npm install --save-dev @types/sqlite3
|
|
|
251
251
|
|
|
252
252
|
- [Biometric Authentication](https://github.com/capacitor-community/sqlite/blob/master/docs/Biometric-Authentication.md)
|
|
253
253
|
|
|
254
|
+
- [Enable SQLite Schema Error Syntax Highlighting](https://github.com/capacitor-community/sqlite/blob/master/docs/SyntaxScanner-For-SQLite-Code.md)
|
|
254
255
|
|
|
255
256
|
## Applications demonstrating the use of the plugin and related documentation
|
|
256
257
|
|
|
@@ -304,9 +305,9 @@ npm install --save-dev @types/sqlite3
|
|
|
304
305
|
## Dependencies
|
|
305
306
|
|
|
306
307
|
The iOS and Android codes are using `SQLCipher` allowing for database encryption.
|
|
307
|
-
The iOS codes is using `ZIPFoundation` for unzipping assets files
|
|
308
|
-
The Electron code is using `
|
|
309
|
-
The Web code is using the Stencil component `jeep-sqlite` based on `sql.js`, `localforage
|
|
308
|
+
The iOS codes is using `ZIPFoundation` for unzipping assets files
|
|
309
|
+
The Electron code is using `@journeyapps/sqlcipher` and `node-fetch` from 4.2.0.
|
|
310
|
+
The Web code is using the Stencil component `jeep-sqlite` based on `sql.js`, `localforage`. and `jszip`
|
|
310
311
|
|
|
311
312
|
## Contributors ✨
|
|
312
313
|
|
|
@@ -349,6 +350,8 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
|
|
349
350
|
<a href="https://github.com/eppineda" title="eppineda"><img src="https://github.com/eppineda.png?size=100" width="50" height="50" /></a>
|
|
350
351
|
<a href="https://github.com/patdx" title="patdx"><img src="https://github.com/patdx.png?size=100" width="50" height="50" /></a>
|
|
351
352
|
<a href="https://github.com/folsze" title="folsze"><img src="https://github.com/folsze.png?size=100" width="50" height="50" /></a>
|
|
353
|
+
<a href="https://github.com/pranav-singhal" title="pranav-singhal"><img src="https://github.com/pranav-singhal.png?size=100" width="50" height="50" /></a>
|
|
354
|
+
<a href="https://github.com/beligatclement" title="beligatclement"><img src="https://github.com/beligatclement.png?size=100" width="50" height="50" /></a>
|
|
352
355
|
</p>
|
|
353
356
|
|
|
354
357
|
|
package/android/build.gradle
CHANGED
|
@@ -11,7 +11,7 @@ buildscript {
|
|
|
11
11
|
mavenCentral()
|
|
12
12
|
}
|
|
13
13
|
dependencies {
|
|
14
|
-
classpath 'com.android.tools.build:gradle:
|
|
14
|
+
classpath 'com.android.tools.build:gradle:8.0.0'
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -40,8 +40,8 @@ android {
|
|
|
40
40
|
abortOnError false
|
|
41
41
|
}
|
|
42
42
|
compileOptions {
|
|
43
|
-
sourceCompatibility JavaVersion.
|
|
44
|
-
targetCompatibility JavaVersion.
|
|
43
|
+
sourceCompatibility JavaVersion.VERSION_17
|
|
44
|
+
targetCompatibility JavaVersion.VERSION_17
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -51,12 +51,6 @@ repositories {
|
|
|
51
51
|
mavenCentral()
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
gradle.projectsEvaluated {
|
|
55
|
-
tasks.withType(JavaCompile) {
|
|
56
|
-
options.compilerArgs << "-Xlint:deprecation"
|
|
57
|
-
options.compilerArgs << "-Xlint:unchecked"
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
54
|
|
|
61
55
|
dependencies {
|
|
62
56
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
@@ -70,8 +64,7 @@ dependencies {
|
|
|
70
64
|
implementation 'net.zetetic:android-database-sqlcipher:4.5.3'
|
|
71
65
|
implementation "androidx.sqlite:sqlite:2.3.1"
|
|
72
66
|
//security library
|
|
73
|
-
implementation "androidx.security:security-crypto:1.1.0-
|
|
67
|
+
implementation "androidx.security:security-crypto:1.1.0-alpha06"
|
|
74
68
|
implementation "androidx.biometric:biometric:1.1.0"
|
|
75
69
|
annotationProcessor 'androidx.room:room-compiler:2.5.1'
|
|
76
70
|
}
|
|
77
|
-
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
2
|
+
>
|
|
3
3
|
</manifest>
|
|
@@ -557,14 +557,17 @@ public class ImportFromJson {
|
|
|
557
557
|
if (row.get(idxDelete).equals(1)) {
|
|
558
558
|
// Delete
|
|
559
559
|
isUpdate = false;
|
|
560
|
-
|
|
560
|
+
Object key = tColNames.get(0);
|
|
561
|
+
StringBuilder sbQuery =
|
|
561
562
|
new StringBuilder("DELETE FROM ")
|
|
562
563
|
.append(tableName)
|
|
563
564
|
.append(" WHERE ")
|
|
564
565
|
.append(tColNames.get(0))
|
|
565
|
-
.append(" = ")
|
|
566
|
-
|
|
567
|
-
|
|
566
|
+
.append(" = ");
|
|
567
|
+
|
|
568
|
+
if (key instanceof Integer) sbQuery.append(row.get(0)).append(";");
|
|
569
|
+
if (key instanceof String) sbQuery.append("'").append(row.get(0)).append("';");
|
|
570
|
+
stmt = sbQuery.toString();
|
|
568
571
|
}
|
|
569
572
|
}
|
|
570
573
|
if (isUpdate) {
|