Gathering detailed insights and metrics for @capacitor-community/sqlite
Gathering detailed insights and metrics for @capacitor-community/sqlite
Gathering detailed insights and metrics for @capacitor-community/sqlite
Gathering detailed insights and metrics for @capacitor-community/sqlite
npm install @capacitor-community/sqlite
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
506 Stars
788 Commits
122 Forks
13 Watching
12 Branches
58 Contributors
Updated on 22 Nov 2024
Swift (41.35%)
Java (33.25%)
TypeScript (24.83%)
Objective-C (0.36%)
JavaScript (0.12%)
Ruby (0.1%)
Cumulative downloads
Total Downloads
Last day
-1.1%
2,210
Compared to previous day
Last week
8%
12,144
Compared to previous week
Last month
-13.4%
51,775
Compared to previous month
Last year
29%
590,199
Compared to previous year
1
1
@capacitor-community/sqlite
Capacitor community plugin for Native and Electron SQLite Databases. - In Native, databases could be encrypted with `SQLCipher` - In Electron, databases could be encrypted with `better-sqlite3-multiple-ciphers`
Maintainer | GitHub | Social |
---|---|---|
Robin Genz | robingenz | @robin_genz |
To install:
npm install --save @capacitor-community/sqlite
npx cap sync
yarn add @capacitor-community/sqlite
npx cap sync
pnpm install --save @capacitor-community/sqlite
pnpm install --save jeep-sqlite
pnpm install --save sql.js
npx cap sync
then add plugin to main capacitor.config.ts
file:
1import { CapacitorConfig } from '@capacitor/cli'; 2 3const config: CapacitorConfig = { 4 appId: 'com.jeep.app.ionic7.angular.sqlite', 5 appName: 'ionic7-angular-sqlite-starter', 6 webDir: 'www', 7 server: { 8 androidScheme: 'https' 9 }, 10 plugins: { 11 CapacitorSQLite: { 12 iosDatabaseLocation: 'Library/CapacitorDatabase', 13 iosIsEncryption: true, 14 iosKeychainPrefix: 'angular-sqlite-app-starter', 15 iosBiometric: { 16 biometricAuth: false, 17 biometricTitle : "Biometric login for capacitor sqlite" 18 }, 19 androidIsEncryption: true, 20 androidBiometric: { 21 biometricAuth : false, 22 biometricTitle : "Biometric login for capacitor sqlite", 23 biometricSubTitle : "Log in using your biometric" 24 }, 25 electronIsEncryption: true, 26 electronWindowsLocation: "C:\\ProgramData\\CapacitorDatabases", 27 electronMacLocation: "/Volumes/Development_Lacie/Development/Databases", 28 electronLinuxLocation: "Databases" 29 } 30 } 31}; 32export default config; 33
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. You'll need the usual capacitor/android/react npm script to build and copy the assets folder.
sql-wasm.wasm
from node_modules/sql.js/dist/sql-wasm.wasm
to the src/assets
folder of YOUR_APPsql-wasm.wasm
from node_modules/sql.js/dist/sql-wasm.wasm
to the public/assets
folder of YOUR_APPx files found with path 'build-data.properties'.
You can you add the following code to app/build.gradle
: packagingOptions {
exclude 'build-data.properties'
}
See #301 and SO question for more information.
Check/Add the following: Gradle JDK version 17 Android Gradle Plugin Version 8.0.0 In variables.gradle
minSdkVersion = 22
compileSdkVersion = 33
targetSdkVersion = 33
In AndroidManifest.xml
<application
android:allowBackup="false"
android:fullBackupContent="false"
android:dataExtractionRules="@xml/data_extraction_rules"
In res/xml create a file data_extraction_rules.xml
containing:
<?xml version="1.0" encoding="utf-8"?>
<data-extraction-rules>
<cloud-backup>
<exclude domain="root" />
<exclude domain="database" />
<exclude domain="sharedpref" />
<exclude domain="external" />
</cloud-backup>
<device-transfer>
<exclude domain="root" />
<exclude domain="database" />
<exclude domain="sharedpref" />
<exclude domain="external" />
</device-transfer>
</data-extraction-rules>
1cd electron 2npm install --save better-sqlite3-multiple-ciphers 3npm install --save electron-json-storage 4npm install --save jszip 5npm install --save node-fetch@2.6.7 6npm install --save crypto 7npm install --save crypto-js 8npm install --save-dev @types/better-sqlite3 9npm install --save-dev @types/electron-json-storage 10npm install --save-dev @types/crypto-js
Important: node-fetch
version must be <=2.6.7
; otherwise you'll get an error running the app.
Important: if you are using @capacitor-community/electron v5
1npm install --save-dev electron@25.8.4 2npm uninstall --save-dev electron-rebuild 3npm install --save-dev @electron/rebuild 4npm install --save-dev electron-builder@24.6.4
in electron folder open the tsconfig.json
file and add "skipLibCheck": true,
Name | Android | iOS | Electron | Web |
---|---|---|---|---|
createConnection (ReadWrite) | âś… | âś… | âś… | âś… |
createConnection (ReadOnly) | ✅ | ✅ | ✅ | ❌ |
closeConnection (ReadWrite) | âś… | âś… | âś… | âś… |
closeConnection (ReadOnly) | ✅ | ✅ | ✅ | ❌ |
isConnection (ReadWrite) | âś… | âś… | âś… | âś… |
isConnection (ReadOnly) | ✅ | ✅ | ✅ | ❌ |
open (non-encrypted DB) | âś… | âś… | âś… | âś… |
open (encrypted DB) | ✅ | ✅ | ✅ | ❌ |
close | âś… | âś… | âś… | âś… |
getUrl | ✅ | ✅ | ❌ | ❌ |
getVersion | âś… | âś… | âś… | âś… |
execute | âś… | âś… | âś… | âś… |
executeSet | âś… | âś… | âś… | âś… |
run | âś… | âś… | âś… | âś… |
query | âś… | âś… | âś… | âś… |
deleteDatabase | âś… | âś… | âś… | âś… |
importFromJson | âś… | âś… | âś… | âś… |
exportToJson | âś… | âś… | âś… | âś… |
deleteExportedRows | âś… | âś… | âś… | âś… |
createSyncTable | âś… | âś… | âś… | âś… |
setSyncDate | âś… | âś… | âś… | âś… |
getSyncDate | âś… | âś… | âś… | âś… |
isJsonValid | âś… | âś… | âś… | âś… |
isDBExists | âś… | âś… | âś… | âś… |
addUpgradeStatement | âś… | âś… | âś… | âś… |
copyFromAssets | âś… | âś… | âś… | âś… |
isDBOpen | âś… | âś… | âś… | âś… |
isDatabase | âś… | âś… | âś… | âś… |
isTableExists | âś… | âś… | âś… | âś… |
getTableList | âś… | âś… | âś… | âś… |
getDatabaseList | âś… | âś… | âś… | âś… |
getMigratableDbList | ✅ | ✅ | ❌ | ❌ |
addSQLiteSuffix | ✅ | ✅ | ❌ | ❌ |
deleteOldDatabases | ✅ | ✅ | ❌ | ❌ |
moveDatabasesAndAddSuffix | ✅ | ✅ | ❌ | ❌ |
checkConnectionsConsistency | âś… | âś… | âś… | âś… |
isSecretStored | ✅ | ✅ | ✅ | ❌ |
setEncryptionSecret | ✅ | ✅ | ✅ | ❌ |
changeEncryptionSecret | ✅ | ✅ | ✅ | ❌ |
clearEncryptionSecret | ✅ | ✅ | ✅ | ❌ |
checkEncryptionSecret | ✅ | ✅ | ✅ | ❌ |
initWebStore | ❌ | ❌ | ❌ | ✅ |
saveToStore | ❌ | ❌ | ❌ | ✅ |
getNCDatabasePath | ✅ | ✅ | ❌ | ❌ |
createNCConnection | ✅ | ✅ | ❌ | ❌ |
closeNCConnection | ✅ | ✅ | ❌ | ❌ |
isNCDatabase | ✅ | ✅ | ❌ | ❌ |
transaction | âś… | âś… | âś… | âś… |
getFromHTTPRequest | âś… | âś… | âś… | âś… |
isDatabaseEncrypted | ✅ | ✅ | ✅ | ❌ |
isInConfigEncryption | ✅ | ✅ | ✅ | ❌ |
isInConfigBiometricAuth | ✅ | ✅ | ❌ | ❌ |
getFromLocalDiskToStore | ❌ | ❌ | ❌ | ✅ |
saveToLocalDisk | ❌ | ❌ | ❌ | ✅ |
beginTransaction | âś… | âś… | âś… | âś… |
commitTransaction | âś… | âś… | âś… | âś… |
rollbackTransaction | âś… | âś… | âś… | âś… |
isTransactionActive | âś… | âś… | âś… | âś… |
Web ionic7-angular-sqlite-app Ionic 7 Angular 16 Capacitor 5 SQLite CRUD operations for Web.
Native ionic7-angular-sqlite-app Ionic 7 Angular 16 Capacitor 5 SQLite CRUD operations for iOS, Android and Electron.
angular-sqlite-synchronize-app (Not Updated)
Web ionic7-react-sqlite-app Ionic7 React18.2.0 Vite4.3.9 Capacitor 5 SQLite CRUD operations for Web.
Web ionic7-react-sqlite-app Ionic7 React18.2.0 Vite4.3.9 Capacitor 5 SQLite CRUD operations for iOS, Android and Electron.
Web ionic7-vue-sqlite-app Ionic7 Vue3.2.45 Vite4.3.9 Capacitor 5 SQLite CRUD operations for Web.
Web ionic7-vue-sqlite-app Ionic7 Vue3.2.45 Vite4.3.9 Capacitor 5 SQLite CRUD operations for iOS, Android and Electron.
Web quasar-sqlite-app Quasar2.6.0 Capacitor 5 SQLite CRUD operations for Web.
Native quasar-sqlite-app Quasar2.6.0 Capacitor 5 SQLite CRUD operations for iOS, Android and Electron.
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 better-sqlite3-multiple-ciphers
, electron-json-storage
and node-fetch
from 5.0.4.
The Web code is using the Stencil component jeep-sqlite
based on sql.js
, localforage
. and jszip
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!
A big thank you to Jean Pierre Quéau, who maintained this plugin until version 6.0.0.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
28 commit(s) and 5 issue activity found in the last 90 days -- score normalized to 10
Reason
license file detected
Details
Reason
binaries present in source code
Details
Reason
2 existing vulnerabilities detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 4
Details
Reason
Found 4/30 approved changesets -- score normalized to 1
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More