@capgo/capacitor-data-storage-sqlite 6.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.
Files changed (59) hide show
  1. package/CapacitorDataStorageSqlite.podspec +18 -0
  2. package/LICENSE +21 -0
  3. package/android/build.gradle +63 -0
  4. package/android/src/main/AndroidManifest.xml +3 -0
  5. package/android/src/main/java/com/jeep/plugin/capacitor/capacitordatastoragesqlite/CapacitorDataStorageSqlite.java +387 -0
  6. package/android/src/main/java/com/jeep/plugin/capacitor/capacitordatastoragesqlite/CapacitorDataStorageSqlitePlugin.java +447 -0
  7. package/android/src/main/java/com/jeep/plugin/capacitor/capacitordatastoragesqlite/RetHandler.java +117 -0
  8. package/android/src/main/java/com/jeep/plugin/capacitor/capacitordatastoragesqlite/cdssUtils/Data.java +8 -0
  9. package/android/src/main/java/com/jeep/plugin/capacitor/capacitordatastoragesqlite/cdssUtils/Global.java +7 -0
  10. package/android/src/main/java/com/jeep/plugin/capacitor/capacitordatastoragesqlite/cdssUtils/ImportExportJson/JsonStore.java +131 -0
  11. package/android/src/main/java/com/jeep/plugin/capacitor/capacitordatastoragesqlite/cdssUtils/ImportExportJson/JsonTable.java +110 -0
  12. package/android/src/main/java/com/jeep/plugin/capacitor/capacitordatastoragesqlite/cdssUtils/ImportExportJson/JsonValue.java +89 -0
  13. package/android/src/main/java/com/jeep/plugin/capacitor/capacitordatastoragesqlite/cdssUtils/StorageDatabaseHelper.java +691 -0
  14. package/android/src/main/java/com/jeep/plugin/capacitor/capacitordatastoragesqlite/cdssUtils/UtilsSQLCipher.java +162 -0
  15. package/android/src/main/res/.gitkeep +0 -0
  16. package/dist/docs.json +995 -0
  17. package/dist/esm/definitions.d.ts +296 -0
  18. package/dist/esm/definitions.js +2 -0
  19. package/dist/esm/definitions.js.map +1 -0
  20. package/dist/esm/index.d.ts +4 -0
  21. package/dist/esm/index.js +9 -0
  22. package/dist/esm/index.js.map +1 -0
  23. package/dist/esm/web-utils/Data.d.ts +5 -0
  24. package/dist/esm/web-utils/Data.js +3 -0
  25. package/dist/esm/web-utils/Data.js.map +1 -0
  26. package/dist/esm/web-utils/StorageDatabaseHelper.d.ts +23 -0
  27. package/dist/esm/web-utils/StorageDatabaseHelper.js +247 -0
  28. package/dist/esm/web-utils/StorageDatabaseHelper.js.map +1 -0
  29. package/dist/esm/web-utils/json-utils.d.ts +15 -0
  30. package/dist/esm/web-utils/json-utils.js +76 -0
  31. package/dist/esm/web-utils/json-utils.js.map +1 -0
  32. package/dist/esm/web.d.ts +27 -0
  33. package/dist/esm/web.js +295 -0
  34. package/dist/esm/web.js.map +1 -0
  35. package/dist/plugin.cjs.js +633 -0
  36. package/dist/plugin.cjs.js.map +1 -0
  37. package/dist/plugin.js +635 -0
  38. package/dist/plugin.js.map +1 -0
  39. package/electron/dist/plugin.js +1044 -0
  40. package/electron/dist/plugin.js.map +1 -0
  41. package/electron/rollup.config.mjs +17 -0
  42. package/electron/tsconfig.json +19 -0
  43. package/ios/Plugin/CapacitorDataStorageSqlite.swift +550 -0
  44. package/ios/Plugin/CapacitorDataStorageSqlitePlugin.h +10 -0
  45. package/ios/Plugin/CapacitorDataStorageSqlitePlugin.m +29 -0
  46. package/ios/Plugin/CapacitorDataStorageSqlitePlugin.swift +550 -0
  47. package/ios/Plugin/Data.swift +16 -0
  48. package/ios/Plugin/Global.swift +13 -0
  49. package/ios/Plugin/ImportExportJson/JsonStore.swift +47 -0
  50. package/ios/Plugin/Info.plist +24 -0
  51. package/ios/Plugin/ReturnHandler.swift +85 -0
  52. package/ios/Plugin/StorageDatabaseHelper.swift +603 -0
  53. package/ios/Plugin/Utils/Blob.swift +41 -0
  54. package/ios/Plugin/Utils/UtilsBinding.swift +73 -0
  55. package/ios/Plugin/Utils/UtilsEncryption.swift +79 -0
  56. package/ios/Plugin/Utils/UtilsFile.swift +244 -0
  57. package/ios/Plugin/Utils/UtilsSQLCipher.swift +605 -0
  58. package/package.json +96 -0
  59. package/readme.md +203 -0
