sqlite-fieldservice v1.0.8
Maintainer
| Maintainer | GitHub | Social |
|---|---|---|
| Capacitor Community | (https://www.npmjs.com/package/@capacitor-community/sqlite) |
CAPACITOR 3 (Master)
šØ Since release 3.2.5-2 ->> šØ
- support zip file in copyFromAssets method
- add optional
overwriteparameter (true/false) default to true
šØ Since release 3.2.5-2 <<- šØ
šØ Since release 3.2.3-1 ->> šØ
The initWebStore and saveToStore methods have been added to the Web platform.
- The
initWebStorehas been added to fix the issue#172 and since then isMANDATORY... if(platform === "web") { await customElements.whenDefined('jeep-sqlite'); const jeepSqliteEl = document.querySelector('jeep-sqlite'); if(jeepSqliteEl != null) { await sqliteConnection.initWebStore() ... } } ... the
saveToStoreallows to perform intermediate save of the database in case the browser needs to delete the cache.
šØ Since release 3.2.3-1 <<- šØ
The test has been achieved on:
Browser Support
The plugin follows the guidelines from the Capacitor Team,
meaning that it will not work in IE11 without additional JavaScript transformations, e.g. with Babel.
Installation
npm install @capacitor-community/sqlite
npm run build
npx cap add android
npx cap add ios
npx cap add @capacitor-community/electronand do when you update
npx cap sync
npx cap sync @capacitor-community/electronWeb
For Angular framework
- copy manually the file
sql-wasm.wasmfromnodes_modules/sql.js/dist/sql-wasm.wasmto thesrc/assetsfolder of YOUR_APP
For Vue & React frameworks
- copy manually the file
sql-wasm.wasmfromnodes_modules/sql.js/dist/sql-wasm.wasmto thepublic/assetsfolder of YOUR_APP
IOS
- on iOS, no further steps needed.
Android
- On Android, no further steps needed.
Electron
- On Electron, go to the Electron folder of YOUR_APPLICATION
cd electron
npm install --save sqlite3
npm install --save jszip
npm install --save-dev @types/sqlite3
npm run buildBuild & Run
npm run build
npx cap copy
npx cap copy web
npx cap copy @capacitor-community/electronWeb
- Angular
ionic serve- Vue
npm run serve- React
npm run startIOS
npx cap open iosAndroid
npx cap open androidElectron
npx cap open @capacitor-community/electronReadme previous releases
Issues
Configuration
No configuration required for this plugin
Supported methods
| Name | Android | iOS | Electron | Web |
|---|---|---|---|---|
| createConnection | ā | ā | ā | ā |
| closeConnection | ā | ā | ā | ā |
| isConnection | ā | ā | ā | ā |
| open (non-encrypted DB) | ā | ā | ā | ā |
| open (encrypted DB) | ā | ā | ā | ā |
| close | ā | ā | ā | ā |
| getVersion | ā | ā | ā | ā |
| execute | ā | ā | ā | ā |
| executeSet | ā | ā | ā | ā |
| run | ā | ā | ā | ā |
| query | ā | ā | ā | ā |
| deleteDatabase | ā | ā | ā | ā |
| importFromJson | ā | ā | ā | ā |
| exportToJson | ā | ā | ā | ā |
| createSyncTable | ā | ā | ā | ā |
| setSyncDate | ā | ā | ā | ā |
| getSyncDate | ā | ā | ā | ā |
| isJsonValid | ā | ā | ā | ā |
| isDBExists | ā | ā | ā | ā |
| addUpgradeStatement | ā | ā | ā | ā |
| copyFromAssets | ā | ā | ā | ā |
| isDBOpen | ā | ā | ā | ā |
| isDatabase | ā | ā | ā | ā |
| isTableExists | ā | ā | ā | ā |
| getDatabaseList | ā | ā | ā | ā |
| getMigratableDbList | ā | ā | ā | ā |
| addSQLiteSuffix | ā | ā | ā | ā |
| deleteOldDatabases | ā | ā | ā | ā |
| checkConnectionsConsistency | ā | ā | ā | ā |
| isSecretStored | ā | ā | ā | ā |
| setEncryptionSecret | ā | ā | ā | ā |
| changeEncryptionSecret | ā | ā | ā | ā |
| initWebStore | ā | ā | ā | ā |
| saveToStore | ā | ā | ā | ā |
Supported SQLite Types
-Datatypes In SQLite Version 3
Documentation
API
Framework's Usage
Applications demonstrating the use of the plugin
Ionic/Angular
Ionic/React
React+Vite
Ionic/Vue
Vue
Vue+Vite
Usage
Dependencies
The iOS and Android codes are using SQLCipher allowing for database encryption.
The iOS codes is using ZIPFoundation for unzipping assets files
The Electron code is using sqlite3.
The Web code is using the Stencil component jeep-sqlite based on sql.js, localforage. and jszip