@capacitor-community/sqlite
CAPACITOR 3 π§
Capacitor community plugin for Native and Electron SQLite Databases. In Native databases could be encrypted with SQLCipher
| Maintainer | GitHub | Social |
|---|---|---|
| QuΓ©au Jean Pierre | jepiqueau |
The refactor release has been upgraded to @capacitor/core@3.0.0-beta.1.
π¨ !!! ONLY iOS and Android plugins have been upgraded !!! π¨
π¨ Since release 3.0.0-beta.13 ->> π¨
-
GlobalSQLite
secretandnewsecretare deprecated -
The user can now set its own secure secret (passphrase)
-
use
setEncryptionSecretONCE to migrate encrypted databases fromsecrettosecure stored secret -
use
changeEncryptionSecretto change yoursecure stored secret
-
-
iOS used
KeyChain serviceto store thesecret -
Android used
Encrypted SharedPreferencesto store thesecret, the minimun sdk should be set to 23 (limitation from Google)
π¨ Since release 3.0.0-beta.13 ->> π¨
π¨ Since release 3.0.0-beta.11 ->> π¨
-
Checking of types has been removed in all methods of the plugin both iOS & Android. This has been achieved to allow the use of others RDBMS types. The type checking is now under the responsability of the developers.
-
NULL values are now returned as null
-
values for the
querymethod is now an Array of any. -
option to disable
transactionfor theexecute,executeSet,run.
π¨ Since release 3.0.0-beta.11 <<- π¨
The test has been achieved on:
The refactor offers now (since 2.9.0-beta.1) all the features that the previous was offering. It has been a quite heavy process, hoping that the developpers will take benefit from it.
The main reasons for it:
- multiple database connections
- db connector allowing for easy commands
db.open(), db.close, ... - improve the response time of the encrypted database by removing the internal open and close database for each sqlite query
- moving to the latest
androidx.sqlite.db.xxx - offering encryption for Electron platform by using
@journeyapps/sqlcipheron MacOs, !!! NOT ON WINDOWS !!! - cleaning and aligning the code between platforms
- allowing developers to develop
typeormorspatialitedrivers.
This was discussed lengthly in issue#1 and issue#52
Refactor available for Android, iOS and Electron platforms.
The test has been achieved on:
Other frameworks will be tested later
- Stencil
The 2.4.x is now π NOT MAINTAINED ANYMORE π.
To install it
npm i --save @capacitor-community/sqlite@initialThe test has been achieved on:
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.
npm install @capacitor-community/sqlite@next
npm run build
npx cap sync
npx cap add android
npx cap add ios
// npx cap add @capacitor-community/electron not working- on iOS, no further steps needed.
- On Android, no further steps needed.
- On Electron, go to the Electron folder of YOUR_APPLICATION
npm install --save @journeyapps/sqlcipher
npm run build
npx cap copy
npx cap copy @capacitor-community/electron
npx cap open ios
npx cap open android
npx cap open @capacitor-community/electron
When you will find issues, please report them with the NEXT word at the start of the issue title.
No configuration required for this plugin
| Name | Android | iOS | Electron Mac | Electron Windows | Web |
|---|---|---|---|---|---|
| createConnection | β | β | π§ | π§ | β |
| closeConnection | β | β | π§ | π§ | β |
| isConnection | β | β | π§ | π§ | β |
| open (non-encrypted DB) | β | β | π§ | π§ | β |
| open (encrypted DB) | β | β | π§ | π§ | β |
| close | β | β | π§ | π§ | β |
| execute | β | β | π§ | π§ | β |
| executeSet | β | β | π§ | π§ | β |
| run | β | β | π§ | π§ | β |
| query | β | β | π§ | π§ | β |
| deleteDatabase | β | β | π§ | π§ | β |
| importFromJson | β | β | π§ | π§ | β |
| exportToJson | β | β | π§ | π§ | β |
| createSyncTable | β | β | π§ | π§ | β |
| setSyncDate | β | β | π§ | π§ | β |
| getSyncDate | β | β | π§ | π§ | β |
| isJsonValid | β | β | π§ | π§ | β |
| isDBExists | β | β | π§ | π§ | β |
| addUpgradeStatement | β | β | π§ | π§ | β |
| copyFromAssets | β | β | π§ | π§ | β |
| isDBOpen | β | β | π§ | π§ | β |
| isDatabase | β | β | π§ | π§ | β |
| isTableExists | β | β | π§ | π§ | β |
| getDatabaseList | β | β | π§ | π§ | β |
| addSQLiteSuffix | β | β | π§ | π§ | β |
| deleteOldDatabases | β | β | π§ | π§ | β |
| checkConnectionsConsistency | β | β | π§ | π§ | β |
| isSecretStored | β | β | π§ | π§ | β |
| setEncryptionSecret | β | β | π§ | π§ | β |
| changeEncryptionSecret | β | β | π§ | π§ | β |
-Datatypes In SQLite Version 3
The IOS and Android codes are using SQLCipher allowing for database encryption
The Electron code use @journeyapps/sqlcipher allowing for database encryption for MacOS π¨ !!! NOT for Windows !!! π¨
Thanks goes to these wonderful people (emoji key):
Jean Pierre QuΓ©au π» |
Paul Antoine π» |
Karyfars π» |
Chriswep π |
This project follows the all-contributors specification. Contributions of any kind welcome!
