@capacitor-community/sqlite 4.1.0-3 → 4.1.0-6
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 +73 -160
- package/android/src/main/java/com/getcapacitor/community/database/sqlite/CapacitorSQLite.java +77 -70
- package/android/src/main/java/com/getcapacitor/community/database/sqlite/SQLite/Database.java +73 -88
- package/android/src/main/java/com/getcapacitor/community/database/sqlite/SQLite/UtilsUpgrade.java +45 -319
- package/dist/esm/definitions.d.ts +3 -6
- package/dist/esm/definitions.js +2 -4
- package/dist/esm/definitions.js.map +1 -1
- package/dist/plugin.cjs.js +2 -4
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +2 -4
- package/dist/plugin.js.map +1 -1
- package/electron/dist/plugin.js +47 -332
- package/electron/dist/plugin.js.map +1 -1
- package/ios/Plugin/CapacitorSQLite.swift +5 -7
- package/ios/Plugin/Database.swift +8 -7
- package/ios/Plugin/Utils/UtilsUpgrade.swift +46 -370
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -26,78 +26,51 @@
|
|
|
26
26
|
| ----------------- | ----------------------------------------- | ------ |
|
|
27
27
|
| Quéau Jean Pierre | [jepiqueau](https://github.com/jepiqueau) | |
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
- [changelog](https://github.com/capacitor-community/sqlite/blob/master/CHANGELOG.md)
|
|
36
|
-
|
|
37
|
-
- [issues](https://github.com/capacitor-community/sqlite/issues)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
The test has been achieved on:
|
|
41
|
-
|
|
42
|
-
- a [Ionic/Angular app](https://github.com/jepiqueau/angular-sqlite-app-starter)
|
|
43
|
-
|
|
44
|
-
- a [Ionic/React app](https://github.com/jepiqueau/react-sqlite-app-starter)
|
|
45
|
-
|
|
46
|
-
- a [Ionic/Vue app](https://github.com/jepiqueau/vue-sqlite-app-starter)
|
|
47
|
-
|
|
48
|
-
- a [React Vite app](https://github.com/jepiqueau/react-vite-sqlite-app)
|
|
49
|
-
|
|
50
|
-
- a [Vue Vite app](https://github.com/jepiqueau/vuevite-app)
|
|
29
|
+
To install:
|
|
30
|
+
```
|
|
31
|
+
npm install @capacitor-community/sqlite
|
|
32
|
+
npx cap sync
|
|
33
|
+
```
|
|
51
34
|
|
|
52
|
-
|
|
35
|
+
## More Reading:
|
|
53
36
|
|
|
54
|
-
-
|
|
37
|
+
- [Releases](https://github.com/capacitor-community/sqlite/blob/master/info_releases.md)
|
|
38
|
+
- [Changelog](https://github.com/capacitor-community/sqlite/blob/master/CHANGELOG.md)
|
|
39
|
+
- [Issues](https://github.com/capacitor-community/sqlite/issues)
|
|
40
|
+
- [Capacitor documentation](https://capacitorjs.com/docs/)
|
|
41
|
+
- [Datatypes In SQLite Version 3](https://www.sqlite.org/datatype3.html)
|
|
42
|
+
- [IncrementalUpgradeDatabaseVersion](https://capacitorjs.com/docs/IncrementalUpgradeDatabaseVersion.md)
|
|
55
43
|
|
|
56
|
-
##
|
|
44
|
+
## Web Quirks
|
|
57
45
|
|
|
58
46
|
The plugin follows the guidelines from the `Capacitor Team`,
|
|
59
47
|
|
|
60
48
|
- [Capacitor Browser Support](https://capacitorjs.com/docs/v3/web#browser-support)
|
|
61
49
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
## Installation
|
|
65
|
-
|
|
66
|
-
```bash
|
|
67
|
-
npm install @capacitor-community/sqlite
|
|
68
|
-
npm run build
|
|
69
|
-
npx cap add android
|
|
70
|
-
npx cap add ios
|
|
71
|
-
npx cap add @capacitor-community/electron
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
and do when you update
|
|
75
|
-
|
|
76
|
-
```bash
|
|
77
|
-
npx cap sync
|
|
78
|
-
npx cap sync @capacitor-community/electron
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
### Web
|
|
50
|
+
Meaning that it will not work in IE11 without additional JavaScript transformations, e.g. with [Babel](https://babeljs.io/).
|
|
51
|
+
You'll need the usual capacitor/android/react npm script to build and copy the assets folder.
|
|
82
52
|
|
|
83
53
|
#### For Angular framework
|
|
84
54
|
|
|
85
|
-
-
|
|
55
|
+
- Copy manually the file `sql-wasm.wasm` from `node_modules/sql.js/dist/sql-wasm.wasm` to the `src/assets` folder of YOUR_APP
|
|
86
56
|
|
|
87
57
|
#### For Vue & React frameworks
|
|
88
58
|
|
|
89
|
-
-
|
|
90
|
-
|
|
91
|
-
### IOS
|
|
92
|
-
|
|
93
|
-
- on iOS, no further steps needed.
|
|
94
|
-
|
|
95
|
-
### Android
|
|
59
|
+
- Copy manually the file `sql-wasm.wasm` from `node_modules/sql.js/dist/sql-wasm.wasm` to the `public/assets` folder of YOUR_APP
|
|
96
60
|
|
|
97
|
-
|
|
61
|
+
## Android Quirks
|
|
98
62
|
|
|
63
|
+
In case you get the following error when building your app in Android Studio:
|
|
64
|
+
`x files found with path 'build-data.properties'.`
|
|
65
|
+
You can you add the following code to `app/build.gradle`:
|
|
66
|
+
```
|
|
67
|
+
packagingOptions {
|
|
68
|
+
exclude 'build-data.properties'
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
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.
|
|
99
72
|
|
|
100
|
-
|
|
73
|
+
## Electron Quirks
|
|
101
74
|
|
|
102
75
|
- On Electron, go to the Electron folder of YOUR_APPLICATION
|
|
103
76
|
|
|
@@ -106,64 +79,14 @@ cd electron
|
|
|
106
79
|
npm install --save sqlite3
|
|
107
80
|
npm install --save jszip
|
|
108
81
|
npm install --save-dev @types/sqlite3
|
|
109
|
-
npm run build
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
## Build & Run
|
|
113
|
-
|
|
114
|
-
```
|
|
115
|
-
npm run build
|
|
116
|
-
npx cap copy
|
|
117
|
-
npx cap copy web
|
|
118
|
-
npx cap copy @capacitor-community/electron
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
### Web
|
|
122
|
-
- Angular
|
|
123
|
-
```
|
|
124
|
-
ionic serve
|
|
125
|
-
```
|
|
126
|
-
- Vue
|
|
127
|
-
```
|
|
128
|
-
npm run serve
|
|
129
|
-
```
|
|
130
|
-
- React
|
|
131
|
-
```
|
|
132
|
-
npm run start
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
### IOS
|
|
136
|
-
|
|
137
|
-
```
|
|
138
|
-
npx cap open ios
|
|
139
82
|
```
|
|
140
83
|
|
|
141
|
-
|
|
84
|
+
## IOS Quirks
|
|
142
85
|
|
|
143
|
-
|
|
144
|
-
npx cap open android
|
|
145
|
-
```
|
|
146
|
-
In case you get the following error:
|
|
147
|
-
`x files found with path 'build-data.properties'.`
|
|
148
|
-
You can you add the following code to `app/build.gradle`:
|
|
149
|
-
```
|
|
150
|
-
packagingOptions {
|
|
151
|
-
exclude 'build-data.properties'
|
|
152
|
-
}
|
|
153
|
-
```
|
|
154
|
-
See [#301](https://github.com/capacitor-community/sqlite/issues/301) and [SO](https://stackoverflow.com/questions/63291529/how-to-fix-more-than-one-file-was-found-with-os-independent-path-build-data-pro] for more information.
|
|
155
|
-
|
|
156
|
-
### Electron
|
|
157
|
-
|
|
158
|
-
```
|
|
159
|
-
npx cap open @capacitor-community/electron
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
## Configuration
|
|
86
|
+
- on iOS, no further steps needed.
|
|
163
87
|
|
|
164
|
-
No configuration required for this plugin
|
|
165
88
|
|
|
166
|
-
## Supported
|
|
89
|
+
## Supported Methods by Platform
|
|
167
90
|
|
|
168
91
|
| Name | Android | iOS | Electron | Web |
|
|
169
92
|
| :-------------------------- | :------ | :-- | :------- | :-- |
|
|
@@ -188,7 +111,7 @@ No configuration required for this plugin
|
|
|
188
111
|
| getSyncDate | ✅ | ✅ | ✅ | ✅ |
|
|
189
112
|
| isJsonValid | ✅ | ✅ | ✅ | ✅ |
|
|
190
113
|
| isDBExists | ✅ | ✅ | ✅ | ✅ |
|
|
191
|
-
| addUpgradeStatement | ✅ | ✅ | ✅ | ✅ |
|
|
114
|
+
| addUpgradeStatement | ✅ | ✅ | ✅ | ✅ | Modified 4.1.0-6
|
|
192
115
|
| copyFromAssets | ✅ | ✅ | ✅ | ✅ |
|
|
193
116
|
| isDBOpen | ✅ | ✅ | ✅ | ✅ |
|
|
194
117
|
| isDatabase | ✅ | ✅ | ✅ | ✅ |
|
|
@@ -212,62 +135,54 @@ No configuration required for this plugin
|
|
|
212
135
|
| isNCDatabase | ✅ | ✅ | ❌ | ❌ |
|
|
213
136
|
| transaction | ✅ | ✅ | ✅ | ✅ |
|
|
214
137
|
|
|
215
|
-
## Supported SQLite Types
|
|
216
|
-
|
|
217
|
-
-[Datatypes In SQLite Version 3](https://www.sqlite.org/datatype3.html)
|
|
218
|
-
|
|
219
|
-
## Documentation
|
|
220
138
|
|
|
221
|
-
|
|
139
|
+
## Documentation & APIs
|
|
222
140
|
|
|
223
|
-
- [
|
|
141
|
+
- [API](https://github.com/capacitor-community/sqlite/blob/master/docs/API.md)
|
|
224
142
|
|
|
225
|
-
- [
|
|
143
|
+
- [API Connection Wrapper](https://github.com/capacitor-community/sqlite/blob/master/docs/APIConnection.md)
|
|
226
144
|
|
|
227
|
-
- [
|
|
145
|
+
- [API DB Connection Wrapper](https://github.com/capacitor-community/sqlite/blob/master/docs/APIDBConnection.md)
|
|
228
146
|
|
|
229
|
-
- [
|
|
147
|
+
- [Import-Export Json](https://github.com/capacitor-community/sqlite/blob/master/docs/ImportExportJson.md)
|
|
230
148
|
|
|
231
|
-
- [
|
|
149
|
+
- [Upgrade Database Version](https://github.com/capacitor-community/sqlite/blob/master/docs/UpgradeDatabaseVersion.md)
|
|
232
150
|
|
|
233
|
-
- [
|
|
151
|
+
- [Migrating Cordova Databases](https://github.com/capacitor-community/sqlite/blob/master/docs/MigratingCordovaDatabases.md)
|
|
234
152
|
|
|
235
|
-
- [
|
|
153
|
+
- [Type ORM](https://github.com/capacitor-community/sqlite/blob/master/docs/TypeORM-Usage.md)
|
|
236
154
|
|
|
237
|
-
- [
|
|
155
|
+
- [Web Usage](https://github.com/capacitor-community/sqlite/blob/master/docs/Web-Usage.md)
|
|
238
156
|
|
|
239
|
-
- [
|
|
157
|
+
- [Non Conformed Databases](https://github.com/capacitor-community/sqlite/blob/master/docs/NonConformedDatabases.md)
|
|
240
158
|
|
|
241
|
-
- [
|
|
159
|
+
- [Biometric Authentication](https://github.com/capacitor-community/sqlite/blob/master/docs/Biometric-Authentication.md)
|
|
242
160
|
|
|
243
|
-
### Framework's Usage
|
|
244
161
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
- [Ionic/React_Usage_Documentation](https://github.com/capacitor-community/sqlite/blob/master/docs/Ionic-React-Usage.md)
|
|
248
|
-
|
|
249
|
-
- [Ionic/Vue_Usage_Documentation](https://github.com/capacitor-community/sqlite/blob/master/docs/Ionic-Vue-Usage.md)
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
## Applications demonstrating the use of the plugin
|
|
162
|
+
## Applications demonstrating the use of the plugin and related documentation
|
|
253
163
|
|
|
254
164
|
### Ionic/Angular
|
|
255
165
|
|
|
166
|
+
- [Ionic/Angular Usage Documentation](https://github.com/capacitor-community/sqlite/blob/master/docs/Ionic-Angular-Usage.md)
|
|
167
|
+
|
|
256
168
|
- [angular-sqlite-app-starter](https://github.com/jepiqueau/angular-sqlite-app-starter)
|
|
257
169
|
|
|
258
170
|
- [angular-sqlite-synchronize-app](https://github.com/jepiqueau/angular-sqlite-synchronize-app)
|
|
259
171
|
|
|
260
172
|
### Ionic/React
|
|
261
173
|
|
|
174
|
+
- [Ionic/React Usage Documentation](https://github.com/capacitor-community/sqlite/blob/master/docs/Ionic-React-Usage.md)
|
|
175
|
+
|
|
262
176
|
- [react-sqlite-app-starter](https://github.com/jepiqueau/react-sqlite-app-starter)
|
|
263
177
|
|
|
264
178
|
### React+Vite
|
|
265
179
|
|
|
266
180
|
- [react-vite-sqlite-app](https://github.com/jepiqueau/react-vite-sqlite-app)
|
|
267
181
|
|
|
268
|
-
|
|
269
182
|
### Ionic/Vue
|
|
270
183
|
|
|
184
|
+
- [Ionic/Vue Usage Documentation](https://github.com/capacitor-community/sqlite/blob/master/docs/Ionic-Vue-Usage.md)
|
|
185
|
+
|
|
271
186
|
- [vue-sqlite-app-starter](https://github.com/jepiqueau/vue-sqlite-app-starter)
|
|
272
187
|
|
|
273
188
|
### Vue
|
|
@@ -282,10 +197,9 @@ No configuration required for this plugin
|
|
|
282
197
|
|
|
283
198
|
- [solidjs-vite-sqlite-app](https://github.com/jepiqueau/capacitor-solid-sqlite)
|
|
284
199
|
|
|
200
|
+
### Vue TypeORM app
|
|
285
201
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
- [see capacitor documentation](https://capacitor.ionicframework.com/docs/getting-started/with-ionic)
|
|
202
|
+
- [vue-typeorm-app](https://github.com/jepiqueau/vue-typeorm-app)
|
|
289
203
|
|
|
290
204
|
|
|
291
205
|
## Dependencies
|
|
@@ -303,28 +217,27 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
|
|
303
217
|
<!-- prettier-ignore-start -->
|
|
304
218
|
<!-- markdownlint-disable -->
|
|
305
219
|
<p align="center">
|
|
306
|
-
<a href="https://github.com/jepiqueau"><img src="https://github.com/jepiqueau.png?size=100" width="50" height="50"
|
|
307
|
-
<a href="https://github.com/paulantoine2"><img src="https://github.com/paulantoine2.png?size=100" width="50" height="50" /></a>
|
|
308
|
-
<a href="https://github.com/karyfars"><img src="https://github.com/karyfars.png?size=100" width="50" height="50" /></a>
|
|
309
|
-
<a href="https://github.com/chriswep"><img src="https://github.com/chriswep.png?size=100" width="50" height="50" /></a>
|
|
310
|
-
<a href="https://github.com/nirajhinge"><img src="https://github.com/nirajhinge.png?size=100" width="50" height="50" /></a>
|
|
311
|
-
<a href="https://github.com/digaus"><img src="https://github.com/digaus.png?size=100" width="50" height="50" /></a>
|
|
312
|
-
<a href="https://github.com/IT-MikeS"><img src="https://github.com/IT-MikeS.png?size=100" width="50" height="50" /></a>
|
|
313
|
-
<a href="https://github.com/peakcool"><img src="https://github.com/peakcool.png?size=100" width="50" height="50" /></a>
|
|
314
|
-
<a href="https://github.com/gion-andri"><img src="https://github.com/gion-andri.png?size=100" width="50" height="50" /></a>
|
|
315
|
-
<a href="https://github.com/robingenz"><img src="https://github.com/robingenz.png?size=100" width="50" height="50" /></a>
|
|
316
|
-
<a href="https://github.com/dewald-els"><img src="https://github.com/dewald-els.png?size=100" width="50" height="50" /></a>
|
|
317
|
-
<a href="https://github.com/joewoodhouse"><img src="https://github.com/joewoodhouse.png?size=100" width="50" height="50" /></a>
|
|
318
|
-
<a href="https://github.com/ptasheq"><img src="https://github.com/ptasheq.png?size=100" width="50" height="50" /></a>
|
|
319
|
-
<a href="https://github.com/victorybiz"><img src="https://github.com/victorybiz.png?size=100" width="50" height="50" /></a>
|
|
320
|
-
<a href="https://github.com/tobiasmuecksch"><img src="https://github.com/tobiasmuecksch.png?size=100" width="50" height="50" /></a>
|
|
321
|
-
<a href="https://github.com/dragermrb"><img src="https://github.com/dragermrb.png?size=100" width="50" height="50" /></a>
|
|
322
|
-
<a href="https://github.com/iamcco"><img src="https://github.com/iamcco.png?size=100" width="50" height="50" /></a>
|
|
323
|
-
<a href="https://github.com/eltociear"><img src="https://github.com/eltociear.png?size=100" width="50" height="50" /></a>
|
|
324
|
-
<a href="https://github.com/
|
|
325
|
-
<a href="https://github.com/
|
|
326
|
-
<a href="https://github.com/
|
|
327
|
-
<a href="https://github.com/rdlabo"><img src="https://github.com/rdlabo.png?size=100" width="50" height="50" /></a>
|
|
220
|
+
<a href="https://github.com/jepiqueau" title="jepiqueau"><img src="https://github.com/jepiqueau.png?size=100" width="50" height="50"/></a>
|
|
221
|
+
<a href="https://github.com/paulantoine2" title="paulantoine2"><img src="https://github.com/paulantoine2.png?size=100" width="50" height="50" alt=""/></a>
|
|
222
|
+
<a href="https://github.com/karyfars" title="karyfars"><img src="https://github.com/karyfars.png?size=100" width="50" height="50" /></a>
|
|
223
|
+
<a href="https://github.com/chriswep" title="chriswep"><img src="https://github.com/chriswep.png?size=100" width="50" height="50" /></a>
|
|
224
|
+
<a href="https://github.com/nirajhinge" title="nirajhinge"><img src="https://github.com/nirajhinge.png?size=100" width="50" height="50" /></a>
|
|
225
|
+
<a href="https://github.com/digaus" title="digaus"><img src="https://github.com/digaus.png?size=100" width="50" height="50" /></a>
|
|
226
|
+
<a href="https://github.com/IT-MikeS" title="IT-MikeS"><img src="https://github.com/IT-MikeS.png?size=100" width="50" height="50" /></a>
|
|
227
|
+
<a href="https://github.com/peakcool" title="peakcool"><img src="https://github.com/peakcool.png?size=100" width="50" height="50" /></a>
|
|
228
|
+
<a href="https://github.com/gion-andri" title="gion-andri"><img src="https://github.com/gion-andri.png?size=100" width="50" height="50" /></a>
|
|
229
|
+
<a href="https://github.com/robingenz" title="robingenz"><img src="https://github.com/robingenz.png?size=100" width="50" height="50" /></a>
|
|
230
|
+
<a href="https://github.com/dewald-els" title="dewald-els"><img src="https://github.com/dewald-els.png?size=100" width="50" height="50" /></a>
|
|
231
|
+
<a href="https://github.com/joewoodhouse" title="joewoodhouse"><img src="https://github.com/joewoodhouse.png?size=100" width="50" height="50" /></a>
|
|
232
|
+
<a href="https://github.com/ptasheq" title="ptasheq"><img src="https://github.com/ptasheq.png?size=100" width="50" height="50" /></a>
|
|
233
|
+
<a href="https://github.com/victorybiz" title="victorybiz"><img src="https://github.com/victorybiz.png?size=100" width="50" height="50" /></a>
|
|
234
|
+
<a href="https://github.com/tobiasmuecksch" title="tobiasmuecksch"><img src="https://github.com/tobiasmuecksch.png?size=100" width="50" height="50" /></a>
|
|
235
|
+
<a href="https://github.com/dragermrb" title="dragermrb"><img src="https://github.com/dragermrb.png?size=100" width="50" height="50" /></a>
|
|
236
|
+
<a href="https://github.com/iamcco" title="iamcco"><img src="https://github.com/iamcco.png?size=100" width="50" height="50" /></a>
|
|
237
|
+
<a href="https://github.com/eltociear" title="eltociear"><img src="https://github.com/eltociear.png?size=100" width="50" height="50" /></a>
|
|
238
|
+
<a href="https://github.com/antoniovlx" title="antoniovlx"><img src="https://github.com/antoniovlx.png?size=100" width="50" height="50" /></a>
|
|
239
|
+
<a href="https://github.com/HarelM" title="HarelM"><img src="https://github.com/HarelM.png?size=100" width="50" height="50" /></a>
|
|
240
|
+
<a href="https://github.com/rdlabo" title="rdlabo"><img src="https://github.com/rdlabo.png?size=100" width="50" height="50" /></a>
|
|
328
241
|
</p>
|
|
329
242
|
|
|
330
243
|
<!-- markdownlint-enable -->
|