package/readme.md ADDED
@@ -0,0 +1,203 @@
1
+ <p align="center"><br><img src="https://user-images.githubusercontent.com/236501/85893648-1c92e880-b7a8-11ea-926d-95355b8175c7.png" width="128" height="128" /></p>
2
+ <h3 align="center">DATA STORAGE SQLITE</h3>
3
+ <p align="center"><strong><code>capacitor-data-storage-sqlite</code></strong></p>
4
+ <br>
5
+ <p align="center" style="font-size:50px;color:red"><strong>CAPACITOR 6</strong></p><br>
6
+ <br>
7
+ <!-- Note from the Owner - Start -->
8
+ <p align="center" style="font-size:50px;color:red"><strong>Note from the Owner</strong></p>
9
+ <!-- Note from the Owner - End -->
10
+ <br>
11
+ <!-- Message below Note from the Owner - Start -->
12
+ <p align="left" style="font-size:47px">This Plugin has been transfered to Capgo org after his original creator <a href="https://github.com/jepiqueau">@jepiqueau</a> decide to retire.
13
+ <br>We will foreer be thankful for the work he did.</p>
14
+ <br>
15
+ <p align="center">
16
+ Capacitor Data Storage SQlite Plugin is a custom Native Capacitor plugin providing a key-value permanent store for simple data of <strong>type string only</strong> to SQLite on IOS, Android and Electron platforms and to IndexDB for the Web platform.</p>
17
+
18
+ <p align="center">
19
+ <img src="https://img.shields.io/maintenance/yes/2023?style=flat-square" />
20
+ <a href="https://github.com/jepiqueau/capacitor-data-storage-sqlite/actions?query=workflow%3A%22CI%22"><img src="https://img.shields.io/github/workflow/status/jepiqueau/capacitor-data-storage-sqlite/CI?style=flat-square" /></a>
21
+ <a href="https://www.npmjs.com/package/jepiqueau/capacitor-data-storage-sqlite"><img src="https://img.shields.io/npm/l/capacitor-data-storage-sqlite.svg?style=flat-square" /></a>
22
+ <br>
23
+ <a href="https://www.npmjs.com/package/jepiqueau/capacitor-data-storage-sqlite"><img src="https://img.shields.io/npm/dw/capacitor-data-storage-sqlite?style=flat-square" /></a>
24
+ <a href="https://www.npmjs.com/package/jepiqueau/capacitor-data-storage-sqlite"><img src="https://img.shields.io/npm/v/capacitor-data-storage-sqlite?style=flat-square" /></a>
25
+ <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
26
+ <a href="#contributors-"><img src="https://img.shields.io/badge/all%20contributors-4-orange?style=flat-square" /></a>
27
+ <!-- ALL-CONTRIBUTORS-BADGE:END -->
28
+ </p>
29
+
30
+ ## Maintainers
31
+
32
+ | Maintainer | GitHub | Social |
33
+ | ----------------- | ----------------------------------------- | ------ |
34
+ | Martin Donadieu | [riderx](https://github.com/riderx) | |
35
+ | Quéau Jean Pierre | [jepiqueau](https://github.com/jepiqueau) | |
36
+
37
+ ## Browser Support
38
+
39
+ The plugin follows the guidelines from the `Capacitor Team`,
40
+
41
+ - [Capacitor Browser Support](https://capacitorjs.com/docs/v3/web#browser-support)
42
+
43
+ meaning that it will not work in IE11 without additional JavaScript transformations, e.g. with [Babel](https://babeljs.io/).
44
+
45
+ ## Installation
46
+
47
+ ```bash
48
+ npm install --save capacitor-data-storage-sqlite
49
+ npx cap sync
50
+ ```
51
+
52
+ - On iOS, no further steps are needed.
53
+
54
+ - On Android, no further steps are needed.
55
+
56
+ - On Web,
57
+ ```bash
58
+ npm install --save localforage
59
+ ```
60
+
61
+ - On Electron
62
+ ```bash
63
+ npm install --save @capacitor-community/electron
64
+ npx cap add @capacitor-community/electron
65
+ ```
66
+ Go to the Electron folder of your application
67
+
68
+ ```bash
69
+ cd electron
70
+ npm install --save sqlite3
71
+ npm install --save-dev @types/sqlite3
72
+ npm run build
73
+ cd ..
74
+ npx cap sync @capacitor-community/electron
75
+ ```
76
+
77
+ Then build YOUR_APPLICATION
78
+
79
+ ```
80
+ npm run build
81
+ npx cap copy
82
+ npx cap copy @capacitor-community/electron
83
+ npx cap open ios
84
+ npx cap open android
85
+ npx cap open @capacitor-community/electron
86
+ ionic serve
87
+ ```
88
+
89
+ ## Configuration
90
+
91
+ No configuration required for this plugin
92
+
93
+ ## Supported methods
94
+
95
+ | Name | Android | iOS | Electron | Web |
96
+ | :--------------------------- | :------ | :-- | :------- | :-- |
97
+ | openStore (non-encrypted DB) | ✅ | ✅ | ✅ | ✅ |
98
+ | openStore (encrypted DB) | ✅ | ✅ | ❌ | ❌ |
99
+ | closeStore | ✅ | ✅ | ✅ | ❌ |
100
+ | isStoreOpen | ✅ | ✅ | ✅ | ❌ |
101
+ | isStoreExists | ✅ | ✅ | ✅ | ❌ |
102
+ | deleteStore | ✅ | ✅ | ✅ | ❌ |
103
+ | setTable | ✅ | ✅ | ✅ | ✅ |
104
+ | set | ✅ | ✅ | ✅ | ✅ |
105
+ | get | ✅ | ✅ | ✅ | ✅ |
106
+ | iskey | ✅ | ✅ | ✅ | ✅ |
107
+ | keys | ✅ | ✅ | ✅ | ✅ |
108
+ | values | ✅ | ✅ | ✅ | ✅ |
109
+ | filtervalues | ✅ | ✅ | ✅ | ✅ |
110
+ | keysvalues | ✅ | ✅ | ✅ | ✅ |
111
+ | remove | ✅ | ✅ | ✅ | ✅ |
112
+ | clear | ✅ | ✅ | ✅ | ✅ |
113
+ | isTable | ✅ | ✅ | ✅ | ✅ |
114
+ | tables | ✅ | ✅ | ✅ | ✅ |
115
+ | deleteTable | ✅ | ✅ | ✅ | ❌ |
116
+ | isJsonValid | ✅ | ✅ | ✅ | ✅ |
117
+ | importFromJson | ✅ | ✅ | ✅ | ✅ |
118
+ | exportToJson | ✅ | ✅ | ✅ | ✅ |
119
+
120
+ ## Documentation
121
+
122
+ - [API_Documentation](docs/API.md)
123
+
124
+ - [USAGE_Documentation](docs/USAGE.md)
125
+
126
+ ## Applications demonstrating the use of the plugin
127
+
128
+ ### Ionic/Angular
129
+
130
+ - [angular-data-storage-sqlite-app-starter](https://github.com/jepiqueau/angular-data-storage-sqlite-app-starter)
131
+
132
+ ### Ionic/React
133
+
134
+ - [react-data-storage-sqlite-app-starter](https://github.com/jepiqueau/react-data-storage-sqlite-app-starter)
135
+
136
+ ### React
137
+
138
+ - [react-datastoragesqlite-app](https://github.com/jepiqueau/react-datastoragesqlite-app)
139
+
140
+ ### Ionic/Vue
141
+
142
+ - [vue-data-storage-sqlite-app-starter](https://github.com/jepiqueau/vue-data-storage-sqlite-app-starter)
143
+
144
+ ### Vue
145
+
146
+ - [vue-datastoragesqlite-app](https://github.com/jepiqueau/vue-datastoragesqlite-app)
147
+
148
+ ## Usage
149
+
150
+ - [see capacitor documentation](https://capacitor.ionicframework.com/docs/getting-started/with-ionic)
151
+
152
+ - [see USAGE_Documentation](https://github.com/Cap-go/capacitor-data-storage-sqlite/blob/main/docs/USAGE.md)
153
+
154
+ ## Dependencies
155
+
156
+ The IOS & Android code use SQLCipher allowing for database encryption.
157
+ The Android code is now based on `androidx.sqlite`. The database is not closed anymore after each transaction for performance improvement.
158
+ You must manage the `close` of the database before opening a new database.
159
+ The Web code use `localforage` package to store the datastore in the Browser.
160
+ The Electron code use `sqlite3`package
161
+
162
+ ## Contributors ✨
163
+
164
+ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
165
+
166
+ <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
167
+ <!-- prettier-ignore-start -->
168
+ <!-- markdownlint-disable -->
169
+ <table>
170
+ <tr>
171
+ <td align="center"><a href="https://github.com/jepiqueau"><img src="https://avatars3.githubusercontent.com/u/16580653?v=4" width="100px;" alt=""/><br /><sub><b>Jean Pierre Quéau</b></sub></a><br /><a href="https://github.com/capacitor-data-storage-sqlite/commits?author=jepiqueau" title="Code">💻</a></td>
172
+ <td align="center"><a href="https://github.com/mwpb"><img src="https://avatars.githubusercontent.com/u/12957941?v=4" width="100px;" alt=""/><br /><sub><b>Matthew Burke</b></sub></a><br /><a href="https://github.com/capacitor-data-storage-sqlite/commits?author=jepiqueau" title="Documentation">📖</a></td>
173
+ <td align="center"><a href="https://github.com/mwpb"><img src="https://avatars.githubusercontent.com/u/1745820?v=4" width="100px;" alt=""/><br /><sub><b>Kevin van Schaijk</b></sub></a><br /><a href="https://github.com/capacitor-data-storage-sqlite/commits?author=jepiqueau" title="Code">💻</a></td>
174
+ <td align="center"><a href="https://github.com/garbit"><img src="https://avatars.githubusercontent.com/u/555396?v=4" width="100px;" alt=""/><br /><sub><b>Andy Garbett</b></sub></a><br /><a href="https://github.com/capacitor-data-storage-sqlite/commits?author=jepiqueau" title="Documentation">📖</a></td>
175
+
176
+ </tr>
177
+ </table>
178
+
179
+ <!-- markdownlint-enable -->
180
+ <!-- prettier-ignore-end -->
181
+
182
+ <!-- ALL-CONTRIBUTORS-LIST:END -->
183
+
184
+ This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
185
+
186
+ <p align="left" style="font-size:47px">Retirement message of @jepiqueau --></p>
187
+ <br>
188
+ <p align="left">
189
+ I have been dedicated to developing and maintaining this plugin for many years since the inception of Ionic Capacitor. Now, at 73+ years old, and with my MacBook Pro becoming obsolete for running Capacitor 6 for iOS, I have made the decision to cease maintenance of the plugin. If anyone wishes to take ownership of this plugin, they are welcome to do so.
190
+ </p>
191
+ <br>
192
+ <p align="left">
193
+ It has been a great honor to be part of this development journey alongside the developer community. I am grateful to see many of you following me on this path and incorporating the plugin into your applications. Your comments and suggestions have motivated me to continuously improve it.
194
+ </p>
195
+ <br>
196
+ <p align="left">
197
+ I have made this decision due to several family-related troubles that require my full attention and time. Therefore, I will not be stepping back. Thank you to all of you for your support.
198
+ </p>
199
+ <br>
200
+ <p align="left" style="font-size:47px">End <--</p>
201
+ <!-- Message below Note from the Owner - End -->
202
+ <br>
203
+